CACAO
Data Structures | Macros | Typedefs | Functions | Variables
intrp.h File Reference

Go to the source code of this file.

Data Structures

union  Double_Store
 
union  Cell_float
 

Macros

#define MAYBE_UNUSED   __attribute__((unused))
 
#define FETCH_DCELL_T(d_, lo, hi, t_)   ({ (d_) = ((Double_Store)(lo)).t_; })
 
#define STORE_DCELL_T(d_, lo, hi, t_)   ({ (lo) = ((Double_Store)(d_)).low; })
 
#define global_sp   (THREADOBJECT->_global_sp)
 
#define CLEAR_global_sp   (global_sp=NULL)
 
#define vm_twoCell2l(hi, lo, d_)   FETCH_DCELL_T(d_,lo,hi,l);
 
#define vm_twoCell2d(hi, lo, d_)   FETCH_DCELL_T(d_,lo,hi,d);
 
#define vm_l2twoCell(d_, hi, lo)   STORE_DCELL_T(d_,lo,hi,l);
 
#define vm_d2twoCell(d_, hi, lo)   STORE_DCELL_T(d_,lo,hi,d);
 
#define vm_Cell2v(cell, v)   ((v)=(Cell)(cell))
 
#define vm_Cell2b(cell, b)   ((b)=(u1)(Cell)(cell))
 
#define vm_Cell2i(cell, i)   ((i)=(s4)(Cell)(cell))
 
#define vm_Cell2aRef(x1, x2)   ((x2) = (java_objectheader *)(x1))
 
#define vm_Cell2aArray(x1, x2)   ((x2) = (java_arrayheader * )(x1))
 
#define vm_Cell2aaTarget(x1, x2)   ((x2) = (Inst ** )(x1))
 
#define vm_Cell2aClass(x1, x2)   ((x2) = (classinfo * )(x1))
 
#define vm_Cell2acr(x1, x2)   ((x2) = (constant_classref *)(x1))
 
#define vm_Cell2addr(x1, x2)   ((x2) = (u1 * )(x1))
 
#define vm_Cell2af(x1, x2)   ((x2) = (functionptr )(x1))
 
#define vm_Cell2afi(x1, x2)   ((x2) = (fieldinfo * )(x1))
 
#define vm_Cell2am(x1, x2)   ((x2) = (methodinfo * )(x1))
 
#define vm_Cell2acell(x1, x2)   ((x2) = (Cell * )(x1))
 
#define vm_Cell2ainst(x1, x2)   ((x2) = (Inst * )(x1))
 
#define vm_Cell2auf(x1, x2)   ((x2) = (unresolved_field * )(x1))
 
#define vm_Cell2aum(x1, x2)   ((x2) = (unresolved_method *)(x1))
 
#define vm_Cell2avftbl(x1, x2)   ((x2) = (vftbl_t * )(x1))
 
#define vm_ui2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_v2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_b2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_s2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_i2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_aRef2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_aArray2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_aaTarget2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_aClass2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_acr2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_addr2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_af2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_afi2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_am2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_acell2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_ainst2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_auf2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_aum2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_avftbl2Cell(x1, x2)   ((x2) = (Cell)(x1))
 
#define vm_Cell2Cell(x1, x2)   ((x2)=(Cell)(x1))
 
#define IMM_ARG(access, value)   (access)
 
#define VM_IS_INST(inst, n)   ((inst) == vm_prim[n])
 
#define gen_BBSTART   (cd->lastmcodeptr = NULL, append_dispatch(cd))
 
#define gen_BBEND   (finish_ss(cd))
 
#define access_local_int(_offset)   ( *(Cell*)(((u1 *)fp) + (_offset)) )
 
#define access_local_ref(_offset)   ( *(void **)(((u1 *)fp) + (_offset)) )
 
#define access_local_cell(_offset)   ( *(Cell *)(((u1 *)fp) + (_offset)) )
 
#define vm_f2Cell(x1, x2)   ((x2) =(((union Cell_float)(x1)).cell))
 
#define vm_Cell2f(x1, x2)   ((x2) =(((union Cell_float)(x1)).f))
 

Typedefs

typedef s8 Cell
 
typedef voidLabel
 
typedef voidInst
 
typedef struct block_count block_count
 

Functions

void init_peeptable (void)
 
ptrint peephole_opt (ptrint inst1, ptrint inst2, Cell peeptable)
 
