[pypy-commit] pypy inline-dict-ops: Start changing a pair of descrs (array, field) into one (interiorfield),

fijal noreply at buildbot.pypy.org
Sun Jun 26 09:33:09 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: inline-dict-ops
Changeset: r45129:61d2c9fe8acf
Date: 2011-06-26 09:38 +0200
http://bitbucket.org/pypy/pypy/changeset/61d2c9fe8acf/

Log:	Start changing a pair of descrs (array, field) into one
	(interiorfield), it confuses optimizations a tad too much

diff --git a/pypy/jit/codewriter/jtransform.py b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -711,9 +711,9 @@
             assert isinstance(v_inst.concretetype.TO, lltype.GcArray)
             STRUCT = v_inst.concretetype.TO.OF
             assert isinstance(STRUCT, lltype.Struct)
-            arraydescr = self.cpu.arraydescrof(v_inst.concretetype.TO)
-            fielddescr = self.cpu.fielddescrof(STRUCT, c_field.value)
-            args = [v_inst, v_index, arraydescr, fielddescr]
+            descr = self.cpu.interiorfielddescrof(v_inst.concretetype.TO,
+                                                  c_field.value)
+            args = [v_inst, v_index, descr]
             kind = getkind(op.result.concretetype)[0]
             return SpaceOperation('getinteriorfield_gc_%s' % kind, args,
                                   op.result)
@@ -736,10 +736,10 @@
             assert isinstance(v_inst.concretetype.TO, lltype.GcArray)
             STRUCT = v_inst.concretetype.TO.OF
             assert isinstance(STRUCT, lltype.Struct)
-            arraydescr = self.cpu.arraydescrof(v_inst.concretetype.TO)
-            fielddescr = self.cpu.fielddescrof(STRUCT, c_field.value)
+            descr = self.cpu.interiorfielddescrof(v_inst.concretetype.TO,
+                                                  c_field.value)
             kind = getkind(v_value.concretetype)[0]
-            args = [v_inst, v_index, v_value, arraydescr, fielddescr]
+            args = [v_inst, v_index, v_value, descr]
             return SpaceOperation('setinteriorfield_gc_%s' % kind, args,
                                   op.result)
 
diff --git a/pypy/jit/codewriter/test/test_jtransform.py b/pypy/jit/codewriter/test/test_jtransform.py
--- a/pypy/jit/codewriter/test/test_jtransform.py
+++ b/pypy/jit/codewriter/test/test_jtransform.py
@@ -657,8 +657,7 @@
                         v_result)
     op1 = Transformer(FakeCPU()).rewrite_operation(op)
     assert op1.opname == 'getinteriorfield_gc_i'
-    assert op1.args == [v, i, ('arraydescr', DICT),
-                        ('fielddescr', DICT.OF, 'v')]
+    assert op1.args == [v, i, ('interiorfielddescr', DICT, 'v')]
 
 def test_str_setinteriorfield():
     v = varoftype(lltype.Ptr(rstr.STR))
@@ -697,8 +696,7 @@
                         v_void)
     op1 = Transformer(FakeCPU()).rewrite_operation(op)
     assert op1.opname == 'setinteriorfield_gc_i'
-    assert op1.args == [v, i, i, ('arraydescr', DICT),
-                        ('fielddescr', DICT.OF, 'v')]
+    assert op1.args == [v, i, i, ('interiorfielddescr', DICT, 'v')]
 
 def test_promote_1():
     v1 = varoftype(lltype.Signed)


More information about the pypy-commit mailing list