[pypy-svn] r65766 - in pypy/branch/pyjitpl5/pypy: jit/metainterp rlib

fijal at codespeak.net fijal at codespeak.net
Sun Jun 14 00:06:43 CEST 2009


Author: fijal
Date: Sun Jun 14 00:06:42 2009
New Revision: 65766

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/warmspot.py
   pypy/branch/pyjitpl5/pypy/rlib/jit.py
Log:
Hooks for setting parameters at runtime


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	Sun Jun 14 00:06:42 2009
@@ -136,6 +136,8 @@
         self.rewrite_can_enter_jit()
         self.add_profiler_finish()
         self.metainterp_sd.finish_setup(self)
+        # hook back for set_param
+        self.jitdriver.state = self.state
 
     def finish(self):
         if self.cpu.translate_support_code:

Modified: pypy/branch/pyjitpl5/pypy/rlib/jit.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rlib/jit.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rlib/jit.py	Sun Jun 14 00:06:42 2009
@@ -105,7 +105,6 @@
         for v in self.virtualizables:
             assert v in self.reds
         self._alllivevars = dict.fromkeys(self.greens + self.reds)
-        self._params = PARAMETERS.copy()
         if hasattr(self, 'on_enter_jit'):
             self._make_on_enter_jit_wrappers()
         self._make_extregistryentries()
@@ -125,7 +124,7 @@
         # special-cased by ExtRegistryEntry
         # (internal, must receive a constant 'name')
         assert name in PARAMETERS
-        self._params[name] = value
+        getattr(self.state, 'set_param_' + name)(value)
 
     def set_param(self, name, value):
         """Set one of the tunable JIT parameter."""



More information about the Pypy-commit mailing list