6 data_root<object> owner;
7 growable_byte_array code;
8 growable_byte_array relocation;
9 growable_array parameters;
10 growable_array literals;
11 bool computing_offset_p;
16 explicit jit(code_block_type type, cell owner, factor_vm *parent);
17 void compute_position(cell offset);
19 void emit_relocation(cell code_template);
20 void emit(cell code_template);
22 void parameter(cell parameter) { parameters.add(parameter); }
23 void emit_with_parameter(cell code_template_, cell parameter_);
25 void literal(cell literal) { literals.add(literal); }
26 void emit_with_literal(cell code_template_, cell literal_);
28 void push(cell literal)
30 emit_with_literal(parent->special_objects[JIT_PUSH_IMMEDIATE],literal);
33 void word_jump(cell word_)
35 data_root<word> word(word_,parent);
36 literal(tag_fixnum(xt_tail_pic_offset));
37 literal(word.value());
38 emit(parent->special_objects[JIT_WORD_JUMP]);
41 void word_call(cell word)
43 emit_with_literal(parent->special_objects[JIT_WORD_CALL],word);
46 bool emit_subprimitive(cell word_, bool tail_call_p, bool stack_frame_p);
48 void emit_class_lookup(fixnum index, cell type);
52 if(computing_offset_p)
54 /* If this is still on, emit() didn't clear it,
55 so the offset was out of bounds */
62 void set_position(fixnum position_)
64 if(computing_offset_p)
69 code_block *to_code_block();