]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: undo a8aaa4288231a2395070c5b0ea4c43939bf81c63 (#1513)
authorBjörn Lindqvist <bjourne@gmail.com>
Fri, 11 Nov 2016 16:36:04 +0000 (17:36 +0100)
committerBjörn Lindqvist <bjourne@gmail.com>
Fri, 11 Nov 2016 16:36:04 +0000 (17:36 +0100)
vm/quotations.cpp

index f9317fb4f39ddbec6298fb12c15a7b95fd3b3b3b..6e07cd3cc2f219ea35f042183a15c86284f10ca2 100644 (file)
@@ -48,40 +48,41 @@ void quotation_jit::init_quotation(cell quot) {
 
 bool quotation_jit::fast_if_p(cell i, cell length) {
   return (i + 3) == length &&
-      TAG(nth(i + 1)) == QUOTATION_TYPE &&
-      nth(i + 2) == parent->special_objects[JIT_IF_WORD];
+      (tagged<object>(array_nth(elements.untagged(), i + 1)).type() == QUOTATION_TYPE) &&
+      array_nth(elements.untagged(), i + 2) == parent->special_objects[JIT_IF_WORD];
 }
 
 bool quotation_jit::primitive_call_p(cell i, cell length) {
-  cell jit_primitive_word = parent->special_objects[JIT_PRIMITIVE_WORD];
-  return (i + 2) <= length && nth(i + 1) == jit_primitive_word;
+  return (i + 2) <= length && array_nth(elements.untagged(), i + 1) ==
+      parent->special_objects[JIT_PRIMITIVE_WORD];
 }
 
 bool quotation_jit::fast_dip_p(cell i, cell length) {
-  cell jit_dip_word = parent->special_objects[JIT_DIP_WORD];
-  return (i + 2) <= length && nth(i + 1) == jit_dip_word;
+  return (i + 2) <= length && array_nth(elements.untagged(), i + 1) ==
+      parent->special_objects[JIT_DIP_WORD];
 }
 
 bool quotation_jit::fast_2dip_p(cell i, cell length) {
-  cell jit_2dip_word = parent->special_objects[JIT_2DIP_WORD];
-  return (i + 2) <= length && nth(i + 1) == jit_2dip_word;
+  return (i + 2) <= length && array_nth(elements.untagged(), i + 1) ==
+      parent->special_objects[JIT_2DIP_WORD];
 }
 
 bool quotation_jit::fast_3dip_p(cell i, cell length) {
-  cell jit_3dip_word = parent->special_objects[JIT_3DIP_WORD];
-  return (i + 2) <= length && nth(i + 1) == jit_3dip_word;
+  return (i + 2) <= length && array_nth(elements.untagged(), i + 1) ==
+      parent->special_objects[JIT_3DIP_WORD];
 }
 
 bool quotation_jit::declare_p(cell i, cell length) {
-  cell jit_declare_word = parent->special_objects[JIT_DECLARE_WORD];
-  return (i + 2) <= length && nth(i + 1) == jit_declare_word;
+  return (i + 2) <= length && array_nth(elements.untagged(), i + 1) ==
+      parent->special_objects[JIT_DECLARE_WORD];
 }
 
+
 bool quotation_jit::mega_lookup_p(cell i, cell length) {
   return (i + 4) <= length &&
-      TAG(nth(i + 1)) == FIXNUM_TYPE &&
-      TAG(nth(i + 2)) == ARRAY_TYPE &&
-      nth(i + 3) == parent->special_objects[MEGA_LOOKUP_WORD];
+      (tagged<object>(array_nth(elements.untagged(), i + 1)).type() == FIXNUM_TYPE) &&
+      (tagged<object>(array_nth(elements.untagged(), i + 2)).type() == ARRAY_TYPE) &&
+      array_nth(elements.untagged(), i + 3) == parent->special_objects[MEGA_LOOKUP_WORD];
 }
 
 // Subprimitives should be flagged with whether they require a stack frame.
@@ -98,8 +99,8 @@ bool quotation_jit::special_subprimitive_p(cell obj) {
 bool quotation_jit::stack_frame_p() {
   cell length = array_capacity(elements.untagged());
   for (cell i = 0; i < length; i++) {
-    cell obj = nth(i);
-    cell tag = TAG(obj);
+    cell obj = array_nth(elements.untagged(), i);
+    cell tag = tagged<object>(obj).type();
     if ((tag == WORD_TYPE && special_subprimitive_p(obj)) ||
         (tag == ARRAY_TYPE && mega_lookup_p(i, length)))
       return false;