Author: Armin Rigo <[email protected]>
Branch: jit-counter
Changeset: r67769:14343c11219f
Date: 2013-10-31 12:43 +0100
http://bitbucket.org/pypy/pypy/changeset/14343c11219f/
Log: Test fix: force turning AddressAsInt into real ints for hashing
diff --git a/rpython/jit/metainterp/compile.py
b/rpython/jit/metainterp/compile.py
--- a/rpython/jit/metainterp/compile.py
+++ b/rpython/jit/metainterp/compile.py
@@ -1,5 +1,5 @@
import weakref
-from rpython.rtyper.lltypesystem import lltype
+from rpython.rtyper.lltypesystem import lltype, llmemory
from rpython.rtyper.annlowlevel import cast_instance_to_gcref
from rpython.rlib.objectmodel import we_are_translated
from rpython.rlib.debug import debug_start, debug_stop, debug_print
@@ -590,6 +590,11 @@
else:
assert 0, typetag
+ if not we_are_translated():
+ if isinstance(intval, llmemory.AddressAsInt):
+ intval = llmemory.cast_adr_to_int(
+ llmemory.cast_int_to_adr(intval), "forced")
+
hash = (current_object_addr_as_int(self) * 777767777 +
intval * 1442968193)
index = jitcounter.get_index(hash)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit