[pypy-svn] r65215 - pypy/branch/pyjitpl5/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Mon May 11 16:07:39 CEST 2009


Author: arigo
Date: Mon May 11 16:07:37 2009
New Revision: 65215

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/warmspot.py
Log:
Use the full range of integers for the hash in pyjitpl:mp_hash().
Only mask with 'hashtablemask' when useful.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/warmspot.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/warmspot.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/warmspot.py	Mon May 11 16:07:37 2009
@@ -584,7 +584,7 @@
         def maybe_compile_and_run(self, *args):
             # get the greenargs and look for the cell corresponding to the hash
             greenargs = args[:num_green_args]
-            argshash = self.getkeyhash(*greenargs)
+            argshash = self.getkeyhash(*greenargs) & self.hashtablemask
             cell = self.cells[argshash]
             if isinstance(cell, Counter):
                 # update the profiling counter
@@ -674,7 +674,7 @@
                 item = greenargs[i]
                 result = result ^ cast_whatever_to_int(TYPE, item)
                 i = i + 1
-            return result & self.hashtablemask
+            return result
         getkeyhash._always_inline_ = True
 
         def must_compile_from_failure(self, key):
@@ -684,7 +684,7 @@
         def attach_unoptimized_bridge_from_interp(self, greenkey, bridge):
             greenargs = self.unwrap_greenkey(greenkey)
             newcell = MachineCodeEntryPoint(bridge, *greenargs)
-            argshash = self.getkeyhash(*greenargs)
+            argshash = self.getkeyhash(*greenargs) & self.hashtablemask
             cell = self.cells[argshash]
             if not isinstance(cell, Counter):
                 while True:



More information about the Pypy-commit mailing list