Esempio n. 1
0
 def interpret(self, fn, args):
     interp, graph = get_interpreter(fn, args, view=False, viewbefore=False, type_system=self.type_system)
     if option.view:
         interp.typer.annotator.translator.view()
     build_trees(graph)
     if option.view:
         interp.typer.annotator.translator.view()
     return interp.eval_graph(graph, args)
Esempio n. 2
0
 def interpret(self, fn, args):
     interp, graph = get_interpreter(fn,
                                     args,
                                     view=False,
                                     viewbefore=False,
                                     type_system=self.type_system)
     if option.view:
         interp.typer.annotator.translator.view()
     build_trees(graph)
     if option.view:
         interp.typer.annotator.translator.view()
     return interp.eval_graph(graph, args)
Esempio n. 3
0
    def __init__(self, tmpdir, translator, entrypoint, config=None):
        GenOO.__init__(self, tmpdir, translator, entrypoint, config)
        for node in get_prebuilt_nodes(translator, self.db):
            self.db.pending_node(node)
        self.assembly_name = entrypoint.get_name()
        self.tmpfile = tmpdir.join(self.assembly_name + '.il')
        self.const_stat = str(tmpdir.join('const_stat'))

        if translator.config.translation.backendopt.stack_optimization:
            for graph in translator.graphs:
                SSI_to_SSA(graph)
                build_trees(graph)
Esempio n. 4
0
def check_trees(func, argtypes):
    t = translate(func, argtypes)
    if option.view:
        t.view()
    graph = graphof(t, func)
    build_trees(graph)
    if option.view:
        t.view()
    interp = LLInterpreter(t.rtyper)
    def eval_func(*args):
        return interp.eval_graph(graph, args)
    return graph, eval_func
Esempio n. 5
0
def check_trees(func, argtypes):
    t = translate(func, argtypes)
    if option.view:
        t.view()
    graph = graphof(t, func)
    build_trees(graph)
    if option.view:
        t.view()
    interp = LLInterpreter(t.rtyper)

    def eval_func(*args):
        return interp.eval_graph(graph, args)

    return graph, eval_func
Esempio n. 6
0
 def stack_optimization(self):
     for graph in self.translator.graphs:
         SSI_to_SSA(graph)
         build_trees(graph)
Esempio n. 7
0
 def stack_optimization(self):
     for graph in self.translator.graphs:
         SSI_to_SSA(graph)
         build_trees(graph)