Пример #1
0
def target(driver, args):
    driver.exe_name = "rsqueak"
    config = driver.config
    parser(config).parse_args(args)

    driver.config.translation.suggest(**{
        "jit": True,
        "jit_opencoder_model": "big",
    })
    driver.config.translation.set(gcrootfinder="shadowstack")
    if system.IS_WINDOWS:
        driver.config.translation.suggest(
            **{"icon": os.path.join(os.path.dirname(__file__), "rsqueak.ico")})
    config.translating = True

    system.expose_options(driver.config)

    if 'PythonPlugin' in system.optional_plugins:
        # Disable vmprof, because it causes compiling errors
        system.disabled_plugins += ',ProfilerPlugin'

    # We must not import this before the config was exposed
    from rsqueakvm.main import safe_entry_point
    if 'PythonPlugin' in system.optional_plugins:
        from rsqueakvm.plugins.python.utils import entry_point
        from pypy.tool.ann_override import PyPyAnnotatorPolicy
        ann_policy = PyPyAnnotatorPolicy()
        return entry_point, None, ann_policy
    return safe_entry_point, None, None
Пример #2
0
    def get_entry_point(self, config):
        self.space = make_objspace(config)

        # manually imports app_main.py
        filename = os.path.join(pypydir, 'interpreter', 'app_main.py')
        app = gateway.applevel(open(filename).read(), 'app_main.py', 'app_main')
        app.hidden_applevel = False
        w_dict = app.getwdict(self.space)
        entry_point, _ = create_entry_point(self.space, w_dict)

        return entry_point, None, PyPyAnnotatorPolicy()
Пример #3
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, e:
        print '%s: %s' % (e.__class__, e)
        pdb.post_mortem(sys.exc_info()[2])
        raise
Пример #4
0
    def get_entry_point(self, config):
        from pypy.tool.lib_pypy import import_from_lib_pypy
        rebuild = import_from_lib_pypy('ctypes_config_cache/rebuild')
        rebuild.try_rebuild()

        space = make_objspace(config)

        # manually imports app_main.py
        filename = os.path.join(pypydir, 'interpreter', 'app_main.py')
        app = gateway.applevel(open(filename).read(), 'app_main.py', 'app_main')
        app.hidden_applevel = False
        w_dict = app.getwdict(space)
        entry_point, _ = create_entry_point(space, w_dict)

        return entry_point, None, PyPyAnnotatorPolicy()
Пример #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())