[pypy-svn] pypy out-of-line-guards-2: Finish the quasi immutable fields for x86 backend

fijal commits-noreply at bitbucket.org
Thu Apr 14 23:14:21 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: out-of-line-guards-2
Changeset: r43374:6d53858dbd37
Date: 2011-04-14 23:14 +0200
http://bitbucket.org/pypy/pypy/changeset/6d53858dbd37/

Log:	Finish the quasi immutable fields for x86 backend

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
@@ -451,7 +451,8 @@
             else:
                 # guard not invalidate, patch where it jumps
                 pos, _ = clt.invalidate_positions[inv_counter]
-                clt.invalidate_positions[inv_counter] = pos, relative_target
+                clt.invalidate_positions[inv_counter] = (pos + rawstart,
+                                                         relative_target)
 
     def get_asmmemmgr_blocks(self, looptoken):
         clt = looptoken.compiled_loop_token
@@ -1457,7 +1458,7 @@
 
     def genop_guard_guard_not_invalidated(self, ign_1, guard_op, guard_token,
                                      locs, ign_2):
-        pos = self.mc.get_relative_pos()
+        pos = self.mc.get_relative_pos() + 1 # after jmp
         guard_token.pos_jump_offset = pos
         self.current_clt.invalidate_positions.append((pos, 0))
         self.pending_guard_tokens.append(guard_token)

diff --git a/pypy/jit/backend/x86/runner.py b/pypy/jit/backend/x86/runner.py
--- a/pypy/jit/backend/x86/runner.py
+++ b/pypy/jit/backend/x86/runner.py
@@ -147,10 +147,11 @@
 
     def invalidate_loop(self, looptoken):
         from pypy.jit.backend.x86 import codebuf
+        
         for addr, tgt in looptoken.compiled_loop_token.invalidate_positions:
             mc = codebuf.MachineCodeBlockWrapper()
-            mc.writeimm32(tgt)
-            mc.copy_to_raw_memory(addr)
+            mc.JMP_l(tgt)
+            mc.copy_to_raw_memory(addr - 1)
 
 class CPU386(AbstractX86CPU):
     WORD = 4


More information about the Pypy-commit mailing list