java_objectheader * engine (Inst *ip0, Cell *sp, Cell *fp)
 
void vm_disassemble (Inst *ip, Inst *endp, Inst vm_prim[])
 
Instvm_disassemble_inst (Inst *ip, Inst vm_prim[])
 
void printarg_ui (u4 ui)
 
void printarg_v (Cell v)
 
void printarg_b (s4 b)
 
void printarg_s (s4 s)
 
void printarg_i (s4 i)
 
void printarg_l (s8 l)
 
void printarg_f (float f)
 
void printarg_d (double d)
 
void printarg_aRef (java_objectheader *aRef)
 
void printarg_aArray (java_arrayheader *aArray)
 
void printarg_aaTarget (Inst **aaTarget)
 
void printarg_aClass (classinfo *aClass)
 
void printarg_acr (constant_classref *acr)
 
void printarg_addr (u1 *addr)
 
void printarg_af (functionptr af)
 
void printarg_afi (fieldinfo *afi)
 
void printarg_am (methodinfo *am)
 
void printarg_acell (Cell *acell)
 
void printarg_ainst (Inst *ainst)
 
void printarg_auf (unresolved_field *auf)
 
void printarg_aum (unresolved_method *aum)
 
void printarg_avftbl (vftbl_t *avftbl)
 
void printarg_Cell (Cell x)
 
void vm_uncount_block (Inst *ip)
 
block_countvm_block_insert (Inst *ip)
 
Cellnativecall (functionptr f, methodinfo *m, Cell *sp, Inst *ra, Cell *fp, u1 *addrcif)
 
u1createcalljavafunction (methodinfo *m)
 
Instintrp_asm_handle_exception (Inst *ip, java_objectheader *o, Cell *fp, Cell **new_spp, Cell **new_fpp)
 
void gen_inst (codegendata *cd, ptrint instr)
 
void append_dispatch (codegendata *cd)
 
void finish_ss (codegendata *cd)
 
void patchersuper_rewrite (Inst *p)
 
void dynamic_super_init (void)
 
void dynamic_super_rewrite (codegendata *cd)
 

Variables

Instvm_prim
 
Cell peeptable
 
FILE * vm_out
 

Macro Definition Documentation

#define access_local_cell (   _offset)    ( *(Cell *)(((u1 *)fp) + (_offset)) )

Definition at line 192 of file intrp.h.

#define access_local_int (   _offset)    ( *(Cell*)(((u1 *)fp) + (_offset)) )

Definition at line 186 of file intrp.h.

#define access_local_ref (   _offset)    ( *(void **)(((u1 *)fp) + (_offset)) )

Definition at line 189 of file intrp.h.

#define CLEAR_global_sp   (global_sp=NULL)

Definition at line 120 of file intrp.h.

#define FETCH_DCELL_T (   d_,
  lo,
  hi,
  t_ 
)    ({ (d_) = ((Double_Store)(lo)).t_; })

Definition at line 100 of file intrp.h.

#define gen_BBEND   (finish_ss(cd))

Definition at line 177 of file intrp.h.

#define gen_BBSTART   (cd->lastmcodeptr = NULL, append_dispatch(cd))

Definition at line 176 of file intrp.h.

#define global_sp   (THREADOBJECT->_global_sp)

Definition at line 108 of file intrp.h.

#define IMM_ARG (   access,
  value 
)    (access)

Definition at line 170 of file intrp.h.

#define MAYBE_UNUSED   __attribute__((unused))

Definition at line 61 of file intrp.h.

#define STORE_DCELL_T (   d_,
  lo,
  hi,
  t_ 
)    ({ (lo) = ((Double_Store)(d_)).low; })

Definition at line 101 of file intrp.h.

#define vm_aArray2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 154 of file intrp.h.

#define vm_aaTarget2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 155 of file intrp.h.

#define vm_acell2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 162 of file intrp.h.

#define vm_aClass2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 156 of file intrp.h.

#define vm_acr2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 157 of file intrp.h.

#define vm_addr2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 158 of file intrp.h.

#define vm_af2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 159 of file intrp.h.

#define vm_afi2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 160 of file intrp.h.

#define vm_ainst2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 163 of file intrp.h.

#define vm_am2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 161 of file intrp.h.

#define vm_aRef2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 153 of file intrp.h.

#define vm_auf2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 164 of file intrp.h.

