Author: Armin Rigo <[email protected]>
Branch: cleanup-llgraph-backend
Changeset: r58159:d25105a3ad76
Date: 2012-10-17 12:07 +0200
http://bitbucket.org/pypy/pypy/changeset/d25105a3ad76/

Log:    (fijal, arigo) in-progress

diff --git a/pypy/jit/backend/llgraph/runner.py 
b/pypy/jit/backend/llgraph/runner.py
--- a/pypy/jit/backend/llgraph/runner.py
+++ b/pypy/jit/backend/llgraph/runner.py
@@ -8,7 +8,7 @@
 from pypy.jit.codewriter import heaptracker
 
 from pypy.rpython.llinterp import LLInterpreter, LLException
-from pypy.rpython.lltypesystem import lltype, llmemory, rclass, rstr
+from pypy.rpython.lltypesystem import lltype, llmemory, rffi, rclass, rstr
 
 from pypy.rlib.rarithmetic import ovfcheck
 
@@ -199,10 +199,7 @@
 
     # ------------------------------------------------------------
 
-    def call(self, func, args, calldescr):
-        TP = llmemory.cast_int_to_adr(func).ptr._obj._TYPE
-        RESULT = TP.RESULT
-        func = llmemory.cast_int_to_adr(func).ptr._obj._callable
+    def call(self, func, args, RESULT, calldescr):
         try:
             res = func(*args)
             self.last_exception = None
@@ -218,7 +215,8 @@
     def _do_call(self, func, args_i, args_r, args_f, calldescr):
         TP = llmemory.cast_int_to_adr(func).ptr._obj._TYPE
         args = support.cast_call_args(TP.ARGS, args_i, args_r, args_f)
-        return self.call(func, args, calldescr)
+        func = llmemory.cast_int_to_adr(func).ptr._obj._callable
+        return self.call(func, args, TP.RESULT, calldescr)
 
     bh_call_i = _do_call
     bh_call_r = _do_call
@@ -453,6 +451,13 @@
         self.cpu.last_exception = None
         return support.cast_to_ptr(res)
 
+    def execute_guard_not_forced(self, descr):
+        pass     # XXX
+
+    def execute_guard_not_invalidated(self, descr):
+        if self.loop.invalid:
+            raise GuardFailed
+
     def execute_int_add_ovf(self, _, x, y):
         try:
             z = ovfcheck(x + y)
@@ -497,9 +502,18 @@
     def execute_jump(self, descr, *args):
         raise Jump(descr, args)
 
-    def execute_call(self, descr, *args):
-        call_args = support.cast_call_args_in_order(args[0], args[1:])
-        return self.cpu.call(args[0], call_args, descr)
+    def execute_call(self, descr, func, *args):
+        TP = llmemory.cast_int_to_adr(func).ptr._obj._TYPE
+        ARGS = TP.ARGS
+        call_args = support.cast_call_args_in_order(ARGS, args)
+        func = llmemory.cast_int_to_adr(func).ptr._obj._callable
+        return self.cpu.call(func, call_args, TP.RESULT, descr)
+
+    def execute_call_release_gil(self, descr, func, *args):
+        call_args = support.cast_call_args_in_order(descr.ARGS, args)
+        FUNC = lltype.FuncType(descr.ARGS, descr.RESULT)
+        func_to_call = rffi.cast(lltype.Ptr(FUNC), func)
+        return self.cpu.call(func_to_call, call_args, descr.RESULT, descr)
 
     def execute_same_as(self, _, x):
         return x
@@ -511,6 +525,9 @@
         descr = heaptracker.vtable2descr(self.cpu, vtable)
         return self.cpu.bh_new_with_vtable(vtable, descr)
 
+    def execute_force_token(self, _):
+        import py; py.test.skip("XXX")
+
 
 def _setup():
     def _make_impl_from_blackhole_interp(opname):
diff --git a/pypy/jit/backend/llgraph/support.py 
b/pypy/jit/backend/llgraph/support.py
--- a/pypy/jit/backend/llgraph/support.py
+++ b/pypy/jit/backend/llgraph/support.py
@@ -134,8 +134,7 @@
     assert list(argsiter_f) == []
     return args
 
-def cast_call_args_in_order(func, args):
-    ARGS = llmemory.cast_int_to_adr(func).ptr._obj._TYPE.ARGS
+def cast_call_args_in_order(ARGS, args):
     call_args = []
     for ARG, arg in zip(ARGS, args):
         kind = getkind(ARG)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to