[pypy-svn] pypy out-of-line-guards: A small hack to avoid relying on inlining for effect analyzis
fijal
commits-noreply at bitbucket.org
Sun Jan 2 19:39:18 CET 2011
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: out-of-line-guards
Changeset: r40330:c4c28ff0e843
Date: 2011-01-02 20:38 +0200
http://bitbucket.org/pypy/pypy/changeset/c4c28ff0e843/
Log: A small hack to avoid relying on inlining for effect analyzis
diff --git a/pypy/objspace/std/celldict.py b/pypy/objspace/std/celldict.py
--- a/pypy/objspace/std/celldict.py
+++ b/pypy/objspace/std/celldict.py
@@ -10,9 +10,6 @@
class ModuleCell(object):
_jit_invariant_fields_ = ['w_value']
- def __init__(self, w_value=None):
- self.w_value = w_value
-
def invalidate(self):
w_value = self.w_value
self.w_value = None
@@ -39,8 +36,10 @@
res = self.content.get(key, None)
if res is not None:
return res
- result = self.content[key] = ModuleCell()
- return result
+ cell = ModuleCell()
+ cell.w_value = None
+ self.content[key] = cell
+ return cell
def impl_setitem(self, w_key, w_value):
space = self.space
More information about the Pypy-commit
mailing list