2 /* arg is a primitive number */
4 /* arg is a literal table index, holding an array pair (symbol/dll) */
6 /* a pointer to a compiled word reference */
8 /* a compiled word reference */
14 /* immediate literal */
16 /* address of stack_chain var */
21 /* absolute address in a 64-bit location */
23 /* absolute address in a 32-bit location */
25 /* relative address in a 32-bit location */
27 /* relative address in a PowerPC LIS/ORI sequence */
29 /* relative address in a PowerPC LWZ/STW/BC instruction */
31 /* relative address in a PowerPC B/BL instruction */
33 /* relative address in an ARM B/BL instruction */
35 /* pointer to address in an ARM LDR/STR instruction */
37 /* pointer to address in an ARM LDR/STR instruction offset by 8 bytes */
41 #define REL_RELATIVE_PPC_2_MASK 0xfffc
42 #define REL_RELATIVE_PPC_3_MASK 0x3fffffc
43 #define REL_INDIRECT_ARM_MASK 0xfff
44 #define REL_RELATIVE_ARM_3_MASK 0xffffff
46 /* the rel type is built like a cell to avoid endian-specific code in
48 #define REL_TYPE(r) ((r)->type & 0x000000ff)
49 #define REL_CLASS(r) (((r)->type & 0x0000ff00) >> 8)
50 #define REL_ARGUMENT(r) (((r)->type & 0xffff0000) >> 16)
52 /* code relocation consists of a table of entries for each fixup */
58 void flush_icache_for(F_CODE_BLOCK
*compiled
);
60 typedef void (*RELOCATION_ITERATOR
)(F_REL
*rel
, F_CODE_BLOCK
*compiled
);
62 void iterate_relocations(F_CODE_BLOCK
*compiled
, RELOCATION_ITERATOR iter
);
64 void store_address_in_code_block(CELL
class, CELL offset
, F_FIXNUM absolute_value
);
66 void relocate_code_block(F_CODE_BLOCK
*compiled
);
68 void update_literal_references(F_CODE_BLOCK
*compiled
);
70 void copy_literal_references(F_CODE_BLOCK
*compiled
);
72 void update_word_references(F_CODE_BLOCK
*compiled
);
74 void mark_code_block(F_CODE_BLOCK
*compiled
);
76 void relocate_code_block(F_CODE_BLOCK
*relocating
);
78 CELL
compiled_code_format(void);
80 bool stack_traces_p(void);
82 F_CODE_BLOCK
*add_compiled_block(