[pypy-svn] r53549 - pypy/branch/jit-hotpath/pypy/jit/codegen/ia32

fijal at codespeak.net fijal at codespeak.net
Mon Apr 7 23:48:37 CEST 2008


Author: fijal
Date: Mon Apr  7 23:48:37 2008
New Revision: 53549

Modified:
   pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/objmodel.py
   pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
Log:
I didn't find any tests for that, but this is obviously missing


Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/objmodel.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/objmodel.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/objmodel.py	Mon Apr  7 23:48:37 2008
@@ -41,6 +41,9 @@
     def __repr__(self):
         return self.token + 'var@%d' % (self.stackpos,)
 
+    def getkind(self):
+        return self.token
+
     repr = __repr__
 
 class IntVar(Var):
@@ -181,6 +184,9 @@
     def repr(self):
         return "const=$%s" % (self.value,)
 
+    def getkind(self):
+        return self.token
+
 class IntConst(Const):
     SIZE = 1
     
@@ -220,7 +226,7 @@
     @specialize.arg(1)
     def revealconst(self, T):
         assert T is lltype.Float
-        if we_are_translated():
+        if not self.is_pbc:
             return self.buf[0]
         else:
             return self.rawbuf[0]
@@ -293,3 +299,10 @@
 
     def repr(self):
         return "const=<0x%x>" % (llmemory.cast_adr_to_int(self.addr),)
+
+ZERO_CONST = {
+    'a' : AddrConst(llmemory.NULL),
+    'i' : IntConst(0),
+    'b' : BoolConst(0),
+    'f' : FloatConst(0.0)
+    }

Modified: pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/codegen/ia32/rgenop.py	Mon Apr  7 23:48:37 2008
@@ -9,7 +9,8 @@
 from pypy.rpython.annlowlevel import llhelper
 from pypy.jit.codegen.ia32.objmodel import IntVar, FloatVar, Var,\
      BoolVar, IntConst, AddrConst, BoolConst, FloatConst,\
-     LL_TO_GENVAR, TOKEN_TO_SIZE, token_to_genvar, WORD, AddrVar
+     LL_TO_GENVAR, TOKEN_TO_SIZE, token_to_genvar, WORD, AddrVar,\
+     ZERO_CONST
 from pypy.jit.codegen.support import ctypes_mapping
 from ctypes import cast, c_void_p, POINTER
 
@@ -1373,7 +1374,7 @@
     @staticmethod
     @specialize.arg(1)
     def genzeroconst(kind):
-        return zero_const
+        return ZERO_CONST[kind]
 
     @staticmethod
     @specialize.arg(0)
@@ -1404,4 +1405,3 @@
 
 global_rgenop = RI386GenOp()
 RI386GenOp.constPrebuiltGlobal = global_rgenop.genconst
-zero_const = AddrConst(llmemory.NULL)



More information about the Pypy-commit mailing list