Author: Maciej Fijalkowski <[email protected]>
Branch: better-jit-hooks
Changeset: r51177:666eb3524b3c
Date: 2012-01-09 19:20 +0200
http://bitbucket.org/pypy/pypy/changeset/666eb3524b3c/
Log: update the pypyjit module as well
diff --git a/pypy/module/pypyjit/__init__.py b/pypy/module/pypyjit/__init__.py
--- a/pypy/module/pypyjit/__init__.py
+++ b/pypy/module/pypyjit/__init__.py
@@ -17,11 +17,11 @@
def setup_after_space_initialization(self):
# force the __extend__ hacks to occur early
from pypy.module.pypyjit.interp_jit import pypyjitdriver
- from pypy.module.pypyjit.policy import pypy_portal
+ from pypy.module.pypyjit.policy import pypy_hooks
# add the 'defaults' attribute
from pypy.rlib.jit import PARAMETERS
space = self.space
pypyjitdriver.space = space
w_obj = space.wrap(PARAMETERS)
space.setattr(space.wrap(self), space.wrap('defaults'), w_obj)
- pypy_portal.space = space
+ pypy_hooks.space = space
diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -1,12 +1,12 @@
from pypy.jit.codewriter.policy import JitPolicy
-from pypy.rlib.jit import JitPortal
+from pypy.rlib.jit import JitHookInterface
from pypy.rlib import jit_hooks
from pypy.interpreter.error import OperationError
from pypy.jit.metainterp.jitprof import counter_names
from pypy.module.pypyjit.interp_resop import wrap_oplist, Cache,
wrap_greenkey,\
WrappedOp
-class PyPyPortal(JitPortal):
+class PyPyJitIface(JitHookInterface):
def on_abort(self, reason, jitdriver, greenkey):
space = self.space
cache = space.fromcache(Cache)
@@ -104,7 +104,7 @@
finally:
cache.in_recursion = False
-pypy_portal = PyPyPortal()
+pypy_hooks = PyPyJitIface()
class PyPyJitPolicy(JitPolicy):
diff --git a/pypy/module/pypyjit/test/test_jit_hook.py
b/pypy/module/pypyjit/test/test_jit_hook.py
--- a/pypy/module/pypyjit/test/test_jit_hook.py
+++ b/pypy/module/pypyjit/test/test_jit_hook.py
@@ -11,7 +11,7 @@
from pypy.rpython.lltypesystem import lltype, llmemory
from pypy.rpython.lltypesystem.rclass import OBJECT
from pypy.module.pypyjit.interp_jit import pypyjitdriver
-from pypy.module.pypyjit.policy import pypy_portal
+from pypy.module.pypyjit.policy import pypy_hooks
from pypy.jit.tool.oparser import parse
from pypy.jit.metainterp.typesystem import llhelper
from pypy.jit.metainterp.jitprof import ABORT_TOO_LONG
@@ -61,21 +61,21 @@
offset[op] = i
def interp_on_compile():
- pypy_portal.after_compile(pypyjitdriver, logger, JitCellToken(),
+ pypy_hooks.after_compile(pypyjitdriver, logger, JitCellToken(),
cls.oplist, 'loop', greenkey, offset,
0, 0)
def interp_on_compile_bridge():
- pypy_portal.after_compile_bridge(pypyjitdriver, logger,
+ pypy_hooks.after_compile_bridge(pypyjitdriver, logger,
JitCellToken(), cls.oplist, 0,
offset, 0, 0)
def interp_on_optimize():
- pypy_portal.before_compile(pypyjitdriver, logger, JitCellToken(),
+ pypy_hooks.before_compile(pypyjitdriver, logger, JitCellToken(),
cls.oplist, 'loop', greenkey)
def interp_on_abort():
- pypy_portal.on_abort(ABORT_TOO_LONG, pypyjitdriver, greenkey)
+ pypy_hooks.on_abort(ABORT_TOO_LONG, pypyjitdriver, greenkey)
cls.w_on_compile = space.wrap(interp2app(interp_on_compile))
cls.w_on_compile_bridge =
space.wrap(interp2app(interp_on_compile_bridge))
diff --git a/pypy/translator/goal/targetpypystandalone.py
b/pypy/translator/goal/targetpypystandalone.py
--- a/pypy/translator/goal/targetpypystandalone.py
+++ b/pypy/translator/goal/targetpypystandalone.py
@@ -226,8 +226,8 @@
return self.get_entry_point(config)
def jitpolicy(self, driver):
- from pypy.module.pypyjit.policy import PyPyJitPolicy, pypy_portal
- return PyPyJitPolicy(pypy_portal)
+ from pypy.module.pypyjit.policy import PyPyJitPolicy, pypy_hooks
+ return PyPyJitPolicy(pypy_hooks)
def get_entry_point(self, config):
from pypy.tool.lib_pypy import import_from_lib_pypy
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit