Commits

Carl Friedrich Bolz committed 196ad28

unroll basic_unify sometimes

Comments (0)

Files changed (1)

prolog/interpreter/term.py

         return self._unify_derefed(other, heap, occurs_check)
     
     @specialize.arg(3)
-    def basic_unify(self, other, heap, occurs_check=False):
+    def basic_unify(self, other, heap, occurs_check):
         raise NotImplementedError("abstract base class")
     
     @specialize.arg(3)
         raise NotImplementedError("abstract base")
     
     @specialize.arg(3)
-    def basic_unify(self, other, heap, occurs_check=False):
+    def basic_unify(self, other, heap, occurs_check):
         if (isinstance(other, Callable) and
                 self.signature().eq(other.signature())):
             for i in range(self.argument_count()):
         self.num = val
 
     @specialize.arg(3)
-    def basic_unify(self, other, heap, occurs_check=False):
+    def basic_unify(self, other, heap, occurs_check):
         if isinstance(other, Number) and other.num == self.num:
             return
         raise UnificationFailed
     def __init__(self, value):
         self.value = value
 
-    def basic_unify(self, other, heap, occurs_check=False):
+    def basic_unify(self, other, heap, occurs_check):
         if isinstance(other, BigInt) and other.value.eq(self.value):
             return
         raise UnificationFailed
         self.floatval = floatval
     
     @specialize.arg(3)
-    def basic_unify(self, other, heap, occurs_check=False):
+    def basic_unify(self, other, heap, occurs_check):
         if isinstance(other, Float) and other.floatval == self.floatval:
             return
         raise UnificationFailed
                 return self
 
         @specialize.arg(3)
-        @jit.dont_look_inside
-        def basic_unify(self, other, heap, occurs_check=False):
+        @jit.look_inside_iff(lambda self, other, heap, occurs_check:
+                jit.isvirtual(self) or jit.isvirtual(other))
+        def basic_unify(self, other, heap, occurs_check):
             if not isinstance(other, abstract_callable):
                 return Callable.basic_unify(self, other, heap, occurs_check)
             if self.signature().eq(other.signature()):