[pypy-svn] r69164 - in pypy/trunk/pypy/jit/backend: cli test

antocuni at codespeak.net antocuni at codespeak.net
Wed Nov 11 14:17:16 CET 2009


Author: antocuni
Date: Wed Nov 11 14:17:16 2009
New Revision: 69164

Modified:
   pypy/trunk/pypy/jit/backend/cli/method.py
   pypy/trunk/pypy/jit/backend/test/support.py
Log:
use the full optimizer also for the translated tests, and implement guard_nonnull_class for cli


Modified: pypy/trunk/pypy/jit/backend/cli/method.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/cli/method.py	(original)
+++ pypy/trunk/pypy/jit/backend/cli/method.py	Wed Nov 11 14:17:16 2009
@@ -492,6 +492,19 @@
         self.push_arg(op, 1)
         self.il.Emit(OpCodes.Bne_Un, il_label)
 
+    def emit_op_guard_nonnull_class(self, op):
+        assert len(op.args) == 2
+        il_label = self.newbranch(op)
+        # nonnull check
+        self.push_arg(op, 0)
+        self.il.Emit(OpCodes.Brfalse, il_label)
+        # class check
+        self.push_arg(op, 0)
+        meth = dotnet.typeof(System.Object).GetMethod("GetType")
+        self.il.Emit(OpCodes.Callvirt, meth)
+        self.push_arg(op, 1)
+        self.il.Emit(OpCodes.Bne_Un, il_label)
+
     def emit_op_guard_no_exception(self, op):
         il_label = self.newbranch(op)
         self.av_inputargs.load(self)

Modified: pypy/trunk/pypy/jit/backend/test/support.py
==============================================================================
--- pypy/trunk/pypy/jit/backend/test/support.py	(original)
+++ pypy/trunk/pypy/jit/backend/test/support.py	Wed Nov 11 14:17:16 2009
@@ -1,6 +1,7 @@
 import py
 import sys
 from pypy.rlib.debug import debug_print
+from pypy.rlib.jit import OPTIMIZER_FULL
 from pypy.translator.translator import TranslationContext
 
 class BaseCompiledMixin(object):
@@ -64,6 +65,7 @@
         warmrunnerdesc.state.set_param_trace_eagerness(2)    # for tests
         warmrunnerdesc.state.set_param_trace_limit(trace_limit)
         warmrunnerdesc.state.set_param_inlining(inline)
+        warmrunnerdesc.state.set_param_optimizer(OPTIMIZER_FULL)
         mixlevelann = warmrunnerdesc.annhelper
         entry_point_graph = mixlevelann.getgraph(entry_point, [s_list_of_strings],
                                                  annmodel.SomeInteger())



More information about the Pypy-commit mailing list