Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r70294:d3957e5f25d8
Date: 2014-03-26 07:38 +0100
http://bitbucket.org/pypy/pypy/changeset/d3957e5f25d8/
Log: fix: the JIT doesn't support for now 'with stm_ignored:'
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
@@ -377,12 +377,12 @@
# special non-computed-yet value.
if not s:
return 0
- with stm_ignored:
- x = s.hash
+ x = s.hash
if x == 0:
x = LLHelpers._ll_compute_strhash(s)
return x
+ @jit.dont_look_inside
def _ll_compute_strhash(s):
x = _hash_string(s.chars)
if x == 0:
@@ -396,11 +396,10 @@
def ll_strfasthash(s):
if rgc.stm_is_enabled():
- # due to "with stm_ignored" in _ll_strhash(), it is possible
- # that just returning 's.hash' from here would rarely return
- # the old value, which is 0. We need to check.
- with stm_ignored:
- x = s.hash
+ # due to "with stm_ignored" in _ll_compute_strhash(), it is
+ # possible that just returning 's.hash' from here would rarely
+ # return the old value, which is 0. We need to check.
+ x = s.hash
if x == 0:
x = LLHelpers._ll_compute_strhash(s)
return x
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit