def __init__(self, rawtraces): storage = LoopStorage() traces = [ SimpleParser.parse_from_input(rawtrace) for rawtrace in rawtraces ] traces = storage.reconnect_loops(traces) self.loops = [ TraceWithIds.from_trace(trace, storage) for trace in traces ]
def __init__(self, rawtraces): storage = LoopStorage() traces = [ SimpleParser.parse_from_input(rawtrace) for rawtrace in rawtraces ] traces = storage.reconnect_loops(traces) self.loops = [ LoopWithIds.from_trace(trace, storage) for trace in traces ]
def match(self, src1, src2, **kwds): from pypy.tool.jitlogparser.parser import SimpleParser loop = SimpleParser.parse_from_input(src1) matcher = OpMatcher(loop.operations) try: res = matcher.match(src2, **kwds) assert res is True return True except InvalidMatch: return False
def run(self, topaz, tmpdir, code): tmpdir.join("t.rb").write(code) proc = subprocess.Popen( [str(topaz), str(tmpdir.join("t.rb"))], cwd=str(tmpdir), env={"PYPYLOG": "jit-log-opt:%s" % tmpdir.join("x.pypylog")}) proc.wait() data = logparser.parse_log_file(str(tmpdir.join("x.pypylog")), verbose=False) data = logparser.extract_category(data, "jit-log-opt-") storage = LoopStorage() traces = [SimpleParser.parse_from_input(t) for t in data] traces = storage.reconnect_loops(traces) return [Trace(t) for t in traces]
def run(self, topaz, tmpdir, code): tmpdir.join("t.rb").write(code) proc = subprocess.Popen( [str(topaz), str(tmpdir.join("t.rb"))], cwd=str(tmpdir), env={"PYPYLOG": "jit-log-opt:%s" % tmpdir.join("x.pypylog")} ) proc.wait() data = logparser.parse_log_file(str(tmpdir.join("x.pypylog")), verbose=False) data = logparser.extract_category(data, "jit-log-opt-") storage = LoopStorage() traces = [SimpleParser.parse_from_input(t) for t in data] traces = storage.reconnect_loops(traces) return [Trace(t) for t in traces]
def run(self, spy, tmpdir, code): proc = subprocess.Popen( [str(spy), "-r", code.replace("\n", "\r\n"), BenchmarkImage], cwd=str(tmpdir), env={"PYPYLOG": "jit-log-opt:%s" % tmpdir.join("x.pypylog")} ) proc.wait() data = logparser.parse_log_file(str(tmpdir.join("x.pypylog")), verbose=False) data = logparser.extract_category(data, "jit-log-opt-") storage = LoopStorage() traces = [SimpleParser.parse_from_input(t) for t in data] main_loops = storage.reconnect_loops(traces) traces_w = [] for trace in traces: if trace in main_loops: traces_w.append(Trace(trace)) else: traces_w[len(traces_w) - 1].addbridge(trace) return traces_w
def parse(input): return SimpleParser.parse_from_input(input)
def parse(input, **kwds): return SimpleParser.parse_from_input(input, **kwds)
def match(self, src1, src2, **kwds): from pypy.tool.jitlogparser.parser import SimpleParser loop = SimpleParser.parse_from_input(src1) matcher = OpMatcher(loop.operations, src=src1) return matcher.match(src2, **kwds)