#define vm_aum2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 165 of file intrp.h.

#define vm_avftbl2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 166 of file intrp.h.

#define vm_b2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 150 of file intrp.h.

#define vm_Cell2aArray (   x1,
  x2 
)    ((x2) = (java_arrayheader * )(x1))

Definition at line 134 of file intrp.h.

#define vm_Cell2aaTarget (   x1,
  x2 
)    ((x2) = (Inst ** )(x1))

Definition at line 135 of file intrp.h.

#define vm_Cell2acell (   x1,
  x2 
)    ((x2) = (Cell * )(x1))

Definition at line 142 of file intrp.h.

#define vm_Cell2aClass (   x1,
  x2 
)    ((x2) = (classinfo * )(x1))

Definition at line 136 of file intrp.h.

#define vm_Cell2acr (   x1,
  x2 
)    ((x2) = (constant_classref *)(x1))

Definition at line 137 of file intrp.h.

#define vm_Cell2addr (   x1,
  x2 
)    ((x2) = (u1 * )(x1))

Definition at line 138 of file intrp.h.

#define vm_Cell2af (   x1,
  x2 
)    ((x2) = (functionptr )(x1))

Definition at line 139 of file intrp.h.

#define vm_Cell2afi (   x1,
  x2 
)    ((x2) = (fieldinfo * )(x1))

Definition at line 140 of file intrp.h.

#define vm_Cell2ainst (   x1,
  x2 
)    ((x2) = (Inst * )(x1))

Definition at line 143 of file intrp.h.

#define vm_Cell2am (   x1,
  x2 
)    ((x2) = (methodinfo * )(x1))

Definition at line 141 of file intrp.h.

#define vm_Cell2aRef (   x1,
  x2 
)    ((x2) = (java_objectheader *)(x1))

Definition at line 133 of file intrp.h.

#define vm_Cell2auf (   x1,
  x2 
)    ((x2) = (unresolved_field * )(x1))

Definition at line 144 of file intrp.h.

#define vm_Cell2aum (   x1,
  x2 
)    ((x2) = (unresolved_method *)(x1))

Definition at line 145 of file intrp.h.

#define vm_Cell2avftbl (   x1,
  x2 
)    ((x2) = (vftbl_t * )(x1))

Definition at line 146 of file intrp.h.

#define vm_Cell2b (   cell,
 
)    ((b)=(u1)(Cell)(cell))

Definition at line 130 of file intrp.h.

#define vm_Cell2Cell (   x1,
  x2 
)    ((x2)=(Cell)(x1))

Definition at line 168 of file intrp.h.

#define vm_Cell2f (   x1,
  x2 
)    ((x2) =(((union Cell_float)(x1)).f))

Definition at line 199 of file intrp.h.

#define vm_Cell2i (   cell,
  i 
)    ((i)=(s4)(Cell)(cell))

Definition at line 131 of file intrp.h.

#define vm_Cell2v (   cell,
 
)    ((v)=(Cell)(cell))

Definition at line 129 of file intrp.h.

#define vm_d2twoCell (   d_,
  hi,
  lo 
)    STORE_DCELL_T(d_,lo,hi,d);

Definition at line 127 of file intrp.h.

#define vm_f2Cell (   x1,
  x2 
)    ((x2) =(((union Cell_float)(x1)).cell))

Definition at line 198 of file intrp.h.

#define vm_i2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 152 of file intrp.h.

#define VM_IS_INST (   inst,
 
)    ((inst) == vm_prim[n])

Definition at line 173 of file intrp.h.

#define vm_l2twoCell (   d_,
  hi,
  lo 
)    STORE_DCELL_T(d_,lo,hi,l);

Definition at line 126 of file intrp.h.

#define vm_s2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 151 of file intrp.h.

#define vm_twoCell2d (   hi,
  lo,
  d_ 
)    FETCH_DCELL_T(d_,lo,hi,d);

Definition at line 124 of file intrp.h.

#define vm_twoCell2l (   hi,
  lo,
  d_ 
)    FETCH_DCELL_T(d_,lo,hi,l);

Definition at line 123 of file intrp.h.

#define vm_ui2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 148 of file intrp.h.

#define vm_v2Cell (   x1,
  x2 
)    ((x2) = (Cell)(x1))

Definition at line 149 of file intrp.h.

Typedef Documentation

typedef struct block_count block_count

Definition at line 196 of file intrp.h.

