[pypy-commit] pypy ppc-jit-backend: Delete duplicate write_new_force_index.

edelsohn noreply at buildbot.pypy.org
Sat Feb 11 05:56:51 CET 2012


Author: edelsohn
Branch: ppc-jit-backend
Changeset: r52367:fd3e6f5099f1
Date: 2012-02-10 23:51 -0500
http://bitbucket.org/pypy/pypy/changeset/fd3e6f5099f1/

Log:	Delete duplicate write_new_force_index. Implement skeleton for
	call_reacquire_gil.

diff --git a/pypy/jit/backend/ppc/opassembler.py b/pypy/jit/backend/ppc/opassembler.py
--- a/pypy/jit/backend/ppc/opassembler.py
+++ b/pypy/jit/backend/ppc/opassembler.py
@@ -865,20 +865,6 @@
             self.mc.store(r.SCRATCH.value, r.RES.value, self.cpu.vtable_offset)
             self.mc.free_scratch_reg()
 
-    def write_new_force_index(self):
-        # for shadowstack only: get a new, unused force_index number and
-        # write it to FORCE_INDEX_OFS.  Used to record the call shape
-        # (i.e. where the GC pointers are in the stack) around a CALL
-        # instruction that doesn't already have a force_index.
-        gcrootmap = self.cpu.gc_ll_descr.gcrootmap
-        if gcrootmap and gcrootmap.is_shadow_stack:
-            clt = self.current_clt
-            force_index = clt.reserve_and_record_some_faildescr_index()
-            self._write_fail_index(force_index)
-            return force_index
-        else:
-            return 0
-
     def emit_debug_merge_point(self, op, arglocs, regalloc):
         pass
 
@@ -1119,6 +1105,14 @@
             self._emit_call(NO_FORCE_INDEX, self.releasegil_addr, 
                             [], self._regalloc)
 
+    def call_reacquire_gil(self, gcrootmap, save_loc):
+        # save the previous result into the stack temporarily.
+        # XXX like with call_release_gil(), we assume that we don't need
+        # to save vfp regs in this case. Besides the result location
+        assert gcrootmap.is_shadow_stack
+        with Saved_Volatiles(self.mc):
+            self._emit_call(NO_FORCE_INDEX, self.reacqgil_addr,
+                            [], self._regalloc)
 
 
 class OpAssembler(IntOpAssembler, GuardOpAssembler,


More information about the pypy-commit mailing list