def print_golem_config(options):
    print('// AUTOGENERATED FILE from tools/run_on_app_dump.py in R8 repo')
    print('part of r8_config;')
    print('')
    print('final Suite dumpsSuite = new Suite("OpenSourceAppDumps");')
    print('')
    print('createOpenSourceAppBenchmarks() {')
    print_indented('final cpus = ["Lenovo M90"];', 2)
    # Avoid calculating this for every app
    jdk_gz = jdk.GetJdkHome() + '.tar.gz'
    download_sha(jdk_gz + '.sha1', False, quiet=True)
    jdk_sha256 = get_sha256(jdk_gz)
    for app in options.apps:
        if app.folder and not app.internal:
            indentation = 2
            print_indented('{', indentation)
            indentation = 4
            print_indented('final name = "%s";' % app.name, indentation)
            print_indented('final benchmark =', indentation)
            print_indented(
                'new StandardBenchmark(name, [Metric.RunTimeRaw, Metric.CodeSize]);',
                indentation + 4)
            print_indented(
                'final options = benchmark.addTargets(noImplementation, ["R8"]);',
                indentation)
            print_indented('options.cpus = cpus;', indentation)
            print_indented('options.isScript = true;', indentation)
            print_indented('options.fromRevision = 9700;', indentation)
            print_indented('options.mainFile = "tools/run_on_app_dump.py "',
                           indentation)
            print_indented('"--golem --shrinker r8 --app %s";' % app.name,
                           indentation + 4)

            app_gz = os.path.join(utils.OPENSOURCE_DUMPS_DIR,
                                  app.folder + '.tar.gz')
            add_golem_resource(indentation, app_gz, 'app_resource')
            add_golem_resource(indentation,
                               jdk_gz,
                               'openjdk',
                               sha256=jdk_sha256)

            print_indented('dumpsSuite.addBenchmark(name);', indentation)
            indentation = 2
            print_indented('}', indentation)
    print('}')
Beispiel #2
0
Datei: gradle.py Projekt: qssq/r8
def EnsureJdk():
    jdkHome = jdk.GetJdkHome()
    jdkTgz = jdkHome + '.tar.gz'
    jdkSha1 = jdkTgz + '.sha1'
    utils.EnsureDepFromGoogleCloudStorage(jdkHome, jdkTgz, jdkSha1, 'JDK')
Beispiel #3
0
Datei: gradle.py Projekt: qssq/r8
def GetJavaEnv(env):
    java_env = dict(env if env else os.environ, JAVA_HOME=jdk.GetJdkHome())
    java_env['PATH'] = java_env['PATH'] + os.pathsep + os.path.join(
        jdk.GetJdkHome(), 'bin')
    return java_env