Author: Maciej Fijalkowski <[email protected]>
Branch: conditional_call_value
Changeset: r77047:355dc6002c22
Date: 2015-05-04 19:05 +0200
http://bitbucket.org/pypy/pypy/changeset/355dc6002c22/
Log: try to use conditional_call_value - NOTE THAT WE IGNORED ELIDABLE
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
@@ -358,7 +358,14 @@
return b
@staticmethod
- @jit.elidable
+ def _ll_strhash(s):
+ x = _hash_string(s.chars)
+ if x == 0:
+ x = 29872897
+ s.hash = x
+ return x
+
+ @staticmethod
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
@@ -366,12 +373,7 @@
if not s:
return 0
x = s.hash
- if x == 0:
- x = _hash_string(s.chars)
- if x == 0:
- x = 29872897
- s.hash = x
- return x
+ return jit.conditional_call_value(x == 0, LLHelpers._ll_strhash, x, s)
@staticmethod
def ll_length(s):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit