interp_defs.h File Reference


Detailed Description

Major interpreter-related definitions.


Classes

union  Value
 Holds 32-bit values. More...
union  Value2
 Holds 64-bit values. More...
class  Stack
 The stack for executing the Java method. More...
class  Locals
 The storage for local variables of the executed Java method. More...
struct  FramePopListener
 The list of functions that listen for the PopFrame event. More...
struct  MonitorList
 The list of monitors locked by this method. More...
struct  StackFrame
 The representation of the method being executed. More...

Defines

#define LOG_DOMAIN   "interpreter.unspecified"
#define DEBUG_PRINT(a)   TRACE2("interpreter", a)
 Calls TRACE2 with the interpreter category.
#define DEBUG(a)
 Does nothing.
#define DEBUG_BYTECODE(a)   { if (frame.dump_bytecodes) DEBUG_PRINT(a); }
 If DEBUG is on, calls DEBUG_PRINT(a).
#define DEBUG_GC(a)   TRACE2("gc_interpreter", a)
 Calls TRACE2 with the gc_interpreter category.
#define DEBUG2(a)   INFO(a)
 Calls INFO(a).
#define DEBUG_TRACE_PLAIN(a)   TRACE2("interpreter", a)
 Calls TRACE2 with the interpreter category.
#define DEBUG_TRACE(a)   TRACE2("folded_interpreter", a)
 Calls TRACE2 with the folded_interpreter category.
#define ASSERT_TAGS(a)
 Does nothing.
#define ASSERT_OBJECT(a)
 Checks the object.
#define ALLOC_FRAME(sz)   alloca(sz)
 Calls alloca(sz).
#define FREE_FRAME(ptr)
 If INTERPRETER_USE_MALLOC_ALLOCATION is on, does nothing.
#define uword   uint32
#define word   int32
#define VAL32
#define MAKEREFVAL(_val_)   (*((ManagedObject**)(&(_val_))))
#define MAKECRVAL(_val_)   (*((COMPRESSED_REFERENCE*)(&(_val_))))
#define STORE_UREF_BY_ADDR(_addr_, _val_)
#define UNCOMPRESS_REF(cref)
#define COMPRESS_INTERP(ref)   ((ManagedObject*)(ref))
#define UNCOMPRESS_INTERP(cref)   ((ManagedObject*)(cref))
#define REF_NULL   0
#define s0   1
 The stack value.
#define s1   0
#define l0   0
 The local value.
#define l1   1
 The local value.
#define c0   0
 The constant value.
#define c1   1
 The constant value.
#define a0   0
 The argument value.
#define a1   1
 The argument value.
#define ar0   0
 The array value.
#define ar1   1
 The array value.
#define res0   1
 The result value.
#define res1   0
 The result value.
#define SETUP_LOCALS_AND_STACK(frame, method)
 Sets up locals and stack on the C stack.

Typedefs

typedef ManagedObject * REF

Enumerations

enum  { FLAG_NONE = 0, FLAG_RET_ADDR = 2, FLAG_OBJECT = 3 }
 The local variable types. More...
enum  PopFrameState { POP_FRAME_UNAVAILABLE, POP_FRAME_AVAILABLE, POP_FRAME_NOW }
 The pop_frame states. More...
enum  interpreter_state { INTERP_STATE_STACK_OVERFLOW = 1 }
 The interpreter states. More...
enum  interpreter_ti_events {
  INTERPRETER_TI_METHOD_ENTRY_EVENT = 1, INTERPRETER_TI_METHOD_EXIT_EVENT = 2, INTERPRETER_TI_SINGLE_STEP_EVENT = 4, INTERPRETER_TI_POP_FRAME_EVENT = 8,
  INTERPRETER_TI_FIELD_ACCESS = 16, INTERPRETER_TI_FIELD_MODIFICATION = 32, INTERPRETER_TI_OTHER = 64
}
 The interpreter jvmti events. More...

Functions

uint8 Opcode_BREAKPOINT (StackFrame &frame)
 The function for interpreter breakpoint processing.
void interp_enumerate_root_set_single_thread_on_stack (VM_thread *)
 Enumerates references associated with the thread.
void interpreter_execute_native_method (Method *method, jvalue *return_value, jvalue *args)
 Executes the native method.
void interpreterInvokeStaticNative (StackFrame &prevFrame, StackFrame &frame, Method *method)
 Calls the static native method.
void interpreterInvokeVirtualNative (StackFrame &prevFrame, StackFrame &frame, Method *method, int sz)
 Calls the virtual native method.
void interpreter_execute_method (Method *method, jvalue *return_value, jvalue *args)
 Executes the method.
void method_entry_callback (Method *method)
 Processes method entry events.
void method_exit_callback (Method *method, bool was_popped_by_exception, jvalue ret_val)
 Processes method exit events.
void method_exit_callback_with_frame (Method *method, StackFrame &frame)
 Processes method exit events.
void putfield_callback (Field *field, StackFrame &frame)
 Processes the field modification event.
void getfield_callback (Field *field, StackFrame &frame)
 Processes the field modification event.
void putstatic_callback (Field *field, StackFrame &frame)
 Processes the field modification event.
void getstatic_callback (Field *field, StackFrame &frame)
 Processes the field modification event.
void frame_pop_callback (FramePopListener *l, Method *method, jboolean was_popped_by_exception)
 Processes the frame pop event.
void single_step_callback (StackFrame &frame)
 Processes the single step event.
bool findExceptionHandler (StackFrame &frame, ManagedObject **exception, Handler **h)
 Finds the exception handler.
