Commits

Maciej Fijalkowski committed 8c1f9de

enough to make one test pass, hooray!

  • Participants
  • Parent commits a94c9ca
  • Branches jitframe-on-heap

Comments (0)

Files changed (6)

File pypy/jit/backend/llgraph/runner.py

         except ExecutionFinished, e:
             return e.deadframe
 
-    def get_latest_value_int(self, deadframe, index):
+    def get_int_value(self, deadframe, index):
         v = deadframe._values[index]
         assert lltype.typeOf(v) == lltype.Signed
         return v
 
-    def get_latest_value_ref(self, deadframe, index):
+    def get_ref_value(self, deadframe, index):
         v = deadframe._values[index]
         assert lltype.typeOf(v) == llmemory.GCREF
         return v
 
-    def get_latest_value_float(self, deadframe, index):
+    def get_float_value(self, deadframe, index):
         v = deadframe._values[index]
         assert lltype.typeOf(v) == longlong.FLOATSTORAGE
         return v
     def get_latest_descr(self, deadframe):
         return deadframe._latest_descr
 
-    def get_latest_value_count(self, deadframe):
-        return len(deadframe._values)
-
     def grab_exc_value(self, deadframe):
         if deadframe._last_exception is not None:
             result = deadframe._last_exception.args[1]
         failindex = self.cpu.get_fail_descr_number(faildescr)
         if failindex == self.cpu.done_with_this_frame_int_v:
             reset_vable(jd, vable)
-            return self.cpu.get_latest_value_int(pframe, 0)
+            return self.cpu.get_int_value(pframe, 0)
         if failindex == self.cpu.done_with_this_frame_ref_v:
             reset_vable(jd, vable)
-            return self.cpu.get_latest_value_ref(pframe, 0)
+            return self.cpu.get_ref_value(pframe, 0)
         if failindex == self.cpu.done_with_this_frame_float_v:
             reset_vable(jd, vable)
-            return self.cpu.get_latest_value_float(pframe, 0)
+            return self.cpu.get_float_value(pframe, 0)
         if failindex == self.cpu.done_with_this_frame_void_v:
             reset_vable(jd, vable)
             return None

File pypy/jit/backend/llsupport/llmodel.py

                                                       abiname)
 
     def get_latest_descr(self, deadframe):
-        deadframe = lltype.cast_opaque_ptr(jitframe.JITFRAMEPTR, deadframe)
         descr = deadframe.jf_descr
         return history.AbstractDescr.show(self, descr)
 
