Execution engine & native code calling subsystem: most based on interpreter mode


Data Structure

/* defined in constants.h; also typedef as stack or some related type. */
/* to represent a stack entry */
typedef struct _slots {
        union {
                jint            tint;
                jword           tword;
                jlong           tlong;
                jfloat          tfloat;
                jdouble         tdouble;
                void*           taddr;
                char*           tstr;
        } v;
} slots;

/* defined in constants.h. */
/* used to access a slot in constanmt pool */
typedef struct _constants {
        u4              size;
        u1*             tags;
        ConstSlot*      data;
} constants;
 


Process

callMethodA or callMethodV depend on the argument type.

  For interpreter mode:

     #If not native method, call virtualMachine to execute the bytecode.
     #If native method, make the call for native method - system dependent (sysdepCallMethod).

  Fot JIT mode, make the call for native method - system dependent (sysdepCallMethod), which again will call Translate for the first time
executing the bytecode.