5 data_root<object> owner;
6 growable_byte_array code;
7 growable_byte_array relocation;
8 growable_array parameters;
9 growable_array literals;
10 bool computing_offset_p;
15 jit(code_block_type type, cell owner, factor_vm* parent);
18 void compute_position(cell offset);
20 void emit_relocation(cell relocation_template);
21 void emit(cell code_template);
23 void parameter(cell parameter) { parameters.add(parameter); }
24 void emit_with_parameter(cell code_template_, cell parameter_);
26 void literal(cell literal) { literals.add(literal); }
27 void emit_with_literal(cell code_template_, cell literal_);
29 void push(cell literal) {
30 emit_with_literal(parent->special_objects[JIT_PUSH_IMMEDIATE], literal);
33 void word_jump(cell word_) {
34 data_root<word> word(word_, parent);
36 literal(tag_fixnum(xt_tail_pic_offset));
38 literal(word.value());
39 emit(parent->special_objects[JIT_WORD_JUMP]);
42 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 fixnum get_position() {
49 if (computing_offset_p) {
50 /* If this is still on, emit() didn't clear it,
51 so the offset was out of bounds */
57 void set_position(fixnum position_) {
58 if (computing_offset_p)
62 code_block* to_code_block(cell frame_size);
66 void operator=(const jit&);