[pypy-svn] r72373 - in pypy/trunk/pypy: annotation rpython rpython/lltypesystem rpython/memory rpython/ootypesystem translator translator/c
arigo at codespeak.net
arigo at codespeak.net
Thu Mar 18 14:42:10 CET 2010
Author: arigo
Date: Thu Mar 18 14:42:08 2010
New Revision: 72373
Modified:
pypy/trunk/pypy/annotation/bookkeeper.py
pypy/trunk/pypy/annotation/model.py
pypy/trunk/pypy/rpython/lltypesystem/rclass.py
pypy/trunk/pypy/rpython/memory/gctypelayout.py
pypy/trunk/pypy/rpython/ootypesystem/rclass.py
pypy/trunk/pypy/rpython/rclass.py
pypy/trunk/pypy/translator/c/database.py
pypy/trunk/pypy/translator/c/funcgen.py
pypy/trunk/pypy/translator/geninterplevel.py
Log:
Rename some of the instances attributes that now contain an identity_dict
rather than a plain dict. Might be useful in catching unexpected usage
of these attributes.
Modified: pypy/trunk/pypy/annotation/bookkeeper.py
==============================================================================
--- pypy/trunk/pypy/annotation/bookkeeper.py (original)
+++ pypy/trunk/pypy/annotation/bookkeeper.py Thu Mar 18 14:42:08 2010
@@ -175,7 +175,7 @@
self.stats = Stats(self)
# used in SomeObject.__new__ for keeping debugging info
- self._someobject_coming_from = identity_dict()
+ self._isomeobject_coming_from = identity_dict()
delayed_imports()
Modified: pypy/trunk/pypy/annotation/model.py
==============================================================================
--- pypy/trunk/pypy/annotation/model.py (original)
+++ pypy/trunk/pypy/annotation/model.py Thu Mar 18 14:42:08 2010
@@ -127,26 +127,26 @@
except AttributeError:
pass
else:
- bookkeeper._someobject_coming_from[self] = position_key, None
+ bookkeeper._isomeobject_coming_from[self] = position_key, None
return self
def origin(self):
bookkeeper = pypy.annotation.bookkeeper.getbookkeeper()
if bookkeeper is None:
return None
- return bookkeeper._someobject_coming_from.get(self, (None, None))[0]
+ return bookkeeper._isomeobject_coming_from.get(self, (None, None))[0]
origin = property(origin)
def caused_by_merge(self):
bookkeeper = pypy.annotation.bookkeeper.getbookkeeper()
if bookkeeper is None:
return None
- return bookkeeper._someobject_coming_from.get(self, (None, None))[1]
+ return bookkeeper._isomeobject_coming_from.get(self, (None, None))[1]
def set_caused_by_merge(self, nvalue):
bookkeeper = pypy.annotation.bookkeeper.getbookkeeper()
if bookkeeper is None:
return
- bookkeeper._someobject_coming_from[self] = self.origin, nvalue
+ bookkeeper._isomeobject_coming_from[self] = self.origin, nvalue
caused_by_merge = property(caused_by_merge, set_caused_by_merge)
del set_caused_by_merge
Modified: pypy/trunk/pypy/rpython/lltypesystem/rclass.py
==============================================================================
--- pypy/trunk/pypy/rpython/lltypesystem/rclass.py (original)
+++ pypy/trunk/pypy/rpython/lltypesystem/rclass.py Thu Mar 18 14:42:08 2010
@@ -311,7 +311,7 @@
ForwardRef = lltype.FORWARDREF_BY_FLAVOR[LLFLAVOR[gcflavor]]
self.object_type = ForwardRef()
- self.prebuiltinstances = identity_dict()
+ self.iprebuiltinstances = identity_dict()
self.lowleveltype = Ptr(self.object_type)
self.gcflavor = gcflavor
Modified: pypy/trunk/pypy/rpython/memory/gctypelayout.py
==============================================================================
--- pypy/trunk/pypy/rpython/memory/gctypelayout.py (original)
+++ pypy/trunk/pypy/rpython/memory/gctypelayout.py Thu Mar 18 14:42:08 2010
@@ -183,7 +183,7 @@
self.lltype2vtable = lltype2vtable
self.make_type_info_group()
self.id_of_type = {} # {LLTYPE: type_id}
- self.seen_roots = identity_dict()
+ self.iseen_roots = identity_dict()
# the following are lists of addresses of gc pointers living inside the
# prebuilt structures. It should list all the locations that could
# possibly point to a GC heap object.
@@ -310,9 +310,9 @@
def consider_constant(self, TYPE, value, gc):
if value is not lltype.top_container(value):
return
- if value in self.seen_roots:
+ if value in self.iseen_roots:
return
- self.seen_roots[value] = True
+ self.iseen_roots[value] = True
if isinstance(TYPE, (lltype.GcStruct, lltype.GcArray)):
typeid = self.get_type_id(TYPE)
Modified: pypy/trunk/pypy/rpython/ootypesystem/rclass.py
==============================================================================
--- pypy/trunk/pypy/rpython/ootypesystem/rclass.py (original)
+++ pypy/trunk/pypy/rpython/ootypesystem/rclass.py Thu Mar 18 14:42:08 2010
@@ -185,7 +185,7 @@
hints = {}
hints = self._check_for_immutable_hints(hints)
self.lowleveltype = ootype.Instance(classdef.name, b, {}, {}, _hints = hints)
- self.prebuiltinstances = identity_dict()
+ self.iprebuiltinstances = identity_dict()
self.object_type = self.lowleveltype
self.gcflavor = gcflavor
Modified: pypy/trunk/pypy/rpython/rclass.py
==============================================================================
--- pypy/trunk/pypy/rpython/rclass.py (original)
+++ pypy/trunk/pypy/rpython/rclass.py Thu Mar 18 14:42:08 2010
@@ -223,11 +223,11 @@
def convert_const_exact(self, value):
try:
- return self.prebuiltinstances[value][1]
+ return self.iprebuiltinstances[value][1]
except KeyError:
self.setup()
result = self.create_instance()
- self.prebuiltinstances[value] = value, result
+ self.iprebuiltinstances[value] = value, result
self.initialize_prebuilt_instance(value, self.classdef, result)
return result
Modified: pypy/trunk/pypy/translator/c/database.py
==============================================================================
--- pypy/trunk/pypy/translator/c/database.py (original)
+++ pypy/trunk/pypy/translator/c/database.py Thu Mar 18 14:42:08 2010
@@ -44,7 +44,7 @@
self.pendingsetupnodes = []
self.containernodes = {}
self.containerlist = []
- self.delayedfunctionnames = identity_dict()
+ self.idelayedfunctionnames = identity_dict()
self.delayedfunctionptrs = []
self.completedcontainers = 0
self.containerstats = {}
@@ -193,11 +193,11 @@
if len(name) == n:
raise
if isinstance(lltype.typeOf(obj).TO, lltype.FuncType):
- if obj in self.delayedfunctionnames:
- return self.delayedfunctionnames[obj][0]
+ if obj in self.idelayedfunctionnames:
+ return self.idelayedfunctionnames[obj][0]
funcname = name[n:]
funcname = self.namespace.uniquename('g_'+funcname)
- self.delayedfunctionnames[obj] = funcname, obj
+ self.idelayedfunctionnames[obj] = funcname, obj
else:
funcname = None # can't use the name of a
# delayed non-function ptr
@@ -206,10 +206,10 @@
# /hack hack hack
else:
# hack hack hack
- if obj in self.delayedfunctionnames:
+ if obj in self.idelayedfunctionnames:
# this used to be a delayed function,
# make sure we use the same name
- forcename = self.delayedfunctionnames[obj][0]
+ forcename = self.idelayedfunctionnames[obj][0]
node = self.getcontainernode(container,
forcename=forcename)
assert node.ptrname == forcename
Modified: pypy/trunk/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/trunk/pypy/translator/c/funcgen.py (original)
+++ pypy/trunk/pypy/translator/c/funcgen.py Thu Mar 18 14:42:08 2010
@@ -65,7 +65,7 @@
continue
db.gettype(T) # force the type to be considered by the database
- self.lltypes = None
+ self.illtypes = None
def collect_var_and_types(self):
#
@@ -129,7 +129,7 @@
T = getattr(v, 'concretetype', PyObjPtr)
typename = db.gettype(T)
lltypes[v] = T, typename
- self.lltypes = lltypes
+ self.illtypes = lltypes
self.innerloops = {} # maps the loop's header block to a Loop()
for loop in find_inner_loops(self.graph, Bool):
self.innerloops[loop.headblock] = loop
@@ -139,7 +139,7 @@
def implementation_end(self):
self.all_cached_consts = list(self.allconstantvalues())
- self.lltypes = None
+ self.illtypes = None
self.vars = None
self.blocknum = None
self.innerloops = None
@@ -163,11 +163,11 @@
yield llvalue
def lltypemap(self, v):
- T, typename = self.lltypes[v]
+ T, typename = self.illtypes[v]
return T
def lltypename(self, v):
- T, typename = self.lltypes[v]
+ T, typename = self.illtypes[v]
return typename
def expr(self, v, special_case_void=True):
@@ -300,7 +300,7 @@
is_alive = {}
assignments = []
for a1, a2 in zip(link.args, link.target.inputargs):
- a2type, a2typename = self.lltypes[a2]
+ a2type, a2typename = self.illtypes[a2]
if a2type is Void:
continue
src = self.expr(a1)
Modified: pypy/trunk/pypy/translator/geninterplevel.py
==============================================================================
--- pypy/trunk/pypy/translator/geninterplevel.py (original)
+++ pypy/trunk/pypy/translator/geninterplevel.py Thu Mar 18 14:42:08 2010
@@ -194,8 +194,8 @@
def __repr__(self):
return '<%s>' % self.__name__
- self.builtin_ids = identity_dict()
- self.builtin_ids.update([
+ self.ibuiltin_ids = identity_dict()
+ self.ibuiltin_ids.update([
(value, bltinstub(key))
for key, value in __builtin__.__dict__.items()
if callable(value) and type(value) not in [types.ClassType, type] ] )
@@ -392,8 +392,8 @@
name = self.nameof_instance(obj)
else:
# shortcutting references to __builtin__
- if obj in self.builtin_ids:
- func = self.builtin_ids[obj]
+ if obj in self.ibuiltin_ids:
+ func = self.ibuiltin_ids[obj]
#name = self.get_nameof_builtin_func(func)
# the above is quicker in principle, but pulls more
# stuff in, so it is slower right now.
@@ -706,8 +706,8 @@
return self._space_arities
def try_space_shortcut_for_builtin(self, v, nargs, args):
- if isinstance(v, Constant) and v.value in self.builtin_ids:
- name = self.builtin_ids[v.value].__name__
+ if isinstance(v, Constant) and v.value in self.ibuiltin_ids:
+ name = self.ibuiltin_ids[v.value].__name__
if hasattr(self.space, name):
if self.space_arities().get(name, -1) == nargs:
if name != 'isinstance':
@@ -727,8 +727,8 @@
def nameof_builtin_function(self, func):
# builtin function
- if func in self.builtin_ids:
- func = self.builtin_ids[func]
+ if func in self.ibuiltin_ids:
+ func = self.ibuiltin_ids[func]
return "(space.builtin.get(space.str_w(%s)))" % self.nameof(func.__name__)
# where does it come from? Python2.2 doesn't have func.__module__
for modname, module in sys.modules.items():
More information about the Pypy-commit
mailing list