Author: Maciej Fijalkowski <[email protected]>
Branch: virtual-arguments
Changeset: r56081:70fc1238f840
Date: 2012-07-15 16:49 +0200
http://bitbucket.org/pypy/pypy/changeset/70fc1238f840/
Log: A hint to unroll view_as_kwargs if we just constructed it. Note that
the size is limited by the size of your code - you cannot construct
arbitrary size dictionaries by looping, which also means you're not
going to have very large virtual dicts.
diff --git a/pypy/objspace/std/dictmultiobject.py
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -11,6 +11,7 @@
from pypy.rlib.debug import mark_dict_non_null
from pypy.rlib import rerased
+from pypy.rlib import jit
def _is_str(space, w_key):
return space.is_w(space.type(w_key), space.w_str)
@@ -508,6 +509,7 @@
def w_keys(self, w_dict):
return self.space.newlist_str(self.listview_str(w_dict))
+ @jit.look_inside_iff(lambda self, w_dict : jit.isvirtual(w_dict))
def view_as_kwargs(self, w_dict):
d = self.unerase(w_dict.dstorage)
l = len(d)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit