Author: Armin Rigo <ar...@tunes.org>
Branch: conditional_call_value_3
Changeset: r87025:3f78315bc18d
Date: 2016-09-12 11:35 +0200
http://bitbucket.org/pypy/pypy/changeset/3f78315bc18d/

Log:    Use @jit.call_shortcut here.

diff --git a/rpython/rtyper/lltypesystem/rstr.py 
b/rpython/rtyper/lltypesystem/rstr.py
--- a/rpython/rtyper/lltypesystem/rstr.py
+++ b/rpython/rtyper/lltypesystem/rstr.py
@@ -369,13 +369,19 @@
         return b
 
     @staticmethod
+    def ll_strhash(s):
+        if s:
+            return LLHelpers._ll_strhash(s)
+        else:
+            return 0
+
+    @staticmethod
     @jit.elidable
-    def ll_strhash(s):
+    @jit.call_shortcut
+    def _ll_strhash(s):
         # unlike CPython, there is no reason to avoid to return -1
         # but our malloc initializes the memory to zero, so we use zero as the
         # special non-computed-yet value.
-        if not s:
-            return 0
         x = s.hash
         if x == 0:
             x = _hash_string(s.chars)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to