Author: Armin Rigo <[email protected]>
Branch: guard-compatible
Changeset: r83040:db4dc094a002
Date: 2016-03-14 13:38 +0100
http://bitbucket.org/pypy/pypy/changeset/db4dc094a002/

Log:    Keepalive. Hard to test...

diff --git a/rpython/jit/backend/model.py b/rpython/jit/backend/model.py
--- a/rpython/jit/backend/model.py
+++ b/rpython/jit/backend/model.py
@@ -295,6 +295,7 @@
 class CompiledLoopToken(object):
     asmmemmgr_blocks = None
     asmmemmgr_gcroots = 0
+    _keepalive_extra = None
 
     def __init__(self, cpu, number):
         cpu.tracker.total_compiled_loops += 1
diff --git a/rpython/jit/backend/x86/guard_compat.py 
b/rpython/jit/backend/x86/guard_compat.py
--- a/rpython/jit/backend/x86/guard_compat.py
+++ b/rpython/jit/backend/x86/guard_compat.py
@@ -75,6 +75,12 @@
         raise AssertionError("oops")
     new_value = rffi.cast(lltype.Signed, gcref)
 
+    # XXX related to the above: for now we keep alive the gcrefs forever
+    # in the compiled_loop_token
+    if compiled_loop_token._keepalive_extra is None:
+        compiled_loop_token._keepalive_extra = []
+    compiled_loop_token._keepalive_extra.append(gcref)
+
     if not we_are_translated() and isinstance(guarddescr, BasicFailDescr):
         pass    # for tests
     else:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to