[pypy-commit] pypy jit-simplify-backendintf: Fix call_assembler.

arigo noreply at buildbot.pypy.org
Mon Dec 12 10:01:16 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: jit-simplify-backendintf
Changeset: r50409:3a5a45bf3039
Date: 2011-12-12 09:24 +0100
http://bitbucket.org/pypy/pypy/changeset/3a5a45bf3039/

Log:	Fix call_assembler.

diff --git a/pypy/jit/backend/x86/assembler.py b/pypy/jit/backend/x86/assembler.py
--- a/pypy/jit/backend/x86/assembler.py
+++ b/pypy/jit/backend/x86/assembler.py
@@ -423,6 +423,7 @@
         '''adds the following attributes to looptoken:
                _x86_function_addr   (address of the generated func, as an int)
                _x86_loop_code       (debug: addr of the start of the ResOps)
+               _x86_debug_nbargs    (debug: total # of args)
                _x86_debug_checksum
         '''
         # XXX this function is too longish and contains some code
@@ -450,6 +451,7 @@
                                            looptoken, clt.allgcrefs)
         looppos = self.mc.get_relative_pos()
         looptoken._x86_loop_code = looppos
+        looptoken._x86_debug_nbargs = len(inputargs)
         clt.frame_depth = -1     # temporarily
         clt.param_depth = -1     # temporarily
         frame_depth, param_depth = self._assemble(regalloc, operations)
@@ -798,10 +800,7 @@
 
     def redirect_call_assembler(self, oldlooptoken, newlooptoken):
         # some minimal sanity checking
-        oldnonfloatlocs, oldfloatlocs = oldlooptoken._x86_arglocs
-        newnonfloatlocs, newfloatlocs = newlooptoken._x86_arglocs
-        assert len(oldnonfloatlocs) == len(newnonfloatlocs)
-        assert len(oldfloatlocs) == len(newfloatlocs)
+        assert oldlooptoken._x86_debug_nbargs == newlooptoken._x86_debug_nbargs
         # we overwrite the instructions at the old _x86_direct_bootstrap_code
         # to start with a JMP to the new _x86_direct_bootstrap_code.
         # Ideally we should rather patch all existing CALLs, but well.
@@ -2235,10 +2234,10 @@
         self.mc.MOV_bi(FORCE_INDEX_OFS, fail_index)
         descr = op.getdescr()
         assert isinstance(descr, JitCellToken)
-        assert len(arglocs) - 2 == len(descr._x86_arglocs[0])
+        assert len(arglocs) - 2 == descr._x86_debug_nbargs
         #
-        # Write a call to the direct_bootstrap_code of the target assembler
-        self._emit_call(fail_index, imm(descr._x86_direct_bootstrap_code),
+        # Write a call to the target assembler
+        self._emit_call(fail_index, imm(descr._x86_function_addr),
                         arglocs, 2, tmp=eax)
         if op.result is None:
             assert result_loc is None


More information about the pypy-commit mailing list