[pypy-svn] r52449 - in pypy/branch/jit-hotpath/pypy/jit/rainbow: . test
arigo at codespeak.net
arigo at codespeak.net
Thu Mar 13 15:43:04 CET 2008
Author: arigo
Date: Thu Mar 13 15:43:04 2008
New Revision: 52449
Added:
pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_hot_promotion.py
- copied, changed from r52444, pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_promotion.py
Modified:
pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py
pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_hotpath.py
Log:
Starting to port the promotion tests.
Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/codewriter.py Thu Mar 13 15:43:04 2008
@@ -843,6 +843,8 @@
self.register_greenvar(result)
def handle_global_merge_point_hint(self, op, arg, result):
+ if self.hannotator.policy.hotpath:
+ raise JitHintError("'global_merge_point' not supported by hotpath")
return # the compute_merge_points function already cared
def handle_reverse_split_queue_hint(self, op, arg, result):
Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_hotpath.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_hotpath.py (original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/test/test_hotpath.py Thu Mar 13 15:43:04 2008
@@ -15,12 +15,16 @@
def __init__(self, result):
self.result = result
-class TestHotPath(test_interpreter.InterpretationTest):
+class HotPathTest(test_interpreter.InterpretationTest):
type_system = 'lltype'
def run(self, main, main_args, threshold, policy=P_HOTPATH, small=False):
# xxx caching of tests doesn't work - do we care?
self._serialize(main, main_args, policy=policy, backendoptimize=True)
+ self._rewrite(threshold)
+ self._run(main, main_args)
+
+ def _rewrite(self, threshold):
rewriter = EntryPointsRewriter(self.hintannotator, self.rtyper,
self.jitcode, self.RGenOp, self.writer,
threshold, self.translate_support_code)
@@ -29,6 +33,7 @@
if small and conftest.option.view:
self.rtyper.annotator.translator.view()
+ def _run(self, main, main_args):
graph = self.rtyper.annotator.translator.graphs[0]
assert graph.func is main
llinterp = LLInterpreter(
@@ -50,6 +55,8 @@
i += 1
+class TestHotPath(HotPathTest):
+
def test_simple_loop(self):
# there are no greens in this test
class MyJitDriver(JitDriver):
More information about the Pypy-commit
mailing list