]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/jit.hpp
xmode: fix handling of HASH_CHAR and always rules
[factor.git] / vm / jit.hpp
index 98950467b8d437cea7bec2ae54d6440596af7dd2..07290501efca35f97ba0023800347c57a1fa6899 100644 (file)
@@ -1,7 +1,6 @@
 namespace factor {
 
 struct jit {
-  code_block_type type;
   data_root<object> owner;
   growable_byte_array code;
   growable_byte_array relocation;
@@ -12,7 +11,7 @@ struct jit {
   cell offset;
   factor_vm* parent;
 
-  jit(code_block_type type, cell owner, factor_vm* parent);
+  jit(cell owner, factor_vm* parent);
   ~jit();
 
   void compute_position(cell offset);
@@ -20,45 +19,30 @@ struct jit {
   void emit_relocation(cell relocation_template);
   void emit(cell code_template);
 
-  /* Allocates memory */
+  // Allocates memory
   void parameter(cell parameter) { parameters.add(parameter); }
-  /* Allocates memory */
+  // Allocates memory
   void emit_with_parameter(cell code_template_, cell parameter_);
 
-  /* Allocates memory */
+  // Allocates memory
   void literal(cell literal) { literals.add(literal); }
-  /* Allocates memory */
+  // Allocates memory
   void emit_with_literal(cell code_template_, cell literal_);
 
-  /* Allocates memory */
+  // Allocates memory
   void push(cell literal) {
-    emit_with_literal(parent->special_objects[JIT_PUSH_IMMEDIATE], literal);
-  }
-
-  /* Allocates memory (literal(), emit())*/
-  void word_jump(cell word_) {
-    data_root<word> word(word_, parent);
-#ifndef FACTOR_AMD64
-    literal(tag_fixnum(xt_tail_pic_offset));
-#endif
-    literal(word.value());
-    emit(parent->special_objects[JIT_WORD_JUMP]);
-  }
-
-  /* Allocates memory */
-  void word_call(cell word) {
-    emit_with_literal(parent->special_objects[JIT_WORD_CALL], word);
+    emit_with_literal(parent->special_objects[JIT_PUSH_LITERAL], literal);
   }
 
   bool emit_subprimitive(cell word_, bool tail_call_p, bool stack_frame_p);
 
   fixnum get_position() {
     if (computing_offset_p) {
-      /* If this is still on, emit() didn't clear it,
-         so the offset was out of bounds */
+      // If this is still on, emit() didn't clear it,
+      // so the offset was out of bounds
       return -1;
-    } else
-      return position;
+    }
+    return position;
   }
 
   void set_position(fixnum position_) {
@@ -66,7 +50,7 @@ struct jit {
       position = position_;
   }
 
-  code_block* to_code_block(cell frame_size);
+  code_block* to_code_block(code_block_type type, cell frame_size);
 
 private:
   jit(const jit&);