[pypy-commit] pypy jitframe-on-heap: remove deprecated code

bivab noreply at buildbot.pypy.org
Tue Jan 29 15:16:32 CET 2013


Author: David Schneider <david.schneider at picle.org>
Branch: jitframe-on-heap
Changeset: r60681:a0f202829fbb
Date: 2013-01-29 14:53 +0100
http://bitbucket.org/pypy/pypy/changeset/a0f202829fbb/

Log:	remove deprecated code

diff --git a/rpython/jit/backend/arm/assembler.py b/rpython/jit/backend/arm/assembler.py
--- a/rpython/jit/backend/arm/assembler.py
+++ b/rpython/jit/backend/arm/assembler.py
@@ -118,6 +118,9 @@
         self.gcmap_for_finish = lltype.malloc(jitframe.GCMAP, 1, zero=True)
         self.gcmap_for_finish[0] = r_uint(1)
 
+    def setup_failure_recovery(self):
+        self.failure_recovery_code = [0, 0, 0, 0]
+
     def finish_once(self):
         if self._debug:
             debug_start('jit-backend-counts')
@@ -334,199 +337,6 @@
         rawstart = mc.materialize(self.cpu.asmmemmgr, [])
         self.wb_slowpath[withcards + 2 * withfloats] = rawstart
 