typedef s8 Cell

Definition at line 42 of file intrp.h.

typedef void* Inst

Definition at line 58 of file intrp.h.

typedef void* Label

Definition at line 57 of file intrp.h.

Function Documentation

void append_dispatch ( codegendata cd)

Definition at line 512 of file dynamic-super.c.

u1* createcalljavafunction ( methodinfo m)

Definition at line 2196 of file codegen.c.

void dynamic_super_init ( void  )

Definition at line 687 of file dynamic-super.c.

void dynamic_super_rewrite ( codegendata cd)

Definition at line 443 of file dynamic-super.c.

java_objectheader* engine ( Inst ip0,
Cell sp,
Cell fp 
)

Definition at line 216 of file engine.c.

void finish_ss ( codegendata cd)

Definition at line 604 of file dynamic-super.c.

void gen_inst ( codegendata cd,
ptrint  instr 
)

Definition at line 624 of file dynamic-super.c.

void init_peeptable ( void  )

Definition at line 82 of file peephole.c.

Inst* intrp_asm_handle_exception ( Inst ip,
java_objectheader *  o,
Cell fp,
Cell **  new_spp,
Cell **  new_fpp 
)

Definition at line 171 of file asmpart.c.

Cell* nativecall ( functionptr  f,
methodinfo m,
Cell sp,
Inst ra,
Cell fp,
u1 addrcif 
)

Definition at line 2042 of file codegen.c.

void patchersuper_rewrite ( Inst p)

Definition at line 391 of file dynamic-super.c.

ptrint peephole_opt ( ptrint  inst1,
ptrint  inst2,
Cell  peeptable 
)

Definition at line 87 of file peephole.c.

void printarg_aArray ( java_arrayheader *  aArray)

Definition at line 127 of file disass.cpp.

void printarg_aaTarget ( Inst **  aaTarget)

Definition at line 132 of file disass.cpp.

void printarg_acell ( Cell acell)

Definition at line 186 of file disass.cpp.

void printarg_aClass ( classinfo aClass)

Definition at line 141 of file disass.cpp.

void printarg_acr ( constant_classref acr)

Definition at line 149 of file disass.cpp.

void printarg_addr ( u1 addr)

Definition at line 154 of file disass.cpp.

void printarg_af ( functionptr  af)

Definition at line 159 of file disass.cpp.

void printarg_afi ( fieldinfo afi)

Definition at line 164 of file disass.cpp.

void printarg_ainst ( Inst ainst)

Definition at line 191 of file disass.cpp.

void printarg_am ( methodinfo am)

Definition at line 175 of file disass.cpp.

void printarg_aRef ( java_objectheader *  aRef)

Definition at line 122 of file disass.cpp.

void printarg_auf ( unresolved_field auf)

Definition at line 196 of file disass.cpp.

void printarg_aum ( unresolved_method aum)

Definition at line 207 of file disass.cpp.

void printarg_avftbl ( vftbl_t avftbl)

Definition at line 218 of file disass.cpp.

void printarg_b ( s4  b)

Definition at line 92 of file disass.cpp.

void printarg_Cell ( Cell  x)

Definition at line 86 of file disass.cpp.

void printarg_d ( double  d)

Definition at line 117 of file disass.cpp.

void printarg_f ( float  f)

Definition at line 112 of file disass.cpp.

void printarg_i ( s4  i)

Definition at line 102 of file disass.cpp.

void printarg_l ( s8  l)

Definition at line 107 of file disass.cpp.

void printarg_s ( s4  s)

Definition at line 97 of file disass.cpp.

void printarg_ui ( u4  ui)

Definition at line 76 of file disass.cpp.

void printarg_v ( Cell  v)

Definition at line 81 of file disass.cpp.

block_count* vm_block_insert ( Inst ip)

Definition at line 60 of file profile.c.

void vm_disassemble ( Inst ip,
Inst endp,
Inst  vm_prim[] 
)

Definition at line 64 of file disasm.c.

Inst* vm_disassemble_inst ( Inst ip,
Inst  vm_prim[] 
)

Definition at line 49 of file disasm.c.

void vm_uncount_block ( Inst ip)

Definition at line 90 of file profile.c.

Variable Documentation

Cell peeptable

Definition at line 57 of file peephole.c.

FILE* vm_out

Definition at line 49 of file md.c.

Inst* vm_prim

Definition at line 48 of file md.c.