Author: Konstantin Lopuhin <[email protected]>
Branch: bridge-logging
Changeset: r62868:bf34393b292e
Date: 2013-03-28 16:34 +0100
http://bitbucket.org/pypy/pypy/changeset/bf34393b292e/

Log:    add test program, ignore more lib-python startup stuff

diff --git a/pypy/tool/jitlogparser/test/test_parser.py 
b/pypy/tool/jitlogparser/test/test_parser.py
--- a/pypy/tool/jitlogparser/test/test_parser.py
+++ b/pypy/tool/jitlogparser/test/test_parser.py
@@ -389,9 +389,11 @@
         env={'PYPYLOG': 'jit-log-opt,jit-backend:%s' % log_filename})
     log, loops = import_log(log_filename)
     parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
+    lib_re = re.compile("file '.*lib-python.*'")
     for loop in loops:
         loop.force_asm()
-        if re.search("file '.*lib-python.*'", loop.comment):
+        if lib_re.search(loop.comment) or \
+                lib_re.search(loop.operations[0].repr()):
             # do not care for _optimize_charset or _mk_bitmap
             continue
         else:
diff --git a/pypy/tool/jitlogparser/test/y.py b/pypy/tool/jitlogparser/test/y.py
new file mode 100644
--- /dev/null
+++ b/pypy/tool/jitlogparser/test/y.py
@@ -0,0 +1,24 @@
+
+def fn_with_bridges(N):
+    result = 0
+    for x in xrange(N):
+        if x % 3 == 0:
+            result += 5
+        elif x % 5 == 0:
+            result += 3
+        elif is_prime(x):
+            result += x
+        elif x == 99:
+            result *= 2
+    return result
+
+
+def is_prime(x):
+    for y in xrange(2, x):
+        if x % y == 0:
+            return False
+    return True
+
+
+fn_with_bridges(10000)
+
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to