[pypy-commit] pypy faster-nested-scopes: now that cells are part of the virtualizable, we need to init them with a list, not None

cfbolz noreply at buildbot.pypy.org
Sun Aug 28 12:39:34 CEST 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: faster-nested-scopes
Changeset: r46862:70cdda27e62d
Date: 2011-08-28 12:39 +0200
http://bitbucket.org/pypy/pypy/changeset/70cdda27e62d/

Log:	now that cells are part of the virtualizable, we need to init them
	with a list, not None

diff --git a/pypy/interpreter/nestedscope.py b/pypy/interpreter/nestedscope.py
--- a/pypy/interpreter/nestedscope.py
+++ b/pypy/interpreter/nestedscope.py
@@ -91,8 +91,6 @@
     #     variables coming from a parent function in which i'm nested
     # 'closure' is a list of Cell instances: the received free vars.
 
-    cells = None
-
     @jit.unroll_safe
     def initialize_frame_scopes(self, outer_func, code):
         super_initialize_frame_scopes(self, outer_func, code)
@@ -100,6 +98,7 @@
         nfreevars = len(code.co_freevars)
         if not nfreevars:
             if not ncellvars:
+                self.cells = []
                 return            # no self.cells needed - fast path
         elif outer_func is None:
             space = self.space


More information about the pypy-commit mailing list