7 growable_byte_array code;
8 growable_byte_array relocation;
9 growable_array literals;
10 bool computing_offset_p;
14 jit(cell jit_type, cell owner);
15 void compute_position(cell offset);
17 void emit_relocation(cell code_template);
18 void emit(cell code_template);
20 void literal(cell literal) { literals.add(literal); }
21 void emit_with(cell code_template_, cell literal_);
23 void push(cell literal) {
24 emit_with(userenv[JIT_PUSH_IMMEDIATE],literal);
27 void word_jump(cell word) {
28 literal(tag_fixnum(xt_tail_pic_offset));
30 emit(userenv[JIT_WORD_JUMP]);
33 void word_call(cell word) {
34 emit_with(userenv[JIT_WORD_CALL],word);
37 void word_special(cell word) {
38 emit_with(userenv[JIT_WORD_SPECIAL],word);
41 void emit_subprimitive(cell word_) {
42 gc_root<word> word(word_);
43 gc_root<array> code_template(word->subprimitive);
44 if(array_capacity(code_template.untagged()) > 1) literal(T);
45 emit(code_template.value());
48 void emit_class_lookup(fixnum index, cell type);
50 fixnum get_position() {
51 if(computing_offset_p)
53 /* If this is still on, emit() didn't clear it,
54 so the offset was out of bounds */
61 void set_position(fixnum position_) {
62 if(computing_offset_p)
67 code_block *to_code_block();