-    def get_latest_value_int(self, deadframe, index):
-        XXX
-        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
-        return deadframe.jf_values[index].int
+    def get_int_value(self, deadframe, index):
+        return deadframe.jf_frame[index // WORD]
 
-    def get_latest_value_ref(self, deadframe, index):
+    def get_ref_value(self, deadframe, index):
         XXX
         deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
         return deadframe.jf_values[index].ref
 
-    def get_latest_value_float(self, deadframe, index):
+    def get_float_value(self, deadframe, index):
         XXX
         deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
         return deadframe.jf_values[index].float
 
-    def get_latest_value_count(self, deadframe):
-        XXX
-        deadframe = lltype.cast_opaque_ptr(jitframe.DEADFRAMEPTR, deadframe)
-        return len(deadframe.jf_values)
+    def set_int_value(self, newframe, index, value):
+        """ Note that we keep index multiplied by WORD here mostly
+        for completeness with get_int_value and friends
+        """
+        newframe.jf_frame[index // WORD] = value
+
+    def set_ref_value(self, deadframe, index, value):
+        xxx
+
+    def set_float_value(self, deadframe, index, value):
+        xxx
 
     # ____________________________________________________________
 

File pypy/jit/backend/model.py

         """Returns the Descr for the last operation executed by the frame."""
         raise NotImplementedError
 
-    def get_latest_value_int(self, deadframe, index):
+    def get_int_value(self, deadframe, index):
         """Returns the value for the index'th argument to the
         last executed operation (from 'fail_args' if it was a guard,
         or from 'args' if it was a FINISH).  Returns an int."""
         raise NotImplementedError
 
-    def get_latest_value_float(self, deadframe, index):
+    def get_float_value(self, deadframe, index):
         """Returns the value for the index'th argument to the
         last executed operation (from 'fail_args' if it was a guard,
         or from 'args' if it was a FINISH).  Returns a FLOATSTORAGE."""
         raise NotImplementedError
 
-    def get_latest_value_ref(self, deadframe, index):
+    def get_ref_value(self, deadframe, index):
         """Returns the value for the index'th argument to the
         last executed operation (from 'fail_args' if it was a guard,
         or from 'args' if it was a FINISH).  Returns a GCREF."""
         raise NotImplementedError
 
-    def get_latest_value_count(self, deadframe):
-        """Return how many values are ready to be returned by
-        get_latest_value_xxx().  Only after a guard failure; not
-        necessarily correct after a FINISH."""
-        raise NotImplementedError
-
     def grab_exc_value(self, deadframe):
         """Return the exception set by the latest execute_token(),
         when it exits due to a failure of a GUARD_EXCEPTION or

File pypy/jit/backend/test/runner_test.py

         else:
             self.guard_failed = True
         if result_type == 'int':
-            return BoxInt(self.cpu.get_latest_value_int(deadframe, 0))
+            return BoxInt(self.cpu.get_int_value(deadframe, 0))
         elif result_type == 'ref':
-            return BoxPtr(self.cpu.get_latest_value_ref(deadframe, 0))
+            return BoxPtr(self.cpu.get_ref_value(deadframe, 0))
         elif result_type == 'float':
-            return BoxFloat(self.cpu.get_latest_value_float(deadframe, 0))
+            return BoxFloat(self.cpu.get_float_value(deadframe, 0))
         elif result_type == 'void':
             return None
         else:
 
     avoid_instances = False
 
+    def find_pos_on_faildescr(self, fail):
+        # overloaded by backends
+        return 0
+
     def test_compile_linear_loop(self):
         i0 = BoxInt()
         i1 = BoxInt()
         self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe,
+                                            self.find_pos_on_faildescr(fail))
         assert res == 3
         assert fail.identifier == 1
 
         self.cpu.compile_loop(inputargs, operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken,
                                            longlong.getfloatstorage(2.8))
-        res = self.cpu.get_latest_value_float(deadframe, 0)
+        res = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(res) == 5.1
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 1
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 10
 
     def test_compile_with_holes_in_fail_args(self):
         deadframe = self.cpu.execute_token(looptoken, 44)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_int(deadframe, 2)
+        res = self.cpu.get_int_value(deadframe, 2)
         assert res == 10
 
     def test_backends_dont_keep_loops_alive(self):
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 20
 
         assert self.cpu.total_compiled_loops == 1
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 20
 
     def test_compile_big_bridge_out_of_small_loop(self):
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 3
         for i in range(1000):
-            res = self.cpu.get_latest_value_int(deadframe, i)
+            res = self.cpu.get_int_value(deadframe, i)
             assert res == 2 + i
 
-    def test_get_latest_value_count(self):
-        i0 = BoxInt()
-        i1 = BoxInt()
-        i2 = BoxInt()
-        faildescr1 = BasicFailDescr(1)
-        looptoken = JitCellToken()
-        targettoken = TargetToken()
-        operations = [
-            ResOperation(rop.LABEL, [i0], None, descr=targettoken),
-            ResOperation(rop.INT_ADD, [i0, ConstInt(1)], i1),
-            ResOperation(rop.INT_LE, [i1, ConstInt(9)], i2),
-            ResOperation(rop.GUARD_TRUE, [i2], None, descr=faildescr1),
-            ResOperation(rop.JUMP, [i1], None, descr=targettoken),
-            ]
-        inputargs = [i0]
-        operations[3].setfailargs([None, i1, None])
-        self.cpu.compile_loop(inputargs, operations, looptoken)
-
-        deadframe = self.cpu.execute_token(looptoken, 2)
-        fail = self.cpu.get_latest_descr(deadframe)
-        assert fail is faildescr1
-
-        count = self.cpu.get_latest_value_count(deadframe)
-        assert count == 3
-        assert self.cpu.get_latest_value_int(deadframe, 1) == 10
-        # multiple reads ok
-        assert self.cpu.get_latest_value_int(deadframe, 1) == 10
-
     def test_finish(self):
         i0 = BoxInt()
         class UntouchableFailDescr(AbstractFailDescr):
         deadframe = self.cpu.execute_token(looptoken, 99)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 99
 
         looptoken = JitCellToken()
         deadframe = self.cpu.execute_token(looptoken)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 42
 
         looptoken = JitCellToken()
             deadframe = self.cpu.execute_token(looptoken, value)
             fail = self.cpu.get_latest_descr(deadframe)
             assert fail is faildescr
-            res = self.cpu.get_latest_value_float(deadframe, 0)
+            res = self.cpu.get_float_value(deadframe, 0)
             assert longlong.getrealfloat(res) == -61.25
 
             looptoken = JitCellToken()
             deadframe = self.cpu.execute_token(looptoken)
             fail = self.cpu.get_latest_descr(deadframe)
             assert fail is faildescr
-            res = self.cpu.get_latest_value_float(deadframe, 0)
+            res = self.cpu.get_float_value(deadframe, 0)
             assert longlong.getrealfloat(res) == 42.5
 
     def test_execute_operations_in_env(self):
         operations[-2].setfailargs([t, z])
         cpu.compile_loop([x, y], operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 0, 10)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 0
-        assert self.cpu.get_latest_value_int(deadframe, 1) == 55
+        assert self.cpu.get_int_value(deadframe, 0) == 0
+        assert self.cpu.get_int_value(deadframe, 1) == 55
 
     def test_int_operations(self):
         from pypy.jit.metainterp.test.test_executor import get_int_tests
                 else:
                     assert fail.identifier == 2
                 if z != boom:
-                    assert self.cpu.get_latest_value_int(deadframe, 0) == z
+                    assert self.cpu.get_int_value(deadframe, 0) == z
                 excvalue = self.cpu.grab_exc_value(deadframe)
                 assert not excvalue
 
             #
             for k in range(len(retvalues)):
                 if isinstance(retboxes[k], BoxInt):
-                    got = self.cpu.get_latest_value_int(deadframe, k)
+                    got = self.cpu.get_int_value(deadframe, k)
                 else:
-                    got = self.cpu.get_latest_value_float(deadframe, k)
+                    got = self.cpu.get_float_value(deadframe, k)
                 assert got == retvalues[k]
 
     def test_jump(self):
             dstvalues[index_counter] = 0
             for i, (box, val) in enumerate(zip(inputargs, dstvalues)):
                 if isinstance(box, BoxInt):
-                    got = self.cpu.get_latest_value_int(deadframe, i)
+                    got = self.cpu.get_int_value(deadframe, i)
                 elif isinstance(box, BoxPtr):
-                    got = self.cpu.get_latest_value_ref(deadframe, i)
+                    got = self.cpu.get_ref_value(deadframe, i)
                 elif isinstance(box, BoxFloat):
-                    got = self.cpu.get_latest_value_float(deadframe, i)
+                    got = self.cpu.get_float_value(deadframe, i)
                 else:
                     assert 0
                 assert type(got) == type(val)
         deadframe = self.cpu.execute_token(looptoken, *args)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_float(deadframe, 0)
+        res = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(res) == 8.5
         for i in range(1, len(fboxes)):
-            got = longlong.getrealfloat(self.cpu.get_latest_value_float(
+            got = longlong.getrealfloat(self.cpu.get_float_value(
                 deadframe, i))
             assert got == 13.5 + 6.73 * i
 
         deadframe = self.cpu.execute_token(looptoken, *args)  #xxx check
         fail = self.cpu.get_latest_descr(deadframe)
         assert loop.operations[-2].getdescr() == fail
-        f1 = self.cpu.get_latest_value_float(deadframe, 0)
-        f2 = self.cpu.get_latest_value_float(deadframe, 1)
-        f3 = self.cpu.get_latest_value_float(deadframe, 2)
+        f1 = self.cpu.get_float_value(deadframe, 0)
+        f2 = self.cpu.get_float_value(deadframe, 1)
+        f3 = self.cpu.get_float_value(deadframe, 2)
         assert longlong.getrealfloat(f1) == 132.25
         assert longlong.getrealfloat(f2) == 0.75
         assert longlong.getrealfloat(f3) == 133.0
         deadframe = self.cpu.execute_token(looptoken, *args)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 100
-        f1 = self.cpu.get_latest_value_float(deadframe, 0)
-        f2 = self.cpu.get_latest_value_float(deadframe, 1)
-        f3 = self.cpu.get_latest_value_float(deadframe, 2)
+        f1 = self.cpu.get_float_value(deadframe, 0)
+        f2 = self.cpu.get_float_value(deadframe, 1)
+        f3 = self.cpu.get_float_value(deadframe, 2)
         assert longlong.getrealfloat(f1) == 132.25
         assert longlong.getrealfloat(f2) == 0.75
         assert longlong.getrealfloat(f3) == 133.0
         looptoken = JitCellToken()
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 0
-        assert self.cpu.get_latest_value_ref(deadframe, 1) == xptr
+        assert self.cpu.get_int_value(deadframe, 0) == 0
+        assert self.cpu.get_ref_value(deadframe, 1) == xptr
         excvalue = self.cpu.grab_exc_value(deadframe)
         assert not excvalue
         deadframe = self.cpu.execute_token(looptoken, 0)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
+        assert self.cpu.get_int_value(deadframe, 0) == 1
         excvalue = self.cpu.grab_exc_value(deadframe)
         assert not excvalue
 
         looptoken = JitCellToken()
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
+        assert self.cpu.get_int_value(deadframe, 0) == 1
         excvalue = self.cpu.grab_exc_value(deadframe)
         assert excvalue == yptr
 
         looptoken = JitCellToken()
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         deadframe = self.cpu.execute_token(looptoken, 1)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
+        assert self.cpu.get_int_value(deadframe, 0) == 1
         excvalue = self.cpu.grab_exc_value(deadframe)
         assert excvalue == xptr
         deadframe = self.cpu.execute_token(looptoken, 0)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 0
+        assert self.cpu.get_int_value(deadframe, 0) == 0
         excvalue = self.cpu.grab_exc_value(deadframe)
         assert not excvalue
 
             if flag:
                 deadframe = self.cpu.force(token)
                 values.append(self.cpu.get_latest_descr(deadframe))
-                values.append(self.cpu.get_latest_value_int(deadframe, 0))
-                values.append(self.cpu.get_latest_value_int(deadframe, 1))
+                values.append(self.cpu.get_int_value(deadframe, 0))
+                values.append(self.cpu.get_int_value(deadframe, 1))
                 self.cpu.set_savedata_ref(deadframe, random_gcref)
 
         FUNC = self.FuncType([lltype.Signed, lltype.Signed], lltype.Void)
         deadframe = self.cpu.execute_token(looptoken, 20, 0)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 20
+        assert self.cpu.get_int_value(deadframe, 0) == 20
         assert values == []
 
         deadframe = self.cpu.execute_token(looptoken, 10, 1)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 1
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
-        assert self.cpu.get_latest_value_int(deadframe, 1) == 10
+        assert self.cpu.get_int_value(deadframe, 0) == 1
+        assert self.cpu.get_int_value(deadframe, 1) == 10
         assert values == [faildescr, 1, 10]
         assert self.cpu.get_savedata_ref(deadframe)   # not NULL
         assert self.cpu.get_savedata_ref(deadframe) == random_gcref
         def maybe_force(token, flag):
             if flag:
                 deadframe = self.cpu.force(token)
-                values.append(self.cpu.get_latest_value_int(deadframe, 0))
-                values.append(self.cpu.get_latest_value_int(deadframe, 2))
+                values.append(self.cpu.get_int_value(deadframe, 0))
+                values.append(self.cpu.get_int_value(deadframe, 2))
                 self.cpu.set_savedata_ref(deadframe, random_gcref)
             return 42
 
         deadframe = self.cpu.execute_token(looptoken, 20, 0)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 42
+        assert self.cpu.get_int_value(deadframe, 0) == 42
         assert values == []
 
         deadframe = self.cpu.execute_token(looptoken, 10, 1)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 1
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
-        assert self.cpu.get_latest_value_int(deadframe, 1) == 42
-        assert self.cpu.get_latest_value_int(deadframe, 2) == 10
+        assert self.cpu.get_int_value(deadframe, 0) == 1
+        assert self.cpu.get_int_value(deadframe, 1) == 42
+        assert self.cpu.get_int_value(deadframe, 2) == 10
         assert values == [1, 10]
         assert self.cpu.get_savedata_ref(deadframe) == random_gcref
 
         def maybe_force(token, flag):
             if flag:
                 deadframe = self.cpu.force(token)
-                values.append(self.cpu.get_latest_value_int(deadframe, 0))
-                values.append(self.cpu.get_latest_value_int(deadframe, 2))
+                values.append(self.cpu.get_int_value(deadframe, 0))
+                values.append(self.cpu.get_int_value(deadframe, 2))
                 self.cpu.set_savedata_ref(deadframe, random_gcref)
             return 42.5
 
         deadframe = self.cpu.execute_token(looptoken, 20, 0)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 42.5
         assert values == []
 
         deadframe = self.cpu.execute_token(looptoken, 10, 1)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 1
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 1
-        x = self.cpu.get_latest_value_float(deadframe, 1)
+        assert self.cpu.get_int_value(deadframe, 0) == 1
+        x = self.cpu.get_float_value(deadframe, 1)
         assert longlong.getrealfloat(x) == 42.5
-        assert self.cpu.get_latest_value_int(deadframe, 2) == 10
+        assert self.cpu.get_int_value(deadframe, 2) == 10
         assert values == [1, 10]
         assert self.cpu.get_savedata_ref(deadframe) == random_gcref
 
         deadframe = self.cpu.execute_token(looptoken, ord('G'))
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        assert self.cpu.get_latest_value_int(deadframe, 0) == ord('g')
+        assert self.cpu.get_int_value(deadframe, 0) == ord('g')
 
     def test_call_to_c_function_with_callback(self):
         from pypy.rlib.libffi import CDLL, types, ArgChain, clibffi
         deadframe = self.cpu.execute_token(looptoken, *args)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        assert self.cpu.get_latest_value_int(deadframe, 0) == len(cwd)
+        assert self.cpu.get_int_value(deadframe, 0) == len(cwd)
         assert rffi.charp2strn(buffer, buflen) == cwd
         lltype.free(buffer, flavor='raw')
 
         deadframe = self.cpu.execute_token(looptoken, -42, 9)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 0
-        assert self.cpu.get_latest_value_int(deadframe, 0) == -42
+        assert self.cpu.get_int_value(deadframe, 0) == -42
         print 'step 1 ok'
         print '-'*79
 
         deadframe = self.cpu.execute_token(looptoken, -42, 9)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail is faildescr
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 9
+        assert self.cpu.get_int_value(deadframe, 0) == 9
         print 'step 2 ok'
         print '-'*79
 
         deadframe = self.cpu.execute_token(looptoken, -42, 9)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 3
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 9
+        assert self.cpu.get_int_value(deadframe, 0) == 9
         print 'step 3 ok'
         print '-'*79
 
         deadframe = self.cpu.execute_token(looptoken, 16)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 3
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 333
+        assert self.cpu.get_int_value(deadframe, 0) == 333
 
     # pure do_ / descr features
 
     def test_assembler_call(self):
         called = []
         def assembler_helper(deadframe, virtualizable):
-            assert self.cpu.get_latest_value_int(deadframe, 0) == 97
+            assert self.cpu.get_int_value(deadframe, 0) == 97
             called.append(self.cpu.get_latest_descr(deadframe))
             return 4 + 9
 
             EffectInfo.MOST_GENERAL)
         args = [i+1 for i in range(10)]
         deadframe = self.cpu.execute_token(looptoken, *args)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 55
+        assert self.cpu.get_int_value(deadframe, 0) == 55
         ops = '''
         [i0, i1, i2, i3, i4, i5, i6, i7, i8, i9]
         i10 = int_add(i0, 42)
         self.cpu.compile_loop(loop.inputargs, loop.operations, othertoken)
         args = [i+1 for i in range(10)]
         deadframe = self.cpu.execute_token(othertoken, *args)
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 13
+        assert self.cpu.get_int_value(deadframe, 0) == 13
         assert called == [finish_descr]
 
         # test the fast path, which should not call assembler_helper()
             self.cpu.compile_loop(loop.inputargs, loop.operations, othertoken)
             args = [i+1 for i in range(10)]
             deadframe = self.cpu.execute_token(othertoken, *args)
-            assert self.cpu.get_latest_value_int(deadframe, 0) == 97
+            assert self.cpu.get_int_value(deadframe, 0) == 97
             assert not called
         finally:
             del self.cpu.done_with_this_frame_int_v
             py.test.skip("requires floats")
         called = []
         def assembler_helper(deadframe, virtualizable):
-            x = self.cpu.get_latest_value_float(deadframe, 0)
+            x = self.cpu.get_float_value(deadframe, 0)
             assert longlong.getrealfloat(x) == 1.2 + 3.2
             called.append(self.cpu.get_latest_descr(deadframe))
             print '!' * 30 + 'assembler_helper'
         args = [longlong.getfloatstorage(1.2),
                 longlong.getfloatstorage(2.3)]
         deadframe = self.cpu.execute_token(looptoken, *args)
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 1.2 + 2.3
         ops = '''
         [f4, f5]
         args = [longlong.getfloatstorage(1.2),
                 longlong.getfloatstorage(3.2)]
         deadframe = self.cpu.execute_token(othertoken, *args)
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 13.5
         assert called == [finish_descr]
 
             args = [longlong.getfloatstorage(1.2),
                     longlong.getfloatstorage(4.2)]
             deadframe = self.cpu.execute_token(othertoken, *args)
-            x = self.cpu.get_latest_value_float(deadframe, 0)
+            x = self.cpu.get_float_value(deadframe, 0)
             assert longlong.getrealfloat(x) == 1.2 + 4.2
             assert not called
         finally:
             py.test.skip("requires floats")
         called = []
         def assembler_helper(deadframe, virtualizable):
-            x = self.cpu.get_latest_value_float(deadframe, 0)
+            x = self.cpu.get_float_value(deadframe, 0)
             assert longlong.getrealfloat(x) == 1.25 + 3.25
             called.append(self.cpu.get_latest_descr(deadframe))
             return 13.5
         args = [longlong.getfloatstorage(1.25),
                 longlong.getfloatstorage(2.35)]
         deadframe = self.cpu.execute_token(looptoken, *args)
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 1.25 + 2.35
         assert not called
 
         args = [longlong.getfloatstorage(1.25),
                 longlong.getfloatstorage(3.25)]
         deadframe = self.cpu.execute_token(othertoken, *args)
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 13.5
         assert called == [finish_descr]
         del called[:]
         args = [longlong.getfloatstorage(6.0),
                 longlong.getfloatstorage(1.5)]         # 6.0-1.5 == 1.25+3.25
         deadframe = self.cpu.execute_token(othertoken, *args)
-        x = self.cpu.get_latest_value_float(deadframe, 0)
+        x = self.cpu.get_float_value(deadframe, 0)
         assert longlong.getrealfloat(x) == 13.5
         assert called == [finish_descr2]
 
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 2
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == 10
 
         inputargs2 = [i0]
         deadframe = self.cpu.execute_token(looptoken, 2)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 3
-        res = self.cpu.get_latest_value_int(deadframe, 0)
+        res = self.cpu.get_int_value(deadframe, 0)
         assert res == -10
 
     def test_int_force_ge_zero(self):
         self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
         for inp, outp in [(2,2), (-3, 0)]:
             deadframe = self.cpu.execute_token(looptoken, inp)
-            assert outp == self.cpu.get_latest_value_int(deadframe, 0)
+            assert outp == self.cpu.get_int_value(deadframe, 0)
 
     def test_compile_asmlen(self):
         from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU
             self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             deadframe = self.cpu.execute_token(looptoken,
                                                rffi.cast(lltype.Signed, p), 16)
-            result = self.cpu.get_latest_value_int(deadframe, 0)
+            result = self.cpu.get_int_value(deadframe, 0)
             assert result == rffi.cast(lltype.Signed, value)
             rawstorage.free_raw_storage(p)
 
             self.cpu.compile_loop(loop.inputargs, loop.operations, looptoken)
             deadframe = self.cpu.execute_token(looptoken,
                                                rffi.cast(lltype.Signed, p), 16)
-            result = self.cpu.get_latest_value_float(deadframe, 0)
+            result = self.cpu.get_float_value(deadframe, 0)
             result = longlong.getrealfloat(result)
             assert result == rffi.cast(lltype.Float, value)
             rawstorage.free_raw_storage(p)
         values = []
         def maybe_force(token, flag):
             deadframe = self.cpu.force(token)
-            values.append(self.cpu.get_latest_value_int(deadframe, 0))
+            values.append(self.cpu.get_int_value(deadframe, 0))
             return 42
 
         FUNC = self.FuncType([lltype.Signed, lltype.Signed], lltype.Signed)
         deadframe = self.cpu.execute_token(looptoken, 20, 0)
         fail = self.cpu.get_latest_descr(deadframe)
         assert fail.identifier == 23
-        assert self.cpu.get_latest_value_int(deadframe, 0) == 42
+        assert self.cpu.get_int_value(deadframe, 0) == 42
         # make sure that force reads the registers from a zeroed piece of
         # memory
         assert values[0] == 0

File pypy/jit/backend/x86/runner.py

 from pypy.jit.backend.llsupport.llmodel import AbstractLLCPU
 from pypy.jit.backend.llsupport import jitframe
 from pypy.jit.backend.x86 import regloc
+from pypy.jit.backend.llsupport.symbolic import WORD
 import sys
 
 from pypy.tool.ansi_print import ansi_log
                 prev_interpreter = LLInterpreter.current_interpreter
                 LLInterpreter.current_interpreter = self.debug_ll_interpreter
             try:
-                # XXX parameters
+                # XXX RPythonize
+                num = 0
+                for arg in args:
+                    if isinstance(arg, int):
+                        self.set_int_value(frame, num, arg)
+                    else:
+                        xxx
+                    num += WORD
                 descr_no = func(ll_frame)
             finally:
                 if not self.translate_support_code:
             #llop.debug_print(lltype.Void, "<<<< Back")
             descr = self.get_fail_descr_from_number(descr_no)
             frame.jf_descr = cast_instance_to_gcref(descr)
-            return ll_frame
+            return frame
         return execute_token
 
     def cast_ptr_to_int(x):

File pypy/jit/backend/x86/test/test_runner.py

     # for the individual tests see
     # ====> ../../test/runner_test.py
 
+    def find_pos_on_faildescr(self, descr):
+        return descr._x86_result_offset
+
     add_loop_instructions = ['mov', 'add', 'test', 'je', 'jmp']
     if WORD == 4:
         bridge_loop_instructions = ['lea', 'jmp']