Ejemplo n.º 1
0
 def _event(self, kind, goal, func):
     if kind == 'pre':
         fork_before = self.config.translation.fork_before
         if fork_before:
             fork_before, = self.backend_select_goals([fork_before])
             if not fork_before in self.done and fork_before == goal:
                 prereq = getattr(self, 'prereq_checkpt_%s' % goal, None)
                 if prereq:
                     prereq()
                 from pypy.translator.goal import unixcheckpoint
                 unixcheckpoint.restartable_point(auto='run')
Ejemplo n.º 2
0
 def _event(self, kind, goal, func):
     if kind == 'pre':
         fork_before = self.config.translation.fork_before
         if fork_before:
             fork_before, = self.backend_select_goals([fork_before])
             if not fork_before in self.done and fork_before == goal:
                 prereq = getattr(self, 'prereq_checkpt_%s' % goal, None)
                 if prereq:
                     prereq()
                 from pypy.translator.goal import unixcheckpoint
                 unixcheckpoint.restartable_point(auto='run')
Ejemplo n.º 3
0
    def _event(self, kind, goal, func):
        if kind == "planned" and func.task_earlycheck:
            func.task_earlycheck(self)
        if kind == "pre":
            fork_before = self.config.translation.fork_before
            if fork_before:
                fork_before, = self.backend_select_goals([fork_before])
                if not fork_before in self.done and fork_before == goal:
                    prereq = getattr(self, "prereq_checkpt_%s" % goal, None)
                    if prereq:
                        prereq()
                    from pypy.translator.goal import unixcheckpoint

                    unixcheckpoint.restartable_point(auto="run")
Ejemplo n.º 4
0
    # first annotate and rtype
    try:
        interp, graph = get_interpreter(
            entry_point, [],
            backendopt=False,
            config=config,
            type_system=config.translation.type_system,
            policy=PyPyAnnotatorPolicy(space))
    except Exception, e:
        print '%s: %s' % (e.__class__, e)
        pdb.post_mortem(sys.exc_info()[2])
        raise

    # parent process loop: spawn a child, wait for the child to finish,
    # print a message, and restart
    unixcheckpoint.restartable_point(auto='run')

    from pypy.jit.codewriter.codewriter import CodeWriter
    CodeWriter.debug = True
    from pypy.jit.tl.pypyjit_child import run_child, run_child_ootype
    if BACKEND == 'c':
        run_child(globals(), locals())
    elif BACKEND == 'cli':
        run_child_ootype(globals(), locals())
    else:
        assert False


if __name__ == '__main__':
    import sys
    if len(sys.argv) > 1:
Ejemplo n.º 5
0
    from pypy.rpython.test.test_llinterp import get_interpreter

    # first annotate, rtype, and backendoptimize PyPy
    try:
        interp, graph = get_interpreter(entry_point, [], backendopt=True,
                                        config=config,
                                        type_system=config.translation.type_system,
                                        policy=PyPyAnnotatorPolicy(space))
    except Exception, e:
        print '%s: %s' % (e.__class__, e)
        pdb.post_mortem(sys.exc_info()[2])
        raise

    # parent process loop: spawn a child, wait for the child to finish,
    # print a message, and restart
    unixcheckpoint.restartable_point(auto='run')

    from pypy.jit.tl.pypyjit_child import run_child, run_child_ootype
    if BACKEND == 'c':
        run_child(globals(), locals())
    elif BACKEND == 'cli':
        run_child_ootype(globals(), locals())
    else:
        assert False


if __name__ == '__main__':
    import sys
    if len(sys.argv) > 1:
        # debugging: run the code directly
        entry_point()
Ejemplo n.º 6
0
        interp, graph = get_interpreter(
            entry_point,
            [],
            backendopt=False,
            config=config,
            type_system=config.translation.type_system,
            policy=PyPyAnnotatorPolicy(space),
        )
    except Exception, e:
        print "%s: %s" % (e.__class__, e)
        pdb.post_mortem(sys.exc_info()[2])
        raise

    # parent process loop: spawn a child, wait for the child to finish,
    # print a message, and restart
    unixcheckpoint.restartable_point(auto="run")

    from pypy.jit.codewriter.codewriter import CodeWriter

    CodeWriter.debug = True
    from pypy.jit.tl.pypyjit_child import run_child, run_child_ootype

    if BACKEND == "c":
        run_child(globals(), locals())
    elif BACKEND == "cli":
        run_child_ootype(globals(), locals())
    else:
        assert False


if __name__ == "__main__":