示例#1
0
 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
     ]
示例#2
0
 def match(self, src1, src2, **kwds):
     from rpython.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
示例#3
0
 def match(self, src1, src2, **kwds):
     from rpython.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
示例#4
0
    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]
示例#5
0
文件: base.py 项目: nightsailer/topaz
    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]
示例#6
0
def extract_traces(file, remove_debug=True, remove_main_labels=True, remove_all_labels=False):
    data = logparser.parse_log_file(file, 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)
    for trace in traces_w:
        trace.parse(remove_debug, remove_main_labels, remove_all_labels)
    return traces_w
示例#7
0
def extract_traces(file, remove_debug=True, remove_main_labels=True,
                   remove_all_labels=False):
    data = logparser.parse_log_file(file, 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)
    for trace in traces_w:
        trace.parse(remove_debug, remove_main_labels, remove_all_labels)
    return traces_w
示例#8
0
def parse(input, **kwds):
    return SimpleParser.parse_from_input(input, **kwds)
示例#9
0
文件: model.py 项目: yuyichao/pypy
 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]
示例#10
0
def parse(input, **kwds):
    return SimpleParser.parse_from_input(input, **kwds)
示例#11
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations, src=src1)
     return matcher.match(src2, **kwds)
示例#12
0
 def match(self, src1, src2, **kwds):
     from rpython.tool.jitlogparser.parser import SimpleParser
     loop = SimpleParser.parse_from_input(src1)
     matcher = OpMatcher(loop.operations, src=src1)
     return matcher.match(src2, **kwds)