[pypy-svn] r65648 - in pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp: . test

antocuni at codespeak.net antocuni at codespeak.net
Sun Jun 7 20:46:52 CEST 2009


Author: antocuni
Date: Sun Jun  7 20:46:51 2009
New Revision: 65648

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py
Log:
more refactoring: move find_nodes_new_with_vtable to TrackClass, and make it
using the 'known_class' attribute instead of the old 'cls' one



Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	Sun Jun  7 20:46:51 2009
@@ -290,6 +290,12 @@
     def init_node(self, node):
         node.known_class = None
 
+    def find_nodes_new_with_vtable(self, spec, op):
+        box = op.result
+        node = spec.newnode(box, escaped=False)
+        node.known_class = spec.newnode(op.args[0], const=True)
+        spec.nodes[box] = node
+
     def find_nodes_guard_class(self, spec, op):
         node = spec.getnode(op.args[0])
         if node.known_class is None:
@@ -327,14 +333,6 @@
     def init_node(self, node):
         node.origfields = r_dict(av_eq, av_hash)
         node.curfields = r_dict(av_eq, av_hash)
-        node.cls = None
-
-
-    def find_nodes_new_with_vtable(self, spec, op):
-        box = op.result
-        instnode = spec.newnode(box, escaped=False)
-        instnode.cls = spec.newnode(op.args[0], const=True)
-        spec.nodes[box] = instnode
 
     def find_nodes_setfield_gc(self, spec, op):
         instnode = spec.getnode(op.args[0])

Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py	Sun Jun  7 20:46:51 2009
@@ -214,9 +214,9 @@
         p1 = loop.operations[4].result
         assert spec.nodes[i0] is not spec.nodes[i3]
         assert spec.nodes[p0] is not spec.nodes[p1]
-        assert spec.nodes[p0].cls.source.value == self.node_vtable_adr
+        assert spec.nodes[p0].known_class.source.value == self.node_vtable_adr
         assert not spec.nodes[p0].escaped
-        assert spec.nodes[p1].cls.source.value == self.node_vtable_adr
+        assert spec.nodes[p1].known_class.source.value == self.node_vtable_adr
         assert not spec.nodes[p1].escaped
 
         assert len(spec.nodes[p0].curfields) == 0



More information about the Pypy-commit mailing list