bool load_method_handled_exceptions (Method *m)
 Loads method handled exceptions.
static StackFramegetLastStackFrame ()
 Returns the last stack frame.
static StackFramegetLastStackFrame (VM_thread *thread)
 Returns the last stack frame.
static void setLastStackFrame (StackFrame *frame)
 Sets the last stack frame.

Variables

bool interpreter_enable_debug
 TRUE if the interpreter enables debug.
int interpreter_ti_notification_mode
 The global flags' section.


Define Documentation

#define LOG_DOMAIN   "interpreter.unspecified"

#define DEBUG_PRINT (  )     TRACE2("interpreter", a)

Calls TRACE2 with the interpreter category.

#define DEBUG (  ) 

Does nothing.

#define DEBUG_BYTECODE (  )     { if (frame.dump_bytecodes) DEBUG_PRINT(a); }

If DEBUG is on, calls DEBUG_PRINT(a).

#define DEBUG_GC (  )     TRACE2("gc_interpreter", a)

Calls TRACE2 with the gc_interpreter category.

#define DEBUG2 (  )     INFO(a)

Calls INFO(a).

#define DEBUG_TRACE_PLAIN (  )     TRACE2("interpreter", a)

Calls TRACE2 with the interpreter category.

#define DEBUG_TRACE (  )     TRACE2("folded_interpreter", a)

Calls TRACE2 with the folded_interpreter category.

#define ASSERT_TAGS (  ) 

Does nothing.

#define ASSERT_OBJECT (  ) 

Value:

assert((a == 0) ||                                         \
    ( (*((a)->vt()->clss->get_class_handle()))->vt()->clss ==  \
            VM_Global_State::loader_env->JavaLangClass_Class))
Checks the object.

#define ALLOC_FRAME ( sz   )     alloca(sz)

Calls alloca(sz).

#define FREE_FRAME ( ptr   ) 

If INTERPRETER_USE_MALLOC_ALLOCATION is on, does nothing.

#define uword   uint32

#define word   int32

#define VAL32

#define MAKEREFVAL ( _val_   )     (*((ManagedObject**)(&(_val_))))

#define MAKECRVAL ( _val_   )     (*((COMPRESSED_REFERENCE*)(&(_val_))))

#define STORE_UREF_BY_ADDR ( _addr_,
_val_   ) 

Value:

if (REFS_IS_COMPRESSED_MODE) {                                          \
        *((COMPRESSED_REFERENCE*)(_addr_)) = compress_reference(_val_);     \
    } else {                                                                \
        *((ManagedObject**)(_addr_)) = (ManagedObject*)(_val_);             \
    }

#define UNCOMPRESS_REF ( cref   ) 

Value:

( REFS_IS_COMPRESSED_MODE ?                 \
            (uncompress_compressed_reference(MAKECRVAL(cref))) :            \
            (MAKEREFVAL(cref)))

#define COMPRESS_INTERP ( ref   )     ((ManagedObject*)(ref))

#define UNCOMPRESS_INTERP ( cref   )     ((ManagedObject*)(cref))

#define REF_NULL   0

#define s0   1

The stack value.

Note:
Values on the java stack are placed in the reversed order, so that the reversed copy in the function call works correctly.

#define s1   0

#define l0   0

The local value.

#define l1   1

The local value.

#define c0   0

The constant value.

#define c1   1

The constant value.

#define a0   0

The argument value.

#define a1   1

The argument value.

#define ar0   0

The array value.

#define ar1   1

The array value.

#define res0   1

The result value.

#define res1   0

The result value.

#define SETUP_LOCALS_AND_STACK ( frame,
method   ) 

Value:

int max_stack = method->get_max_stack();                   \
    frame.stack.init(ALLOC_FRAME(                              \
                Stack::getStorageSize(max_stack)), max_stack); \
    int max_locals = method->get_max_locals();                 \
    frame.locals.init(ALLOC_FRAME(                             \
                Locals::getStorageSize(max_locals)), max_locals)
Sets up locals and stack on the C stack.


Typedef Documentation

typedef ManagedObject* REF


Enumeration Type Documentation

anonymous enum

The local variable types.

Enumerator:
FLAG_NONE  The element of stack or local variables that is not an object.

FLAG_RET_ADDR  The container for the return address from a subroutine.

FLAG_OBJECT  The containter for an object reference.

enum PopFrameState

The pop_frame states.

Enumerator:
POP_FRAME_UNAVAILABLE  Indicates that the frame cannot be popped.

POP_FRAME_AVAILABLE  Indicates that the frame can be popped.

POP_FRAME_NOW  Indicates that the frame is being popped.

enum interpreter_ti_events

The interpreter jvmti events.

Enumerator:
INTERPRETER_TI_METHOD_ENTRY_EVENT  The method entry event.

INTERPRETER_TI_METHOD_EXIT_EVENT  The method exit event.

INTERPRETER_TI_SINGLE_STEP_EVENT  The single step event.

INTERPRETER_TI_POP_FRAME_EVENT  The pop-frame event.

INTERPRETER_TI_FIELD_ACCESS  The field access event.

INTERPRETER_TI_FIELD_MODIFICATION  The field modification event.

INTERPRETER_TI_OTHER  For other events.


Variable Documentation

bool interpreter_enable_debug

TRUE if the interpreter enables debug.

int interpreter_ti_notification_mode

The global flags' section.

Bitwise or of enabled interpreter_ti_events


Genereated on Tue Mar 11 19:25:37 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.