[pypy-svn] r68415 - pypy/branch/improve-kwd-args/pypy/objspace/std

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Oct 14 09:27:22 CEST 2009


Author: cfbolz
Date: Wed Oct 14 09:27:21 2009
New Revision: 68415

Modified:
   pypy/branch/improve-kwd-args/pypy/objspace/std/strutil.py
Log:
meh. The JIT was seeing the str->int conversion. Makes no sense at all.


Modified: pypy/branch/improve-kwd-args/pypy/objspace/std/strutil.py
==============================================================================
--- pypy/branch/improve-kwd-args/pypy/objspace/std/strutil.py	(original)
+++ pypy/branch/improve-kwd-args/pypy/objspace/std/strutil.py	Wed Oct 14 09:27:21 2009
@@ -2,6 +2,7 @@
 Pure Python implementation of string utilities.
 """
 
+from pypy.rlib.jit import purefunction
 from pypy.rlib.rarithmetic import ovfcheck, break_up_float, parts_to_float
 from pypy.interpreter.error import OperationError
 import math
@@ -9,6 +10,7 @@
 # XXX factor more functions out of stringobject.py.
 # This module is independent from PyPy.
 
+ at purefunction
 def strip_spaces(s):
     # XXX this is not locale-dependent
     p = 0
@@ -89,6 +91,7 @@
         else:
             return -1
 
+ at purefunction
 def string_to_int(s, base=10):
     """Utility to converts a string to an integer (or possibly a long).
     If base is 0, the proper base is guessed based on the leading
@@ -115,6 +118,7 @@
 def string_to_long(space, s, base=10, parser=None):
     return string_to_w_long(space, s, base, parser).longval()
 
+ at purefunction
 def string_to_w_long(space, s, base=10, parser=None):
     """As string_to_int(), but ignores an optional 'l' or 'L' suffix."""
     if parser is None:
@@ -321,6 +325,7 @@
 # for comments, see above.
 # XXX probably this very specific thing should go into longobject?
 
+ at purefunction
 def interp_string_to_float(space, s):
     """
     Conversion of string to float.



More information about the Pypy-commit mailing list