Author: Carl Friedrich Bolz-Tereick <cfb...@gmx.de> Branch: py3.6 Changeset: r96053:2e21aa817a15 Date: 2019-02-18 11:58 +0100 http://bitbucket.org/pypy/pypy/changeset/2e21aa817a15/
Log: make BUILD_CONST_KEY_MAP JIT-friendly diff --git a/pypy/interpreter/pyopcode.py b/pypy/interpreter/pyopcode.py --- a/pypy/interpreter/pyopcode.py +++ b/pypy/interpreter/pyopcode.py @@ -1442,11 +1442,15 @@ @jit.unroll_safe def BUILD_CONST_KEY_MAP(self, itemcount, next_instr): - keys_w = self.space.fixedview(self.popvalue()) + from pypy.objspace.std.tupleobject import W_AbstractTupleObject + # the reason why we don't use space.fixedview here is that then the + # immutability of the tuple would not propagate into the loop below in + # the JIT + w_keys = self.space.interp_w(W_AbstractTupleObject, self.popvalue()) w_dict = self.space.newdict() for i in range(itemcount): w_value = self.peekvalue(itemcount - 1 - i) - w_key = keys_w[i] + w_key = w_keys.getitem(self.space, i) self.space.setitem(w_dict, w_key, w_value) self.dropvalues(itemcount) self.pushvalue(w_dict) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit