[pypy-commit] pypy arm-backend-2: move code a bit around to make things clearer

bivab noreply at buildbot.pypy.org
Thu Jan 26 10:45:24 CET 2012


Author: David Schneider <david.schneider at picle.org>
Branch: arm-backend-2
Changeset: r51779:2d0405522a48
Date: 2012-01-23 17:08 +0100
http://bitbucket.org/pypy/pypy/changeset/2d0405522a48/

Log:	move code a bit around to make things clearer

diff --git a/pypy/jit/backend/arm/assembler.py b/pypy/jit/backend/arm/assembler.py
--- a/pypy/jit/backend/arm/assembler.py
+++ b/pypy/jit/backend/arm/assembler.py
@@ -582,20 +582,21 @@
         regalloc = Regalloc(assembler=self, frame_manager=ARMFrameManager())
         regalloc.prepare_loop(inputargs, operations)
 
-        loop_head = self.mc.currpos()
+        loop_head = self.mc.get_relative_pos()
         looptoken._arm_loop_code = loop_head
-
+        #
         clt.frame_depth = -1
         frame_depth = self._assemble(operations, regalloc)
         clt.frame_depth = frame_depth
+        #
+        size_excluding_failure_stuff = self.mc.get_relative_pos()
+
         self._patch_sp_offset(sp_patch_location, frame_depth)
-
         self.write_pending_failure_recoveries()
 
         rawstart = self.materialize_loop(looptoken)
         looptoken._arm_func_addr = rawstart
 
-        size_excluding_failure_stuff = self.mc.get_relative_pos()
         self.process_pending_guards(rawstart)
         self.fixup_target_tokens(rawstart)
 
@@ -613,7 +614,6 @@
 
     def _assemble(self, operations, regalloc):
         regalloc.compute_hint_frame_locations(operations)
-        #self.mc.BKPT()
         self._walk_operations(operations, regalloc)
         frame_depth = regalloc.frame_manager.get_frame_depth()
         jump_target_descr = regalloc.jump_target_descr
@@ -637,12 +637,13 @@
         if not we_are_translated():
             assert len(inputargs) == len(arglocs)
 
-        startpos = self.mc.get_relative_pos()
         regalloc = Regalloc(assembler=self, frame_manager=ARMFrameManager())
         regalloc.prepare_bridge(inputargs, arglocs, operations)
 
         sp_patch_location = self._prepare_sp_patch_position()
 
+        startpos = self.mc.get_relative_pos()
+
         frame_depth = self._assemble(operations, regalloc)
 
         codeendpos = self.mc.get_relative_pos()
@@ -746,8 +747,6 @@
     def _patch_sp_offset(self, pos, frame_depth):
         cb = OverwritingBuilder(self.mc, pos,
                                 OverwritingBuilder.size_of_gen_load_int + WORD)
-        # Note: the frame_depth is one less than the value stored in the frame
-        # manager
         n = frame_depth * WORD
 
         # ensure the sp is 8 byte aligned when patching it


More information about the pypy-commit mailing list