-    def setup_failure_recovery(self):
-
-        #@rgc.no_collect -- XXX still true, but hacked gc_set_extra_threshold
-        def failure_recovery_func(mem_loc, frame_pointer, stack_pointer):
-            """mem_loc is a structure in memory describing where the values for
-            the failargs are stored.  frame loc is the address of the frame
-            pointer for the frame to be decoded frame """
-            vfp_registers = rffi.cast(rffi.LONGP, stack_pointer)
-            registers = rffi.ptradd(vfp_registers, 2*len(r.all_vfp_regs))
-            registers = rffi.cast(rffi.LONGP, registers)
-            bytecode = rffi.cast(rffi.UCHARP, mem_loc)
-            return self.grab_frame_values(self.cpu, bytecode, frame_pointer,
-                                                    registers, vfp_registers)
-        self.failure_recovery_code = [0, 0, 0, 0]
-
-        self.failure_recovery_func = failure_recovery_func
-
-    _FAILURE_RECOVERY_FUNC = lltype.Ptr(lltype.FuncType([rffi.LONGP] * 3,
-                                                        llmemory.GCREF))
-
-    @staticmethod
-    #@rgc.no_collect -- XXX still true, but hacked gc_set_extra_threshold
-    def grab_frame_values(cpu, bytecode, frame_pointer,
-                                                registers, vfp_registers):
-        # no malloc allowed here!!  xxx apart from one, hacking a lot
-        force_index = rffi.cast(lltype.Signed, frame_pointer)
-        num = 0
-        deadframe = lltype.nullptr(jitframe.DEADFRAME)
-        # step 1: lots of mess just to count the final value of 'num'
-        bytecode1 = bytecode
-        while 1:
-            code = rffi.cast(lltype.Signed, bytecode1[0])
-            bytecode1 = rffi.ptradd(bytecode1, 1)
-            if code >= AssemblerARM.CODE_FROMSTACK:
-                while code > 0x7F:
-                    code = rffi.cast(lltype.Signed, bytecode1[0])
-                    bytecode1 = rffi.ptradd(bytecode1, 1)
-            else:
-                kind = code & 3
-                if kind == AssemblerARM.DESCR_SPECIAL:
-                    if code == AssemblerARM.CODE_HOLE:
-                        num += 1
-                        continue
-                    if code == AssemblerARM.CODE_INPUTARG:
-                        continue
-                    if code == AssemblerARM.CODE_FORCED:
-                        # resuming from a GUARD_NOT_FORCED
-                        token = force_index
-                        deadframe = (
-                            cpu.assembler.force_token_to_dead_frame.pop(token))
-                        deadframe = lltype.cast_opaque_ptr(
-                            jitframe.DEADFRAMEPTR, deadframe)
-                        continue
-                    assert code == AssemblerARM.CODE_STOP
-                    break
-            num += 1
-
-        # allocate the deadframe
-        if not deadframe:
-            # Remove the "reserve" at the end of the nursery.  This means
-            # that it is guaranteed that the following malloc() works
-            # without requiring a collect(), but it needs to be re-added
-            # as soon as possible.
-            cpu.gc_clear_extra_threshold()
-            assert num <= cpu.get_failargs_limit()
-            try:
-                deadframe = lltype.malloc(jitframe.DEADFRAME, num)
-            except MemoryError:
-                fatalerror("memory usage error in grab_frame_values")
-        # fill it
-        code_inputarg = False
-        num = 0
-        value_hi = 0
-        while 1:
-            # decode the next instruction from the bytecode
-            code = rffi.cast(lltype.Signed, bytecode[0])
-            bytecode = rffi.ptradd(bytecode, 1)
-            if code >= AssemblerARM.CODE_FROMSTACK:
-                if code > 0x7F:
-                    shift = 7
-                    code &= 0x7F
-                    while True:
-                        nextcode = rffi.cast(lltype.Signed, bytecode[0])
-                        bytecode = rffi.ptradd(bytecode, 1)
-                        code |= (nextcode & 0x7F) << shift
-                        shift += 7
-                        if nextcode <= 0x7F:
-                            break
-                # load the value from the stack
-                kind = code & 3
-                code = (code - AssemblerARM.CODE_FROMSTACK) >> 2
-                if code_inputarg:
-                    code = ~code
-                    code_inputarg = False
-                stackloc = force_index - get_fp_offset(int(code))
-                value = rffi.cast(rffi.LONGP, stackloc)[0]
-                if kind == AssemblerARM.DESCR_FLOAT:
-                    assert WORD == 4
-                    value_hi = value
-                    value = rffi.cast(rffi.LONGP, stackloc - WORD)[0]
-            else:
-                kind = code & 3
-                if kind == AssemblerARM.DESCR_SPECIAL:
-                    if code == AssemblerARM.CODE_HOLE:
-                        num += 1
-                        continue
-                    if code == AssemblerARM.CODE_INPUTARG:
-                        code_inputarg = True
-                        continue
-                    if code == AssemblerARM.CODE_FORCED:
-                        continue
-                    assert code == AssemblerARM.CODE_STOP
-                    break
-                # 'code' identifies a register: load its value
-                code >>= 2
-                if kind == AssemblerARM.DESCR_FLOAT:
-                    if WORD == 4:
-                        value = vfp_registers[2*code]
-                        value_hi = vfp_registers[2*code + 1]
-                    else:
-                        value = registers[code]
-                else:
-                    value = registers[code]
-            # store the loaded value into fail_boxes_<type>
-            if kind == AssemblerARM.DESCR_INT:
-                deadframe.jf_values[num].int = value
-            elif kind == AssemblerARM.DESCR_REF:
-                deadframe.jf_values[num].ref = rffi.cast(llmemory.GCREF, value)
-            elif kind == AssemblerARM.DESCR_FLOAT:
-                assert WORD == 4
-                assert not longlong.is_64_bit
-                floatvalue = rffi.cast(lltype.SignedLongLong, value_hi)
-                floatvalue <<= 32
-                floatvalue |= rffi.cast(lltype.SignedLongLong,
-                                        rffi.cast(lltype.Unsigned, value))
-                deadframe.jf_values[num].float = floatvalue
-            else:
-                assert 0, "bogus kind"
-            num += 1
-        #
-        assert num == len(deadframe.jf_values)
-        if not we_are_translated():
-            assert bytecode[4] == 0xCC
-        fail_index = rffi.cast(rffi.INTP, bytecode)[0]
-        fail_descr = cpu.get_fail_descr_from_number(fail_index)
-        deadframe.jf_descr = fail_descr.hide(cpu)
-        return lltype.cast_opaque_ptr(llmemory.GCREF, deadframe)
-
-    def decode_inputargs(self, code):
-        descr_to_box_type = [REF, INT, FLOAT]
-        bytecode = rffi.cast(rffi.UCHARP, code)
-        arglocs = []
-        code_inputarg = False
-        while 1:
-            # decode the next instruction from the bytecode
-            code = rffi.cast(lltype.Signed, bytecode[0])
-            bytecode = rffi.ptradd(bytecode, 1)
-            if code >= self.CODE_FROMSTACK:
-                # 'code' identifies a stack location
-                if code > 0x7F:
-                    shift = 7
-                    code &= 0x7F
-                    while True:
-                        nextcode = rffi.cast(lltype.Signed, bytecode[0])
-                        bytecode = rffi.ptradd(bytecode, 1)
-                        code |= (nextcode & 0x7F) << shift
-                        shift += 7
-                        if nextcode <= 0x7F:
-                            break
-                kind = code & 3
-                code = (code - self.CODE_FROMSTACK) >> 2
-                if code_inputarg:
-                    code = ~code
-                    code_inputarg = False
-                loc = ARMFrameManager.frame_pos(code, descr_to_box_type[kind])
-            elif code == self.CODE_STOP:
-                break
-            elif code == self.CODE_HOLE:
-                continue
-            elif code == self.CODE_INPUTARG:
-                code_inputarg = True
-                continue
-            else:
-                # 'code' identifies a register
-                kind = code & 3
-                code >>= 2
-                if kind == self.DESCR_FLOAT:
-                    loc = r.all_vfp_regs[code]
-                else:
-                    loc = r.all_regs[code]
-            arglocs.append(loc)
-        return arglocs[:]
-
     def _build_malloc_slowpath(self):
         mc = ARMv7Builder()
         if self.cpu.supports_floats:


More information about the pypy-commit mailing list