[pypy-commit] pypy small-unroll-improvements: remove superfluous list

cfbolz noreply at buildbot.pypy.org
Mon Apr 14 09:58:52 CEST 2014


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: small-unroll-improvements
Changeset: r70628:d3bf324cae70
Date: 2014-04-13 13:32 +0200
http://bitbucket.org/pypy/pypy/changeset/d3bf324cae70/

Log:	remove superfluous list

diff --git a/rpython/jit/metainterp/optimizeopt/virtualstate.py b/rpython/jit/metainterp/optimizeopt/virtualstate.py
--- a/rpython/jit/metainterp/optimizeopt/virtualstate.py
+++ b/rpython/jit/metainterp/optimizeopt/virtualstate.py
@@ -406,8 +406,8 @@
     def _enum(self, virtual_state):
         if self.level == LEVEL_CONSTANT:
             return
-        self.position_in_notvirtuals = len(virtual_state.notvirtuals)
-        virtual_state.notvirtuals.append(self)
+        self.position_in_notvirtuals = virtual_state.numnotvirtuals
+        virtual_state.numnotvirtuals += 1
 
     def debug_print(self, indent, seen, bad, metainterp_sd=None):
         mark = ''
@@ -450,7 +450,7 @@
     def __init__(self, state):
         self.state = state
         self.info_counter = -1
-        self.notvirtuals = [] # FIXME: We dont need this list, only it's length
+        self.numnotvirtuals = 0
         for s in state:
             s.enum(self)
 
@@ -476,7 +476,7 @@
         if optimizer.optearlyforce:
             optimizer = optimizer.optearlyforce
         assert len(values) == len(self.state)
-        inputargs = [None] * len(self.notvirtuals)
+        inputargs = [None] * self.numnotvirtuals
 
         # We try twice. The first time around we allow boxes to be forced
         # which might change the virtual state if the box appear in more


More information about the pypy-commit mailing list