CACAO
Macros | Enumerations | Functions
md-trap.hpp File Reference

Go to the source code of this file.

Macros

#define TRAP_INSTRUCTION_IS_LOAD   1
 Trap number defines. More...
 
#define MD_TRAP_COMPILER_FIXUP(xpc, ra, sp, pv)
 Macro to fixup a compiler stub. More...
 
#define ALIGN_PATCHER_TRAP
 Align traps so they don't cross cache line boundaries. More...
 

Enumerations

enum  {
  TRAP_NullPointerException = 0, TRAP_ArithmeticException = 1, TRAP_ArrayIndexOutOfBoundsException = 2, TRAP_ArrayStoreException = 3,
  TRAP_ClassCastException = 4, TRAP_CHECK_EXCEPTION = 5, TRAP_PATCHER = 6, TRAP_COMPILER = 7,
  TRAP_COUNTDOWN = 8, TRAP_AbstractMethodError = 9, TRAP_THROW = 10, TRAP_NAT_EXCEPTION = 11,
  TRAP_END
}
 

Functions

void emit_patcher_alignment (codegendata *cd)
 

Macro Definition Documentation

#define ALIGN_PATCHER_TRAP

Align traps so they don't cross cache line boundaries.

Definition at line 84 of file md-trap.hpp.

#define MD_TRAP_COMPILER_FIXUP (   xpc,
  ra,
  sp,
  pv 
)
Value:
do { \
(pv) = (xpc); \
(sp) = (void*) (((uintptr_t) (sp)) + 1 * SIZEOF_VOID_P); \
(xpc) = (void*) (((uintptr_t) (ra)) - 2); \
} while(0)
#define pv
Definition: md-asm.hpp:65
#define ra
Definition: md-asm.hpp:62
#define xpc
Definition: md-asm.hpp:51
#define sp
Definition: md-asm.hpp:81
static void * md_stacktrace_get_returnaddress(void *sp, int32_t stackframesize)
Definition: md.hpp:76

Macro to fixup a compiler stub.

PV : The PV from the compiler stub is equal to the XPC. RA : We use a framesize of zero here because the call pushed the return addres onto the stack. SP : Skip the RA on the stack. XPC: The XPC is the RA minus 2, because the RA points to the instruction after the call.

Definition at line 72 of file md-trap.hpp.

#define TRAP_INSTRUCTION_IS_LOAD   1

Trap number defines.

On this architecture (i386) the trap numbers are used as load displacements and thus must not be 4- or 8-byte aligned.

NOTE: In trap_init() we have a check whether the offset of java_arrayheader.data[0] is greater than the largest displacement defined below. Otherwise normal array loads/stores could trigger an exception.

Definition at line 44 of file md-trap.hpp.

Enumeration Type Documentation

anonymous enum
Enumerator
TRAP_NullPointerException 
TRAP_ArithmeticException 
TRAP_ArrayIndexOutOfBoundsException 
TRAP_ArrayStoreException 
TRAP_ClassCastException 
TRAP_CHECK_EXCEPTION 
TRAP_PATCHER 
TRAP_COMPILER 
TRAP_COUNTDOWN 
TRAP_AbstractMethodError 
TRAP_THROW 
TRAP_NAT_EXCEPTION 
TRAP_END 

Definition at line 46 of file md-trap.hpp.

Function Documentation

void emit_patcher_alignment ( codegendata cd)

Definition at line 578 of file emit.cpp.