Author: Carl Friedrich Bolz <[email protected]>
Branch: guard-compatible
Changeset: r83067:1b4c7fac81be
Date: 2016-03-15 10:11 +0100
http://bitbucket.org/pypy/pypy/changeset/1b4c7fac81be/
Log: remove two more promotes
diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -41,11 +41,14 @@
# objects with different maps can have the same class
return self.terminator.w_cls
+ @jit.elidable_compatible()
+ def _get_terminator(self):
+ return self.terminator
+
def read(self, obj, name, index):
attr = self.find_map_attr(name, index)
if attr is None:
- jit.promote(self)
- return self.terminator._read_terminator(obj, name, index)
+ return self._get_terminator()._read_terminator(obj, name, index)
if ( # XXX in the guard_compatible world the following isconstant may
never be true?
jit.isconstant(attr.storageindex) and
jit.isconstant(obj) and
@@ -62,9 +65,7 @@
def write(self, obj, name, index, w_value):
attr = self.find_map_attr(name, index)
if attr is None:
- # adding an attribute needs to know all attributes, thus promote
- jit.promote(self)
- return self.terminator._write_terminator(obj, name, index, w_value)
+ return self._get_terminator()._write_terminator(obj, name, index,
w_value)
if not attr.ever_mutated:
attr.ever_mutated = True
obj._mapdict_write_storage(attr.storageindex, w_value)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit