[pypy-commit] pypy guard-compatible: Ups, found a potential issue with a real GC (untested so far)

arigo pypy.commits at gmail.com
Mon May 23 06:00:05 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: guard-compatible
Changeset: r84619:124533b25c49
Date: 2016-05-23 12:00 +0200
http://bitbucket.org/pypy/pypy/changeset/124533b25c49/

Log:	Ups, found a potential issue with a real GC (untested so far)

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
@@ -114,7 +114,7 @@
 #                                  jitframe=RBP>
 #     <_reload_frame_if_necessary>
 #     MOV R11, RAX
-#     <restore the non-saved registers>
+#     <restore all registers>
 #     JMP *R11
 #
 #
@@ -438,11 +438,10 @@
     assembler._reload_frame_if_necessary(mc)
     mc.MOV_rr(r11, rax)                     # MOV R11, RAX
 
-    # restore the registers that the CALL has clobbered.  Other other
-    # registers are saved above, for the gcmap, but don't need to be
-    # restored here.  (We restore RAX and RDX too.)
-    assembler._pop_all_regs_from_frame(mc, [], withfloats=True,
-                                       callee_only=True)
+    # restore the registers that the CALL has clobbered, plus the ones
+    # containing GC pointers that may have moved.  That means we just
+    # restore them all.  (We restore RAX and RDX too.)
+    assembler._pop_all_regs_from_frame(mc, [], withfloats=True)
     mc.JMP_r(r11)                           # JMP *R11
 
     assembler.guard_compat_search_tree = mc.materialize(assembler.cpu, [])


More information about the pypy-commit mailing list