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

arigo at codespeak.net arigo at codespeak.net
Thu Mar 5 10:27:22 CET 2009


Author: arigo
Date: Thu Mar  5 10:27:21 2009
New Revision: 62565

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
Log:
Give a consistent name to the codewriter operations
and the resoperations for PURE versions of getfield
and getarrayitem.


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	Thu Mar  5 10:27:21 2009
@@ -521,16 +521,16 @@
         # check for deepfrozen structures that force constant-folding
         #pure = self.codewriter.is_green_var(op.result)
         if op.args[0].concretetype.TO._hints.get('immutable'):
-            opname = 'getfield_pure'
+            pure = '_pure'
         else:
-            opname = 'getfield'
+            pure = ''
         # turn the flow graph 'getfield' operation into our own version
         [v_inst, c_fieldname] = op.args
         RESULT = op.result.concretetype
         if RESULT is lltype.Void:
             return
         argname = v_inst.concretetype.TO._gckind
-        self.emit('%s_%s' % (opname, argname))
+        self.emit('getfield_%s%s' % (argname, pure))
         self.emit(self.var_position(v_inst))
         offset = self.cpu.fielddescrof(v_inst.concretetype.TO,
                                        c_fieldname.value)
@@ -742,7 +742,7 @@
         #
         if oopspec_name == 'list.getitem_foldable':
             return self.handle_list_getitem(op, arraydescr, args,
-                                            'getarrayitem_foldable_gc')
+                                            'getarrayitem_gc_pure')
         #
         if oopspec_name == 'list.setitem':
             index = self.prepare_list_getset(op, arraydescr, args)

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	Thu Mar  5 10:27:21 2009
@@ -328,7 +328,7 @@
         self.execute(rop.GETARRAYITEM_GC, [arraybox, arraydesc, indexbox], tp)
 
     @arguments("box", "constbox", "box")
-    def opimpl_getarrayitem_foldable_gc(self, arraybox, arraydesc, indexbox):
+    def opimpl_getarrayitem_gc_pure(self, arraybox, arraydesc, indexbox):
         tp = self.metainterp.cpu.typefor(arraydesc.getint())
         self.execute(rop.GETARRAYITEM_GC_PURE,
                      [arraybox, arraydesc, indexbox], tp, True)
@@ -377,7 +377,7 @@
         tp = self.metainterp.cpu.typefor(fielddesc.getint())
         self.execute(rop.GETFIELD_GC, [box, fielddesc], tp)
     @arguments("box", "constbox")
-    def opimpl_getfield_pure_gc(self, box, fielddesc):
+    def opimpl_getfield_gc_pure(self, box, fielddesc):
         tp = self.metainterp.cpu.typefor(fielddesc.getint())
         self.execute(rop.GETFIELD_GC_PURE, [box, fielddesc], tp, True)
     @arguments("box", "constbox", "box")
@@ -390,9 +390,9 @@
         tp = self.metainterp.cpu.typefor(fielddesc.getint())
         self.execute(rop.GETFIELD_RAW, [box, fielddesc], tp)
     @arguments("box", "constbox")
-    def opimpl_getfield_pure_raw(self, box, fielddesc):
+    def opimpl_getfield_raw_pure(self, box, fielddesc):
         tp = self.metainterp.cpu.typefor(fielddesc.getint())
-        self.execute(rop.GETFIELD_RAW, [box, fielddesc], tp, True)
+        self.execute(rop.GETFIELD_RAW_PURE, [box, fielddesc], tp, True)
     @arguments("box", "constbox", "box")
     def opimpl_setfield_raw(self, box, fielddesc, valuebox):
         self.execute(rop.SETFIELD_RAW, [box, fielddesc, valuebox],



More information about the Pypy-commit mailing list