Author: Remi Meier <remi.me...@gmail.com>
Branch: fix-longevity
Changeset: r82502:3271c1578a13
Date: 2016-02-25 14:34 +0100
http://bitbucket.org/pypy/pypy/changeset/3271c1578a13/

Log:    (plan_rich,remi) faster update_free_registers

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
@@ -317,7 +317,6 @@
             return self.get_free_register(var, callee=False, target_reg=None)
 
     def update_free_registers(self, regs_in_use):
-        # XXX: slow?
         self._reinit_free_regs()
         for r in regs_in_use:
             self.remove_free_register(r)
@@ -342,17 +341,18 @@
                reg in self.free_caller_regs
 
     def _reinit_free_regs(self):
-        self.free_callee_regs = [reg for reg in self.all_regs
-                                 if reg not in self.save_around_call_regs]
+        self.free_callee_regs = self.save_in_callee_regs[:]
         self.free_caller_regs = self.save_around_call_regs[:]
 
     def _change_regs(self, all_regs, save_around_call_regs):
         self.all_regs = all_regs
         self.save_around_call_regs = save_around_call_regs
+        self.save_in_callee_regs = [reg for reg in all_regs
+                                    if reg not in save_around_call_regs]
         self._reinit_free_regs()
         self.is_callee_lookup = [True] * max(
             [r.value + 1 for r in self.all_regs])
-        for reg in save_around_call_regs:
+        for reg in self.save_around_call_regs:
             self.is_callee_lookup[reg.value] = False
 
     def __init__(self, live_ranges, frame_manager=None, assembler=None):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to