[pypy-svn] pypy default: Add a new description how this might work

fijal commits-noreply at bitbucket.org
Fri Jan 28 14:17:32 CET 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: 
Changeset: r41424:8fcf6637aebb
Date: 2011-01-28 15:17 +0200
http://bitbucket.org/pypy/pypy/changeset/8fcf6637aebb/

Log:	Add a new description how this might work

diff --git a/pypy/module/pypyjit/test/test_pypy_c_new.py b/pypy/module/pypyjit/test/test_pypy_c_new.py
new file mode 100644
--- /dev/null
+++ b/pypy/module/pypyjit/test/test_pypy_c_new.py
@@ -0,0 +1,26 @@
+
+import py
+py.test.skip("DEMO")
+
+class TestPyPyCNew(object):
+    def test_one(self):
+        def f():
+            i = 0
+            while i < 1003:
+                # LOOP one
+                i += 1
+
+        trace = self.run(f, [])
+        loop = trace.get_loops('one')
+        loop.get_bytecode(3, 'LOAD_FAST').match('''
+        int_add
+        guard_true
+        ''')
+        loop.get_bytecode(4, 'LOAD_CONST').match_stats(
+            guard='3', call='1-2', call_may_force='0'
+        )
+        # this would make operations that are "costly" obligatory to pass
+        # like new
+        loo.get_bytecode(5, 'INPLACE_ADD').match_stats(
+            allocs='5-10'
+            )


More information about the Pypy-commit mailing list