[pypy-svn] r79740 - in pypy/branch/out-of-line-guards/pypy/rpython: . lltypesystem test

fijal at codespeak.net fijal at codespeak.net
Thu Dec 2 12:26:20 CET 2010


Author: fijal
Date: Thu Dec  2 12:26:19 2010
New Revision: 79740

Modified:
   pypy/branch/out-of-line-guards/pypy/rpython/lltypesystem/rclass.py
   pypy/branch/out-of-line-guards/pypy/rpython/rclass.py
   pypy/branch/out-of-line-guards/pypy/rpython/test/test_rclass.py
Log:
Fix


Modified: pypy/branch/out-of-line-guards/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/rpython/lltypesystem/rclass.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/rpython/lltypesystem/rclass.py	Thu Dec  2 12:26:19 2010
@@ -517,7 +517,8 @@
         # for virtualizables; see rvirtualizable2.py
         if (op == 'setfield' and cname.value.startswith('inst_') and
             cname.value[len('inst_'):] in self.jit_invariant_fields):
-            llops.genop('jit_invariant_setfield', [])
+            llops.genop('jit_marker', [Constant('invariant_setfield',
+                                                lltype.Void)])
 
     def new_instance(self, llops, classcallhop=None):
         """Build a new instance, without calling __init__."""

Modified: pypy/branch/out-of-line-guards/pypy/rpython/rclass.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/rpython/rclass.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/rpython/rclass.py	Thu Dec  2 12:26:19 2010
@@ -170,7 +170,7 @@
                 self.immutable_fields = immutable_fields.value
             accessor = FieldListAccessor()
             hints['immutable_fields'] = accessor
-        if self.jit_invariant_fields:
+        if self.classdef.classdesc.lookup('_jit_invariant_fields_') is not None:
             hints = hints.copy()
             accessor = FieldListAccessor()
             hints['jit_invariant_fields'] = accessor

Modified: pypy/branch/out-of-line-guards/pypy/rpython/test/test_rclass.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/rpython/test/test_rclass.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/rpython/test/test_rclass.py	Thu Dec  2 12:26:19 2010
@@ -1069,8 +1069,12 @@
 
         t, typer, graph = self.gengraph(f, [])
         block = graph.iterblocks().next()
-        assert 'jit_invariant_setfield' in [op.opname for op
-                                            in block.operations]
+        for op in block.operations:
+            if op.opname == 'jit_marker':
+                assert op.args[0].value == 'invariant_setfield'
+                break
+        else:
+            raise Exception("did not find jit invariant setfield marker")
 
 class TestOOtype(BaseTestRclass, OORtypeMixin):
     def test__del__(self):



More information about the Pypy-commit mailing list