Author: Armin Rigo <ar...@tunes.org>
Branch: 
Changeset: r72335:d4f1606fbfe7
Date: 2014-07-03 20:02 +0200
http://bitbucket.org/pypy/pypy/changeset/d4f1606fbfe7/

Log:    More attempts at translation fixes

diff --git a/pypy/module/pypyjit/interp_resop.py 
b/pypy/module/pypyjit/interp_resop.py
--- a/pypy/module/pypyjit/interp_resop.py
+++ b/pypy/module/pypyjit/interp_resop.py
@@ -56,6 +56,7 @@
     jit hook won't be called for that.
     """
     cache = space.fromcache(Cache)
+    assert w_hook is not None
     cache.w_compile_hook = w_hook
     cache.in_recursion = NonConstant(False)
 
@@ -90,6 +91,7 @@
     as attributes on JitLoopInfo object.
     """
     cache = space.fromcache(Cache)
+    assert w_hook is not None
     cache.w_abort_hook = w_hook
     cache.in_recursion = NonConstant(False)
 
diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -13,21 +13,19 @@
         cache = space.fromcache(Cache)
         if cache.in_recursion:
             return
-        w_abort_hook = cache.w_abort_hook
-        assert w_abort_hook is not None
-        if space.is_true(w_abort_hook):
+        if space.is_true(cache.w_abort_hook):
             cache.in_recursion = True
             oplist_w = wrap_oplist(space, logops, operations)
             try:
                 try:
-                    space.call_function(w_abort_hook,
+                    space.call_function(cache.w_abort_hook,
                         space.wrap(jitdriver.name),
                         wrap_greenkey(space, jitdriver, greenkey, 
greenkey_repr),
                         space.wrap(Counters.counter_names[reason]),
                         space.newlist(oplist_w)
                     )
                 except OperationError, e:
-                    e.write_unraisable(space, "jit hook ", w_abort_hook)
+                    e.write_unraisable(space, "jit hook ", cache.w_abort_hook)
             finally:
                 cache.in_recursion = False
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to