Author: Richard Plangger <planri...@gmail.com> Branch: new-jit-log Changeset: r83890:13151099cbf6 Date: 2016-04-26 08:13 +0200 http://bitbucket.org/pypy/pypy/changeset/13151099cbf6/
Log: fixed translation issues diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py --- a/pypy/module/pypyjit/interp_jit.py +++ b/pypy/module/pypyjit/interp_jit.py @@ -5,7 +5,7 @@ from rpython.rlib.rarithmetic import r_uint, intmask from rpython.rlib.jit import JitDriver, hint, we_are_jitted, dont_look_inside -from rpython.rlib import jit, jit_hooks +from rpython.rlib import jit, jit_hooks, jitlog as jl from rpython.rlib.jit import current_trace_length, unroll_parameters,\ JitHookInterface from rpython.rtyper.annlowlevel import cast_instance_to_gcref @@ -45,9 +45,10 @@ jl.MP_SCOPE, jl.MP_INDEX, jl.MP_OPCODE) def get_location(next_instr, is_being_profiled, bytecode): from pypy.tool.stdlib_opcode import opcode_method_names - opname = opcode_method_names[ord(bytecode.co_code[next_instr])] - if not opname: - opname = "" + bcindex = ord(bytecode.co_code[next_instr]) + opname = "" + if 0 <= bcindex < len(opcode_method_names): + opname = opcode_method_names[bcindex] name = bytecode.co_name if not name: name = "" diff --git a/rpython/jit/metainterp/optimizeopt/dependency.py b/rpython/jit/metainterp/optimizeopt/dependency.py --- a/rpython/jit/metainterp/optimizeopt/dependency.py +++ b/rpython/jit/metainterp/optimizeopt/dependency.py @@ -22,6 +22,8 @@ , (rop.UNICODESETITEM, 0, -1) ] +UNROLLED_MODIFY_COMPLEX_OBJ = unrolling_iterable(MODIFY_COMPLEX_OBJ) + LOAD_COMPLEX_OBJ = [ (rop.GETARRAYITEM_GC_I, 0, 1) , (rop.GETARRAYITEM_GC_F, 0, 1) , (rop.GETARRAYITEM_GC_R, 0, 1) @@ -40,6 +42,8 @@ , (rop.GETFIELD_RAW_R, 0, -1) ] +UNROLLED_LOAD_COMPLEX_OBJ = unrolling_iterable(LOAD_COMPLEX_OBJ) + class Path(object): def __init__(self,path): self.path = path @@ -202,7 +206,7 @@ args = [] op = self.op if self.modifies_complex_object(): - for opnum, i, j in unrolling_iterable(MODIFY_COMPLEX_OBJ): + for opnum, i, j in UNROLLED_MODIFY_COMPLEX_OBJ: #unrolling_iterable(MODIFY_COMPLEX_OBJ): if op.getopnum() == opnum: op_args = op.getarglist() if j == -1: @@ -723,7 +727,7 @@ if node.loads_from_complex_object(): # If this complex object load operation loads an index that has been # modified, the last modification should be used to put a def-use edge. - for opnum, i, j in unrolling_iterable(LOAD_COMPLEX_OBJ): + for opnum, i, j in UNROLLED_LOAD_COMPLEX_OBJ: if opnum == op.getopnum(): cobj = op.getarg(i) if j != -1: diff --git a/rpython/jit/metainterp/warmspot.py b/rpython/jit/metainterp/warmspot.py --- a/rpython/jit/metainterp/warmspot.py +++ b/rpython/jit/metainterp/warmspot.py @@ -581,8 +581,6 @@ annhelper, jd.jitdriver.should_unroll_one_iteration, annmodel.s_Bool) # - s_Str = annmodel.SomeString(no_nul=True) - s_Int = annmodel.SomeInteger() items = [] types = () pos = () @@ -601,9 +599,9 @@ # for _,type in types: if type == 's': - items.append(s_Str) + items.append(annmodel.SomeString()) elif type == 'i': - items.append(s_Int) + items.append(annmodel.SomeInteger()) else: raise NotImplementedError s_Tuple = annmodel.SomeTuple(items) diff --git a/rpython/rlib/jitlog.py b/rpython/rlib/jitlog.py --- a/rpython/rlib/jitlog.py +++ b/rpython/rlib/jitlog.py @@ -176,17 +176,20 @@ ('COMMON_PREFIX',), ] -start = 0x10 +start = 0x11 for mark, in marks: globals()['MARK_' + mark] = start start += 1 if __name__ == "__main__": print("# generated constants from rpython/rlib/jitlog.py") - for mark in marks: - print '%s = %d' % ('MARK_' + mark, globals()['MARK_' + mark]) + print 'MARK_JITLOG_START = chr(%s)' % hex(0x10) + for mark, in marks: + print '%s = chr(%s)' % ('MARK_' + mark, hex(globals()['MARK_' + mark])) + print 'MARK_JITLOG_END = chr(%s)' % hex(start) del marks +del start IS_32_BIT = sys.maxint == 2**31-1 @@ -331,7 +334,7 @@ def write(self, args, ops, ops_offset={}): log = self.logger - log._write_marked(self.tag, encode_le_addr(self.logger.trace_id)) + log._write_marked(self.tag, encode_le_64bit(self.logger.trace_id)) # input args str_args = [self.var_to_str(arg) for arg in args] _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit