Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r59746:86ee356f229e
Date: 2013-01-05 19:49 +0200
http://bitbucket.org/pypy/pypy/changeset/86ee356f229e/

Log:    remerge remove-globals-in-jit

diff --git a/pypy/jit/metainterp/compile.py b/pypy/jit/metainterp/compile.py
--- a/pypy/jit/metainterp/compile.py
+++ b/pypy/jit/metainterp/compile.py
@@ -895,7 +895,7 @@
         finishargs = []
     #
     jd = jitdriver_sd
-    faildescr = PropagateExceptionDescr()
+    faildescr = jitdriver_sd.propagate_exc_descr
     operations = [
         ResOperation(rop.CALL, callargs, result, descr=jd.portal_calldescr),
         ResOperation(rop.GUARD_NO_EXCEPTION, [], None, descr=faildescr),
diff --git a/pypy/jit/metainterp/jitdriver.py b/pypy/jit/metainterp/jitdriver.py
--- a/pypy/jit/metainterp/jitdriver.py
+++ b/pypy/jit/metainterp/jitdriver.py
@@ -19,6 +19,7 @@
     #    self.handle_jitexc_from_bh pypy.jit.metainterp.warmspot
     #    self.no_loop_header    ... pypy.jit.metainterp.warmspot
     #    self.portal_finishtoken... pypy.jit.metainterp.pyjitpl
+    #    self.propagate_exc_descr.. pypy.jit.metainterp.pyjitpl
     #    self.index             ... pypy.jit.codewriter.call
     #    self.mainjitcode       ... pypy.jit.codewriter.call
 
diff --git a/pypy/jit/metainterp/pyjitpl.py b/pypy/jit/metainterp/pyjitpl.py
--- a/pypy/jit/metainterp/pyjitpl.py
+++ b/pypy/jit/metainterp/pyjitpl.py
@@ -1463,6 +1463,7 @@
         #
         # store this information for fastpath of call_assembler
         # (only the paths that can actually be taken)
+        exc_descr = compile.PropagateExceptionDescr()
         for jd in self.jitdrivers_sd:
             name = {history.INT: 'int',
                     history.REF: 'ref',
@@ -1472,8 +1473,8 @@
             jd.portal_finishtoken = tokens[0].finishdescr
             num = self.cpu.get_fail_descr_number(tokens[0].finishdescr)
             setattr(self.cpu, 'done_with_this_frame_%s_v' % name, num)
+            jd.propagate_exc_descr = exc_descr
         #
-        exc_descr = compile.PropagateExceptionDescr()
         num = self.cpu.get_fail_descr_number(exc_descr)
         self.cpu.propagate_exception_v = num
         #
diff --git a/pypy/jit/metainterp/test/test_compile.py 
b/pypy/jit/metainterp/test/test_compile.py
--- a/pypy/jit/metainterp/test/test_compile.py
+++ b/pypy/jit/metainterp/test/test_compile.py
@@ -166,6 +166,7 @@
         portal_runner_adr = llmemory.cast_ptr_to_adr(portal_runner_ptr)
         portal_calldescr = cpu.calldescrof(FUNC, FUNC.ARGS, FUNC.RESULT, None)
         portal_finishtoken = compile.DoneWithThisFrameDescrInt()
+        propagate_exc_descr = compile.PropagateExceptionDescr()
         num_red_args = 2
         result_type = INT
     #
diff --git a/pypy/jit/tl/jittest.py b/pypy/jit/tl/jittest.py
--- a/pypy/jit/tl/jittest.py
+++ b/pypy/jit/tl/jittest.py
@@ -26,8 +26,8 @@
     get_policy = driver.extra['jitpolicy']
     jitpolicy = get_policy(driver)
 
-    from pypy.jit.backend.llgraph.runner import LLtypeCPU
-    apply_jit(jitpolicy, interp, graph, LLtypeCPU)
+    from pypy.jit.backend.llgraph.runner import LLGraphCPU
+    apply_jit(jitpolicy, interp, graph, LLGraphCPU)
 
 
 def apply_jit(policy, interp, graph, CPUClass):
diff --git a/pypy/jit/tl/pypyjit_child.py b/pypy/jit/tl/pypyjit_child.py
--- a/pypy/jit/tl/pypyjit_child.py
+++ b/pypy/jit/tl/pypyjit_child.py
@@ -14,9 +14,9 @@
         return lltype.nullptr(T)
     interp.heap.malloc_nonmovable = returns_null     # XXX
 
-    from pypy.jit.backend.llgraph.runner import LLtypeCPU
-    #LLtypeCPU.supports_floats = False    # for now
-    apply_jit(interp, graph, LLtypeCPU)
+    from pypy.jit.backend.llgraph.runner import LLGraphCPU
+    #LLGraphCPU.supports_floats = False    # for now
+    apply_jit(interp, graph, LLGraphCPU)
 
 
 def run_child_ootype(glob, loc):
diff --git a/pypy/jit/tl/spli/test/test_jit.py 
b/pypy/jit/tl/spli/test/test_jit.py
--- a/pypy/jit/tl/spli/test/test_jit.py
+++ b/pypy/jit/tl/spli/test/test_jit.py
@@ -8,7 +8,7 @@
 
 class TestSPLIJit(JitMixin):
     type_system = 'lltype'
-    CPUClass = runner.LLtypeCPU
+    CPUClass = runner.LLGraphCPU
     
     def interpret(self, f, args):
         coderepr = serializer.serialize(f.func_code)
diff --git a/pypy/rpython/lltypesystem/lloperation.py 
b/pypy/rpython/lltypesystem/lloperation.py
--- a/pypy/rpython/lltypesystem/lloperation.py
+++ b/pypy/rpython/lltypesystem/lloperation.py
@@ -499,7 +499,7 @@
     'gc_typeids_z'        : LLOp(),
     'gc_gcflag_extra'     : LLOp(),
     'gc_add_memory_pressure': LLOp(),
-    'gc_set_extra_threshold': LLOp(canrun=True),
+    'gc_set_extra_threshold': LLOp(canrun=True, canmallocgc=True),
 
     # ------- JIT & GC interaction, only for some GCs ----------
 
diff --git a/pypy/rpython/memory/gctransform/test/test_framework.py 
b/pypy/rpython/memory/gctransform/test/test_framework.py
--- a/pypy/rpython/memory/gctransform/test/test_framework.py
+++ b/pypy/rpython/memory/gctransform/test/test_framework.py
@@ -2,6 +2,7 @@
 from pypy.annotation.model import SomeInteger
 from pypy.objspace.flow.model import Constant, SpaceOperation
 from pypy.rpython.lltypesystem import lltype, rffi
+from pypy.rpython.lltypesystem.lloperation import llop
 from pypy.rpython.memory.gc.semispace import SemiSpaceGC
 from pypy.rpython.memory.gctransform.framework import (CollectAnalyzer,
      find_initializing_stores, find_clean_setarrayitems)
@@ -96,6 +97,13 @@
     gg = graphof(t, g)
     assert CollectAnalyzer(t).analyze_direct_call(gg)
 
+def test_cancollect_some_operation():
+    def g():
+        llop.gc_set_extra_threshold(lltype.Void, 32)
+    t = rtype(g, [])
+    gg = graphof(t, g)
+    assert CollectAnalyzer(t).analyze_direct_call(gg)
+
 def test_no_collect():
     from pypy.rlib import rgc
     from pypy.translator.c.genc import CStandaloneBuilder
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to