[pypy-svn] r78695 - pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test

hakanardo at codespeak.net hakanardo at codespeak.net
Thu Nov 4 16:54:48 CET 2010


Author: hakanardo
Date: Thu Nov  4 16:54:42 2010
New Revision: 78695

Modified:
   pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
Log:
fixed test

Modified: pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py
==============================================================================
--- pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	(original)
+++ pypy/branch/jit-unroll-loops/pypy/module/pypyjit/test/test_pypy_c.py	Thu Nov  4 16:54:42 2010
@@ -286,14 +286,18 @@
         ''', 93,
                    ([20], 20),
                     ([31], 32))
-        ops = self.get_by_bytecode("LOOKUP_METHOD")
+        ops = self.get_by_bytecode("LOOKUP_METHOD", True)
         assert len(ops) == 2
         assert not ops[0].get_opnames("call")
         assert not ops[0].get_opnames("new")
-        assert len(ops[0].get_opnames("guard")) <= 2
+        assert len(ops[0].get_opnames("guard")) <= 3
         assert not ops[1] # second LOOKUP_METHOD folded away
 
-        ops = self.get_by_bytecode("CALL_METHOD")
+        ops = self.get_by_bytecode("LOOKUP_METHOD")
+        assert not ops[0] # first LOOKUP_METHOD folded away
+        assert not ops[1] # second LOOKUP_METHOD folded away
+
+        ops = self.get_by_bytecode("CALL_METHOD", True)
         assert len(ops) == 2
         for i, bytecode in enumerate(ops):
             if i == 0:
@@ -304,7 +308,12 @@
             assert len(bytecode.get_opnames("guard")) <= 6
         assert len(ops[1]) < len(ops[0])
 
-        ops = self.get_by_bytecode("LOAD_ATTR")
+        ops = self.get_by_bytecode("CALL_METHOD")
+        assert len(ops) == 2
+        assert len(ops[0]) <= 1
+        assert len(ops[1]) <= 1
+        
+        ops = self.get_by_bytecode("LOAD_ATTR", True)
         assert len(ops) == 2
         # With mapdict, we get fast access to (so far) the 5 first
         # attributes, which means it is done with only the following
@@ -314,6 +323,10 @@
                                         "guard_nonnull_class"]
         assert not ops[1] # second LOAD_ATTR folded away
 
+        ops = self.get_by_bytecode("LOAD_ATTR")
+        assert not ops[0] # first LOAD_ATTR folded away
+        assert not ops[1] # second LOAD_ATTR folded away
+
     def test_static_classmethod_call(self):
         self.run_source('''
             class A(object):



More information about the Pypy-commit mailing list