Beispiel #1
0
 def task_jittest_lltype(self):
     """ Run with the JIT on top of the llgraph backend
     """
     # parent process loop: spawn a child, wait for the child to finish,
     # print a message, and restart
     from rpython.translator.goal import unixcheckpoint
     unixcheckpoint.restartable_point(auto='run')
     # load the module rpython/jit/tl/jittest.py, which you can hack at
     # and restart without needing to restart the whole translation process
     from rpython.jit.tl import jittest
     jittest.jittest(self)
Beispiel #2
0
 def task_jittest_lltype(self):
     """ Run with the JIT on top of the llgraph backend
     """
     # parent process loop: spawn a child, wait for the child to finish,
     # print a message, and restart
     from rpython.translator.goal import unixcheckpoint
     unixcheckpoint.restartable_point(auto='run')
     # load the module rpython/jit/tl/jittest.py, which you can hack at
     # and restart without needing to restart the whole translation process
     from rpython.jit.tl import jittest
     jittest.jittest(self)
Beispiel #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 rpython.translator.goal import unixcheckpoint
                 unixcheckpoint.restartable_point(auto='run')
Beispiel #4
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 rpython.translator.goal import unixcheckpoint
                 unixcheckpoint.restartable_point(auto='run')
Beispiel #5
0
def test_run_translation():
    from pypy.tool.ann_override import PyPyAnnotatorPolicy
    from rpython.rtyper.test.test_llinterp import get_interpreter

    # first annotate and rtype
    try:
        interp, graph = get_interpreter(entry_point, [], backendopt=False,
                                        config=config,
                                        policy=PyPyAnnotatorPolicy(space))
    except Exception as 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 rpython.jit.codewriter.codewriter import CodeWriter
    CodeWriter.debug = True
    from pypy.tool.pypyjit_child import run_child
    run_child(globals(), locals())
Beispiel #6
0
def test_run_translation():
    from pypy.tool.ann_override import PyPyAnnotatorPolicy
    from rpython.rtyper.test.test_llinterp import get_interpreter

    # first annotate and rtype
    try:
        interp, graph = get_interpreter(entry_point, [],
                                        backendopt=False,
                                        config=config,
                                        policy=PyPyAnnotatorPolicy(space))
    except Exception as 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 rpython.jit.codewriter.codewriter import CodeWriter
    CodeWriter.debug = True
    from pypy.tool.pypyjit_child import run_child
    run_child(globals(), locals())
Beispiel #7
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 rpython.jit.codewriter.codewriter import CodeWriter

    CodeWriter.debug = True
    from pypy.tool.pypyjit_child import run_child

    run_child(globals(), locals())


if __name__ == "__main__":
    import sys

    if len(sys.argv) > 1:
        # debugging: run the code directly
        entry_point()
Beispiel #8
0
    config = get_combined_translation_config(translating=True)
    config.translation.gc = 'boehm'
    set_opt_level(config, level='jit')
    config.translation.backendopt.inline_threshold = 0.1

    try:
        interp, graph = get_interpreter(run, [], backendopt=False,
                                        config=config)
    except Exception, e:
        print '%s: %s' % (e.__class__, e)
        pdb.post_mortem(sys.exc_info()[2])
        raise
    class Option:
        view = True

    conftest.option = Option

    unixcheckpoint.restartable_point(auto='run')

    from rpython.jit.codewriter.codewriter import CodeWriter
    CodeWriter.debug = True
    run_child(globals(), locals())

if __name__ == '__main__':
    import sys
    if len(sys.argv) > 1:
        # debugging: run the code directly
        run()
    else:
        test_run_translation()
Beispiel #9
0
    from rpython.rtyper.test.test_llinterp import get_interpreter

    # first annotate and rtype
    try:
        interp, graph = get_interpreter(entry_point, [],
                                        backendopt=False,
                                        config=config,
                                        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 rpython.jit.codewriter.codewriter import CodeWriter
    CodeWriter.debug = True
    from pypy.tool.pypyjit_child import run_child
    run_child(globals(), locals())


if __name__ == '__main__':
    import sys
    if len(sys.argv) > 1:
        # debugging: run the code directly
        entry_point()
    else:
        test_run_translation()