[pypy-commit] pypy regalloc-playground: fix a comment, something is a bit fishy about save_all_regs which is sometimes

cfbolz pypy.commits at gmail.com
Fri Sep 1 13:45:20 EDT 2017


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: regalloc-playground
Changeset: r92301:e0a6917be0c6
Date: 2017-09-01 19:22 +0200
http://bitbucket.org/pypy/pypy/changeset/e0a6917be0c6/

Log:	fix a comment, something is a bit fishy about save_all_regs which is
	sometimes a bool, sometimes an int

diff --git a/rpython/jit/backend/llsupport/regalloc.py b/rpython/jit/backend/llsupport/regalloc.py
--- a/rpython/jit/backend/llsupport/regalloc.py
+++ b/rpython/jit/backend/llsupport/regalloc.py
@@ -412,7 +412,6 @@
         v_to_spill = self._pick_variable_to_spill(forbidden_vars,
                                selected_reg, need_lower_byte=need_lower_byte)
         loc = self.reg_bindings[v_to_spill]
-        self.assembler.num_spills += 1
         self._sync_var_to_stack(v_to_spill)
         del self.reg_bindings[v_to_spill]
         return loc
@@ -623,8 +622,8 @@
         valid, but only *if they are in self.save_around_call_regs,*
         not if they are callee-saved registers!
 
-        'save_all_regs' can be 0 (default set of registers), 1 (do that
-        for all registers), or 2 (default + gc ptrs).
+        'save_all_regs' can be 0 (default set of registers), 1 (default + gc
+        ptrs), or 2 (do that for all registers).
 
         Overview of what we do (the implementation does it differently,
         for the same result):
@@ -708,6 +707,7 @@
                     break
                 assert new_reg is not None # must succeed
                 reg = self.reg_bindings[v]
+                self.assembler.num_moves_calls += 1
                 self.assembler.regalloc_mov(reg, new_reg)
                 self.reg_bindings[v] = new_reg    # change the binding
                 new_free_regs.append(reg)
diff --git a/rpython/jit/backend/x86/regalloc.py b/rpython/jit/backend/x86/regalloc.py
--- a/rpython/jit/backend/x86/regalloc.py
+++ b/rpython/jit/backend/x86/regalloc.py
@@ -816,6 +816,7 @@
             # without distinguishing call sites, which we don't do any
             # more for now.
             if gcrootmap: # and gcrootmap.is_shadow_stack:
+                # YYY this is weird???
                 save_all_regs = 2
         self.rm.before_call(save_all_regs=save_all_regs)
         if op.type != 'v':


More information about the pypy-commit mailing list