Beispiel #1
0
                                          (modname, errcls))

        return validator
    else:
        return None


pypy_optiondescription = OptionDescription(
    "objspace",
    "Object Space Options",
    [
        ChoiceOption("name",
                     "Object Space name",
                     ["std", "flow", "thunk", "dump", "taint", "reflective"],
                     "std",
                     requires={
                         "reflective":
                         [("objspace.disable_call_speedhacks", True)]
                     },
                     cmdline='--objspace -o'),
        ChoiceOption("parser",
                     "which parser to use for app-level code",
                     ["pypy", "cpython"],
                     "pypy",
                     cmdline='--parser'),
        ChoiceOption("compiler",
                     "which compiler to use for app-level code",
                     ["cpython", "ast"],
                     "ast",
                     cmdline='--compiler'),
        ChoiceOption("pyversion",
Beispiel #2
0
 "translation",
 "Translation Options",
 [
     BoolOption("continuation",
                "enable single-shot continuations",
                default=False,
                cmdline="--continuation",
                requires=[("translation.type_system", "lltype")]),
     ChoiceOption(
         "type_system",
         "Type system to use when RTyping",
         ["lltype", "ootype"],
         cmdline=None,
         default="lltype",
         requires={
             "ootype": [
                 ("translation.backendopt.constfold", False),
                 ("translation.backendopt.clever_malloc_removal", False),
                 (
                     "translation.gc", "boehm"
                 ),  # it's not really used, but some jit code expects a value here
             ]
         }),
     ChoiceOption("backend",
                  "Backend to use for code generation", ["c", "cli", "jvm"],
                  default="c",
                  requires={
                      "c": [("translation.type_system", "lltype")],
                      "cli": [("translation.type_system", "ootype")],
                      "jvm": [("translation.type_system", "ootype")],
                  },
Beispiel #3
0
                                   (name, errcls) + str(e))
                raise ConflictConfigError("--withmod-%s: %s" %
                                          (modname, errcls))

        return validator
    else:
        return None


pypy_optiondescription = OptionDescription(
    "objspace",
    "Object Space Options",
    [
        ChoiceOption("name",
                     "Object Space name",
                     ["std", "flow", "thunk", "dump", "taint"],
                     "std",
                     cmdline='--objspace -o'),
        ChoiceOption("parser",
                     "which parser to use for app-level code",
                     ["pypy", "cpython"],
                     "pypy",
                     cmdline='--parser'),
        ChoiceOption("compiler",
                     "which compiler to use for app-level code",
                     ["cpython", "ast"],
                     "ast",
                     cmdline='--compiler'),
        OptionDescription("opcodes", "opcodes to enable in the interpreter", [
            BoolOption(
                "CALL_LIKELY_BUILTIN",
Beispiel #4
0
translation_optiondescription = OptionDescription(
    "translation",
    "Translation Options",
    [
        BoolOption("stackless",
                   "enable stackless features during compilation",
                   default=False,
                   cmdline="--stackless",
                   requires=[("translation.type_system", "lltype")]),
        ChoiceOption(
            "type_system",
            "Type system to use when RTyping", ["lltype", "ootype"],
            cmdline=None,
            requires={
                "ootype": [
                    ("translation.backendopt.constfold", False),
                    ("translation.backendopt.heap2stack", False),
                    ("translation.backendopt.clever_malloc_removal", False),
                ]
            }),
        ChoiceOption(
            "backend",
            "Backend to use for code generation",
            ["c", "llvm", "cli", "jvm", "js"],
            requires={
                "c": [("translation.type_system", "lltype")],
                "llvm": [
                    ("translation.type_system", "lltype"),
                    ("translation.backendopt.raisingop2direct_call", True),
                ],
Beispiel #5
0
                           "Don't " + doc,
                           default=False,
                           cmdline="--no-" + name,
                           negation=False))
    return result


translate_optiondescr = OptionDescription(
    "translate",
    "XXX",
    [
        StrOption(
            "targetspec", "XXX", default='targetpypystandalone', cmdline=None),
        ChoiceOption("opt",
                     "optimization level",
                     OPT_LEVELS,
                     default=DEFAULT_OPT_LEVEL,
                     cmdline="--opt -O"),
        BoolOption("profile",
                   "cProfile (to debug the speed of the translation process)",
                   default=False,
                   cmdline="--profile"),
        BoolOption("pdb",
                   "Always run pdb even if the translation succeeds",
                   default=False,
                   cmdline="--pdb"),
        BoolOption("batch",
                   "Don't run interactive helpers",
                   default=False,
                   cmdline="--batch",
                   negation=False),
Beispiel #6
0
        if name.startswith('?'):
            optional = True
            name = name[1:]
        yesdoc = doc[0].upper()+doc[1:]+extra
        result.append(BoolOption(name, yesdoc, default=False, cmdline=cmdline,
                                 negation=False))
        if not optional:
            result.append(BoolOption("no_%s" % name, "Don't "+doc, default=False,
                                     cmdline="--no-"+name, negation=False))
    return result

translate_optiondescr = OptionDescription("translate", "XXX", [
    StrOption("targetspec", "XXX", default='targetpypystandalone',
              cmdline=None),
    ChoiceOption("opt",
                 "optimization level", OPT_LEVELS, default=DEFAULT_OPT_LEVEL,
                 cmdline="--opt -O"),
    ChoiceOption("platform",
                 "target platform", ['host'] + PLATFORMS, default='host',
                 cmdline='--platform'),
    BoolOption("profile",
               "cProfile (to debug the speed of the translation process)",
               default=False,
               cmdline="--profile"),
    BoolOption("batch", "Don't run interactive helpers", default=False,
               cmdline="--batch", negation=False),
    IntOption("huge", "Threshold in the number of functions after which "
                      "a local call graph and not a full one is displayed",
              default=100, cmdline="--huge"),
    BoolOption("view", "Start the pygame viewer", default=False,
               cmdline="--view", negation=False),
Beispiel #7
0
                                   "because importing %s raised %s\n" %
                                   (name, errcls) + str(e))
                raise ConflictConfigError("--withmod-%s: %s" %
                                          (modname, errcls))

        return validator
    else:
        return None


pypy_optiondescription = OptionDescription(
    "objspace",
    "Object Space Options",
    [
        ChoiceOption("name",
                     "Object Space name", ["std", "flow", "thunk", "dump"],
                     "std",
                     cmdline='--objspace -o'),
        OptionDescription("opcodes", "opcodes to enable in the interpreter", [
            BoolOption("CALL_METHOD",
                       "emit a special bytecode for expr.name()",
                       default=False),
        ]),
        BoolOption("nofaking",
                   "disallow faking in the object space",
                   default=False,
                   requires=[("objspace.usemodules.posix", True),
                             ("objspace.usemodules.time", True),
                             ("objspace.usemodules.errno", True)],
                   cmdline='--nofaking'),
        OptionDescription("usemodules", "Which Modules should be used", [
            BoolOption(modname,