Author: Remi Meier <remi.me...@gmail.com> Branch: stmgc-c8-gcc Changeset: r79671:72a2bd026996 Date: 2015-09-17 17:59 +0200 http://bitbucket.org/pypy/pypy/changeset/72a2bd026996/
Log: reenable mapdict cache and method cache (needs testing) diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py --- a/pypy/config/pypyoption.py +++ b/pypy/config/pypyoption.py @@ -324,8 +324,9 @@ if config.translation.stm: # having both mapdict and methodcache together is a bad idea: # it creates many conflicts - if config.objspace.std.withmapdict: - config.objspace.std.withmethodcache = False + # if config.objspace.std.withmapdict: + # config.objspace.std.withmethodcache = True #False + pass def enable_allworkingmodules(config): diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py --- a/pypy/interpreter/pycode.py +++ b/pypy/interpreter/pycode.py @@ -15,7 +15,7 @@ CO_GENERATOR, CO_KILL_DOCSTRING, CO_YIELD_INSIDE_TRY) from pypy.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT from rpython.rlib.rarithmetic import intmask, r_longlong -from rpython.rlib.objectmodel import compute_hash +from rpython.rlib.objectmodel import compute_hash, we_are_translated from rpython.rlib import jit from rpython.rlib.debug import debug_start, debug_stop, debug_print @@ -57,7 +57,7 @@ _immutable_fields_ = ["co_consts_w[*]", "co_names_w[*]", "co_varnames[*]", "co_freevars[*]", "co_cellvars[*]", "_args_as_cellvars[*]"] - + def __init__(self, space, argcount, nlocals, stacksize, flags, code, consts, names, varnames, filename, name, firstlineno, lnotab, freevars, cellvars, @@ -123,11 +123,11 @@ self._compute_flatcall() - if (self.space.config.objspace.std.withmapdict and - not self.space.config.translation.stm): + if self.space.config.objspace.std.withmapdict: from pypy.objspace.std.mapdict import init_mapdict_cache init_mapdict_cache(self) + def _init_ready(self): "This is a hook for the vmprof module, which overrides this method." @@ -369,6 +369,7 @@ code = space.allocate_instance(PyCode, w_subtype) PyCode.__init__(code, space, argcount, nlocals, stacksize, flags, codestring, consts_w[:], names, varnames, filename, name, firstlineno, lnotab, freevars, cellvars, magic=magic) + return space.wrap(code) def descr__reduce__(self, space): diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -958,7 +958,6 @@ "obj.attributename" w_obj = self.popvalue() if (self.space.config.objspace.std.withmapdict and - not self.space.config.translation.stm and not jit.we_are_jitted()): from pypy.objspace.std.mapdict import LOAD_ATTR_caching w_value = LOAD_ATTR_caching(self.getcode(), w_obj, nameindex) diff --git a/pypy/objspace/std/callmethod.py b/pypy/objspace/std/callmethod.py --- a/pypy/objspace/std/callmethod.py +++ b/pypy/objspace/std/callmethod.py @@ -34,7 +34,6 @@ w_obj = f.popvalue() if (space.config.objspace.std.withmapdict and - not space.config.translation.stm and not jit.we_are_jitted()): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): @@ -62,7 +61,6 @@ f.pushvalue(w_descr) f.pushvalue(w_obj) if (space.config.objspace.std.withmapdict and - not space.config.translation.stm and not jit.we_are_jitted()): # let mapdict cache stuff LOOKUP_METHOD_mapdict_fill_cache_method( _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit