def read_jitlog_counter(ctx, trace, fileobj): addr = ctx.read_le_addr(fileobj) type = read_char(fileobj) count = read_le_u64(fileobj) # entry: gets the globally numbered addr of the loop # bridge: gets the addr of the fail descr # label: gets the addr of the loop token trace = ctx.forest.get_trace_by_id(addr) if trace: trace.add_up_enter_count(count) return True else: if type == 'e': # it can happen that jitlog counters are present, # even though there is no trace to be found. # vm starts up (bootstrapping creates 1-2 trace), # jitlog is enabled afterwards return False assert type == 'b' or type == 'l' point_in_trace = ctx.forest.get_point_in_trace_by_descr(addr) if point_in_trace: if type == 'b': point_in_trace.trace.add_up_enter_count(count) else: point_in_trace.add_up_enter_count(count) return True sys.stderr.write("trace with 0x%x (type '%c' was executed %d times" \ " but was not recorded in the log\n" % (addr, type, count)) return False
def read_jitlog_counter(ctx, trace, fileobj): addr = ctx.read_le_addr(fileobj) type = read_char(fileobj) count = read_le_u64(fileobj) # entry: gets the globally numbered addr of the loop # bridge: gets the addr of the fail descr # label: gets the addr of the loop token trace = ctx.forest.get_trace_by_id(addr) if trace: trace.add_up_enter_count(count) return True else: if type == "e": # it can happen that jitlog counters are present, # even though there is no trace to be found. # vm starts up (bootstrapping creates 1-2 trace), # jitlog is enabled afterwards return False assert type == "b" or type == "l" point_in_trace = ctx.forest.get_point_in_trace_by_descr(addr) if point_in_trace: if type == "b": point_in_trace.trace.add_up_enter_count(count) else: point_in_trace.add_up_enter_count(count) return True sys.stderr.write( "trace with 0x%x (type '%c' was executed %d times" " but was not recorded in the log\n" % (addr, type, count) ) return False
def read_init_merge_point(ctx, trace, fileobj): count = read_le_u16(fileobj) types = [] for i in range(count): sem_type = read_byte(fileobj) gen_type = read_char(fileobj) d = merge_point.get_decoder(sem_type, gen_type, ctx.forest.version) types.append(d) stage = trace.get_last_stage() assert stage is not None, "last stage is none, but it must not be none!" stage.merge_point_types = types