Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r64630:7bac0a805c70
Date: 2013-05-28 10:30 -0700
http://bitbucket.org/pypy/pypy/changeset/7bac0a805c70/
Log: mark this function as elidable
diff --git a/pypy/objspace/std/stringtype.py b/pypy/objspace/std/stringtype.py
--- a/pypy/objspace/std/stringtype.py
+++ b/pypy/objspace/std/stringtype.py
@@ -1,13 +1,14 @@
+from sys import maxint
+
+from rpython.rlib import jit
+from rpython.rlib.objectmodel import specialize
+
from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
from pypy.objspace.std.stdtypedef import StdTypeDef, SMM
from pypy.objspace.std.basestringtype import basestring_typedef
from pypy.objspace.std.register_all import register_all
-from sys import maxint
-from rpython.rlib.objectmodel import specialize
-from rpython.rlib.jit import we_are_jitted
-
def wrapstr(space, s):
from pypy.objspace.std.stringobject import W_StringObject
if space.config.objspace.std.sharesmallstr:
@@ -27,7 +28,7 @@
def wrapchar(space, c):
from pypy.objspace.std.stringobject import W_StringObject
- if space.config.objspace.std.withprebuiltchar and not we_are_jitted():
+ if space.config.objspace.std.withprebuiltchar and not jit.we_are_jitted():
return W_StringObject.PREBUILT[ord(c)]
else:
return W_StringObject(c)
@@ -293,11 +294,13 @@
str_typedef.registermethods(globals())
+
# ____________________________________________________________
# Helpers for several string implementations
@specialize.argtype(0)
[email protected]
def stringendswith(u_self, suffix, start, end):
begin = end - len(suffix)
if begin < start:
@@ -308,6 +311,7 @@
return True
@specialize.argtype(0)
[email protected]
def stringstartswith(u_self, prefix, start, end):
stop = start + len(prefix)
if stop > end:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit