[pypy-svn] r62666 - pypy/branch/pyjitpl5/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Fri Mar 6 20:16:47 CET 2009


Author: fijal
Date: Fri Mar  6 20:16:46 2009
New Revision: 62666

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
Log:
make sure we're able to write down negative numbers. possibly not rpython


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	Fri Mar  6 20:16:46 2009
@@ -8,7 +8,7 @@
 from pypy.jit.metainterp.history import Const, getkind
 from pypy.jit.metainterp import heaptracker, support, history
 
-import py
+import py, sys
 from pypy.tool.ansi_print import ansi_log
 log = py.log.Producer('jitcodewriter')
 py.log.setconsumer('jitcodewriter', ansi_log)
@@ -911,7 +911,8 @@
         return "tlabel(%r)" % (self.name, )
 
 def encode_int(index):
-    assert index >= 0
+    if index < 0:
+        index += 2*(sys.maxint + 1)
     result = []
     while True:
         byte = index & 0x7F

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Fri Mar  6 20:16:46 2009
@@ -133,7 +133,7 @@
             if not byte & 0x80:
                 break
         self.pc = pc
-        return result
+        return intmask(result)
     _load_larger_int._dont_inline_ = True
 
     def load_3byte(self):



More information about the Pypy-commit mailing list