[pypy-svn] r62414 - in pypy/branch/pyjitpl5/pypy/jit: backend/x86 metainterp

arigo at codespeak.net arigo at codespeak.net
Mon Mar 2 17:41:57 CET 2009


Author: arigo
Date: Mon Mar  2 17:41:56 2009
New Revision: 62414

Modified:
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
   pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py
Log:
Minimal "fixes".


Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/assembler.py	Mon Mar  2 17:41:56 2009
@@ -200,6 +200,10 @@
     def _binaryop_ovf(asmop, can_swap=False):
         def genop_binary_ovf(self, op, arglocs, result_loc):
             getattr(self.mc, asmop)(arglocs[0], arglocs[1])
+            if we_are_translated():
+                # XXX setting the lowest byte of _exception_addr to 0 or 1
+                # does not work after translation
+                XXX
             # XXX think about CMOV instead of SETO, this would avoid
             # a mess in detecting an exception
             self.mc.SETO(heap8(self._exception_addr))
@@ -238,7 +242,7 @@
 
     genop_int_mul_ovf = _binaryop_ovf("IMUL", True)
     genop_int_sub_ovf = _binaryop_ovf("SUB")
-    genop_int_add_ovf = _binaryop_ovf("ADD")
+    genop_int_add_ovf = _binaryop_ovf("ADD", True)
 
     genop_int_lt = _cmpop("L", "G")
     genop_int_le = _cmpop("LE", "GE")

Modified: pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/backend/x86/regalloc.py	Mon Mar  2 17:41:56 2009
@@ -12,7 +12,7 @@
 from pypy.jit.metainterp.resoperation import rop, opname
 
 
-MALLOC_VARSIZE = rop._CANRAISE_LAST + 1
+MALLOC_VARSIZE = rop._LAST + 1
 
 # esi edi and ebp can be added to this list, provided they're correctly
 # saved and restored
@@ -928,7 +928,7 @@
         self.eventually_free_vars(op.args)
         return ops + laterops + [PerformDiscard(op, [])]
 
-oplist = [None] * rop._CANRAISE_LAST
+oplist = [None] * rop._LAST
 
 for name, value in RegAlloc.__dict__.iteritems():
     if name.startswith('consider_'):

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/resoperation.py	Mon Mar  2 17:41:56 2009
@@ -159,6 +159,7 @@
     INT_MUL_OVF            = 112
     INT_NEG_OVF            = 113
     _CANRAISE_LAST = 119 # ----- end of can_raise operations -----
+    _LAST = 119     # for the backend to add more internal operations
 
 
 opname = {}      # mapping numbers to the original names, for debugging



More information about the Pypy-commit mailing list