[pypy-svn] r74861 - in pypy/branch/blackhole-improvement/pypy: jit/metainterp rpython rpython/lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri May 28 16:57:32 CEST 2010


Author: arigo
Date: Fri May 28 16:57:30 2010
New Revision: 74861

Modified:
   pypy/branch/blackhole-improvement/pypy/jit/metainterp/logger.py
   pypy/branch/blackhole-improvement/pypy/rpython/llinterp.py
   pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/llmemory.py
Log:
Fixes.


Modified: pypy/branch/blackhole-improvement/pypy/jit/metainterp/logger.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/jit/metainterp/logger.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/jit/metainterp/logger.py	Fri May 28 16:57:30 2010
@@ -108,6 +108,7 @@
 
 def int_could_be_an_address(x):
     if we_are_translated():
+        x = llmemory.get_inthash_from_int(x)
         return not (-32768 <= x <= 32767)
     else:
         return isinstance(x, llmemory.AddressAsInt)

Modified: pypy/branch/blackhole-improvement/pypy/rpython/llinterp.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/rpython/llinterp.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/rpython/llinterp.py	Fri May 28 16:57:30 2010
@@ -117,7 +117,7 @@
                 continue
             try:
                 logline += " " + self.typer.annotator.annotated[frame.curr_block].func.__module__
-            except (KeyError, AttributeError):
+            except (KeyError, AttributeError, TypeError):
                 logline += " <unknown module>"
             lines.append(logline)
             for i, operation in enumerate(frame.curr_block.operations):

Modified: pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/llmemory.py
==============================================================================
--- pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/llmemory.py	(original)
+++ pypy/branch/blackhole-improvement/pypy/rpython/lltypesystem/llmemory.py	Fri May 28 16:57:30 2010
@@ -636,6 +636,9 @@
     return cast_ptr_to_adr(ptr)
 
 def get_inthash_from_int(int):
+    """Just returns 'int' after translation.  Before translation, it convert
+    an AddressAsInt into a real integer, to use e.g. as a hash.  Do not store
+    the real integer (or the dict using this as a hash) across translation."""
     if isinstance(int, AddressAsInt):
         int = lltype.cast_ptr_to_int(int.adr.ptr)
     return int



More information about the Pypy-commit mailing list