CACAO
Macros | Enumerations
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...
 

Enumerations

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

Macro Definition Documentation

#define MD_TRAP_COMPILER_FIXUP (   xpc,
  ra,
  sp,
  pv 
)
Value:
do { \
(xpc) = (void*) (((uintptr_t) (ra)) - 8); \
} while(0)
#define ra
Definition: md-asm.hpp:62
#define xpc
Definition: md-asm.hpp:51

Macro to fixup a compiler stub.

The XPC is the RA minus 8, because the RA points to two instructions after the call.

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

#define TRAP_INSTRUCTION_IS_LOAD   1

Trap number defines.

On this architecture (mips) 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_COMPILER 
TRAP_COUNTDOWN 
TRAP_AbstractMethodError 
TRAP_THROW 
TRAP_NAT_EXCEPTION 
TRAP_END 
TRAP_PATCHER 

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