Author: Maciej Fijalkowski <[email protected]>
Branch: unroll-if-const
Changeset: r45977:e88af6cdf11d
Date: 2011-07-25 19:45 +0200
http://bitbucket.org/pypy/pypy/changeset/e88af6cdf11d/

Log:    we want quick turnover here, disable stuff

diff --git a/pypy/jit/tl/pypyjit.py b/pypy/jit/tl/pypyjit.py
--- a/pypy/jit/tl/pypyjit.py
+++ b/pypy/jit/tl/pypyjit.py
@@ -37,13 +37,13 @@
 set_opt_level(config, level='jit')
 config.objspace.allworkingmodules = False
 config.objspace.usemodules.pypyjit = True
-config.objspace.usemodules.array = True
+config.objspace.usemodules.array = False
 config.objspace.usemodules._weakref = True
 config.objspace.usemodules._sre = False
-config.objspace.usemodules._lsprof = True
+config.objspace.usemodules._lsprof = False
 #
-config.objspace.usemodules._ffi = True
-config.objspace.usemodules.micronumpy = True
+config.objspace.usemodules._ffi = False
+config.objspace.usemodules.micronumpy = False
 #
 set_pypy_opt_level(config, level='jit')
 
diff --git a/pypy/jit/tl/pypyjit_demo.py b/pypy/jit/tl/pypyjit_demo.py
--- a/pypy/jit/tl/pypyjit_demo.py
+++ b/pypy/jit/tl/pypyjit_demo.py
@@ -1,9 +1,7 @@
 
 try:
-    import numpy
-    a = numpy.array(range(10))
-    b = a + a + a
-    print b[3]
+    for i in range(1000):
+        "%d %d" % (i, i)
 
 except Exception, e:
     print "Exception: ", type(e)
diff --git a/pypy/objspace/std/formatting.py b/pypy/objspace/std/formatting.py
--- a/pypy/objspace/std/formatting.py
+++ b/pypy/objspace/std/formatting.py
@@ -4,6 +4,7 @@
 from pypy.rlib.unroll import unrolling_iterable
 from pypy.rlib.rarithmetic import ovfcheck
 from pypy.rlib.rfloat import formatd, DTSF_ALT, isnan, isinf
+from pypy.rlib import jit
 from pypy.interpreter.error import OperationError
 from pypy.tool.sourcetools import func_with_new_name
 from pypy.rlib.rstring import StringBuilder, UnicodeBuilder
@@ -233,6 +234,7 @@
 
             return w_value
 
+        @jit.unroll_safe
         def peel_flags(self):
             self.f_ljust = False
             self.f_sign  = False
@@ -255,6 +257,7 @@
                     break
                 self.forward()
 
+        @jit.unroll_safe
         def peel_num(self):
             space = self.space
             c = self.peekchr()
@@ -276,7 +279,9 @@
                 c = self.peekchr()
             return result
 
-        def format(self):
+        # Note: fmt is passed here only to specialize on
+        @jit.unroll_if_const(1)
+        def format(self, fmt):
             lgt = len(self.fmt) + 4 * len(self.values_w) + 10
             if do_unicode:
                 result = UnicodeBuilder(lgt)
@@ -496,7 +501,7 @@
         fmt = space.str_w(w_fmt)
         formatter = StringFormatter(space, fmt, values_w, w_valuedict)
         try:
-            result = formatter.format()
+            result = formatter.format(fmt)
         except NeedUnicodeFormattingError:
             # fall through to the unicode case
             from pypy.objspace.std.unicodetype import plain_str2unicode
@@ -506,7 +511,7 @@
     else:
         fmt = space.unicode_w(w_fmt)
     formatter = UnicodeFormatter(space, fmt, values_w, w_valuedict)
-    result = formatter.format()
+    result = formatter.format(fmt)
     return space.wrap(result)
 
 def mod_format(space, w_format, w_values, do_unicode=False):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to