[pypy-svn] r57241 - pypy/branch/oo-jit/pypy/jit/codegen/x86_64

cfbolz at codespeak.net cfbolz at codespeak.net
Thu Aug 14 13:04:21 CEST 2008


Author: cfbolz
Date: Thu Aug 14 13:04:20 2008
New Revision: 57241

Modified:
   pypy/branch/oo-jit/pypy/jit/codegen/x86_64/objmodel.py
   pypy/branch/oo-jit/pypy/jit/codegen/x86_64/rgenop.py
Log:
some cosmetic stuff


Modified: pypy/branch/oo-jit/pypy/jit/codegen/x86_64/objmodel.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/x86_64/objmodel.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/x86_64/objmodel.py	Thu Aug 14 13:04:20 2008
@@ -2,10 +2,12 @@
 # Wrapper Classes
 
 class Register64(model.GenVar):
+    _dispatchname = "_QWREG"
     def __init__(self, reg):
         self.reg = reg
 
 # TODO: support 64-bit Constants
 class Constant32(model.GenConst):
+    _dispatchname = "_IMM32"
     def __init__(self, value):
-        self.value = value
\ No newline at end of file
+        self.value = value

Modified: pypy/branch/oo-jit/pypy/jit/codegen/x86_64/rgenop.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/codegen/x86_64/rgenop.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/codegen/x86_64/rgenop.py	Thu Aug 14 13:04:20 2008
@@ -18,14 +18,14 @@
     def op_int(self, gv_x, gv_y):
         gv_z = self.allocate_register()
         self.mc.MOV_QWREG_QWREG(gv_z, gv_x)
-        method = getattr(self.mc, name+typeToString(gv_x)+typeToString(gv_y))
+        method = getattr(self.mc, name + type_to_string(gv_x)+type_to_string(gv_y))
         method(gv_z, gv_y)
         return gv_z
     return op_int
 
 def make_one_argument_method(name):
     def op_int(self, gv_x):
-        method = getattr(self.mc, name+typeToString(gv_x))
+        method = getattr(self.mc, name+type_to_string(gv_x))
         method(gv_x)
         return gv_x
     return op_int
@@ -34,13 +34,8 @@
 
 # helper of "make_two_argument_method" to choose 
 # the right assembler method
-def typeToString(parseMe):
-    if isinstance(parseMe,Constant32):
-        return "_IMM32"
-    if isinstance(parseMe,Register64):
-        return "_QWREG"
-        
-
+def type_to_string(parse_me):
+    return parse_me._dispatchname
 
 
 # a small helper that provides correct type signature



More information about the Pypy-commit mailing list