[pypy-commit] pypy default: Add a couple of jit.elidable

arigo pypy.commits at gmail.com
Sun Jan 15 12:34:32 EST 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r89590:acfeb77833ff
Date: 2017-01-15 18:33 +0100
http://bitbucket.org/pypy/pypy/changeset/acfeb77833ff/

Log:	Add a couple of jit.elidable

diff --git a/pypy/objspace/std/bytesobject.py b/pypy/objspace/std/bytesobject.py
--- a/pypy/objspace/std/bytesobject.py
+++ b/pypy/objspace/std/bytesobject.py
@@ -1,5 +1,6 @@
 """The builtin str implementation"""
 
+from rpython.rlib import jit
 from rpython.rlib.jit import we_are_jitted
 from rpython.rlib.objectmodel import (
     compute_hash, compute_unique_id, import_from_mixin)
@@ -950,6 +951,7 @@
 W_BytesObject.typedef.flag_sequence_bug_compat = True
 
 
+ at jit.elidable
 def string_escape_encode(s, quote):
     buf = StringBuilder(len(s) + 2)
 
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -1378,7 +1378,12 @@
         CHR = chr
 
     def unicode_escape(s, size, errors, errorhandler=None):
-        # errorhandler is not used: this function cannot cause Unicode errors
+        # errors and errorhandler are not used: this function cannot cause
+        # Unicode errors
+        return _unicode_escape(s, size)
+
+    @jit.elidable
+    def _unicode_escape(s, size):
         result = STRING_BUILDER(size)
 
         if quotes:


More information about the pypy-commit mailing list