Mercurial > hg > graal-jvmci-8
changeset 16024:6b1bd708e254
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 04 Jun 2014 23:43:49 +0200 |
parents | 774349ad0b03 (diff) 9f25b70d6113 (current diff) |
children | 5c70a97bc5cc e497100e1fbf |
files | |
diffstat | 3 files changed, 44 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/mx/mx_graal.py Wed Jun 04 13:53:34 2014 -0700 +++ b/mx/mx_graal.py Wed Jun 04 23:43:49 2014 +0200 @@ -737,26 +737,35 @@ return else: cpus = multiprocessing.cpu_count() - runCmd = [mx.gmake_cmd()] - runCmd.append(build + buildSuffix) + makeDir = join(_graal_home, 'make') + runCmd = [mx.gmake_cmd(), '-C', makeDir] + env = os.environ.copy() + # These must be passed as environment variables + env.setdefault('LANG', 'C') + env['JAVA_HOME'] = jdk + + def setMakeVar(name, default, env=None): + """Sets a make variable on the command line to the value + of the variable in 'env' with the same name if defined + and 'env' is not None otherwise to 'default' + """ + runCmd.append(name + '=' + (env.get(name, default) if env else default)) + if opts2.D: for nv in opts2.D: name, value = nv.split('=', 1) - env[name.strip()] = value - - env.setdefault('ARCH_DATA_MODEL', '64') - env.setdefault('LANG', 'C') - env.setdefault('HOTSPOT_BUILD_JOBS', str(cpus)) - env.setdefault('ALT_BOOTDIR', mx.java().jdk) + setMakeVar(name.strip(), value) - if not mx._opts.verbose: - runCmd.append('MAKE_VERBOSE=') - env['JAVA_HOME'] = jdk + setMakeVar('ARCH_DATA_MODEL', '64', env=env) + setMakeVar('HOTSPOT_BUILD_JOBS', str(cpus), env=env) + setMakeVar('ALT_BOOTDIR', mx.java().jdk, env=env) + + setMakeVar('MAKE_VERBOSE', 'y' if mx._opts.verbose else '') if vm.endswith('nograal'): - env['INCLUDE_GRAAL'] = 'false' - env.setdefault('ALT_OUTPUTDIR', join(_graal_home, 'build-nograal', mx.get_os())) + setMakeVar('INCLUDE_GRAAL', 'false') + setMakeVar('ALT_OUTPUTDIR', join(_graal_home, 'build-nograal', mx.get_os()), env=env) else: # extract latest release tag for graal try: @@ -768,34 +777,39 @@ if tags: # extract the most recent tag tag = sorted(tags, key=lambda e: [int(x) for x in e[len("graal-"):].split('.')], reverse=True)[0] - env.setdefault('USER_RELEASE_SUFFIX', tag) - env.setdefault('GRAAL_VERSION', tag[len("graal-"):]) + setMakeVar('USER_RELEASE_SUFFIX', tag) + setMakeVar('GRAAL_VERSION', tag[len("graal-"):]) else: version = 'unknown-{}-{}'.format(platform.node(), time.strftime('%Y-%m-%d_%H-%M-%S_%Z')) - env.setdefault('USER_RELEASE_SUFFIX', 'graal-' + version) - env.setdefault('GRAAL_VERSION', version) - env['INCLUDE_GRAAL'] = 'true' - env.setdefault('INSTALL', 'y') + setMakeVar('USER_RELEASE_SUFFIX', 'graal-' + version) + setMakeVar('GRAAL_VERSION', version) + setMakeVar('INCLUDE_GRAAL', 'true') + setMakeVar('INSTALL', 'y', env=env) if mx.get_os() == 'solaris': # If using sparcWorks, setup flags to avoid make complaining about CC version cCompilerVersion = subprocess.Popen('CC -V', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stderr.readlines()[0] if cCompilerVersion.startswith('CC: Sun C++'): compilerRev = cCompilerVersion.split(' ')[3] - env.setdefault('ENFORCE_COMPILER_REV', compilerRev) - env.setdefault('ENFORCE_CC_COMPILER_REV', compilerRev) + setMakeVar('ENFORCE_COMPILER_REV', compilerRev, env=env) + setMakeVar('ENFORCE_CC_COMPILER_REV', compilerRev, env=env) if build == 'jvmg': - # I want ALL the symbols when I'm debugging on Solaris - # Some Makefile variable are overloaded by environment variable so we need to explicitely - # pass them down in the command line. This one is an example of that. - runCmd.append('STRIP_POLICY=no_strip') + # We want ALL the symbols when debugging on Solaris + setMakeVar('STRIP_POLICY', 'no_strip') # This removes the need to unzip the *.diz files before debugging in gdb - env.setdefault('ZIP_DEBUGINFO_FILES', '0') + setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) # Clear these 2 variables as having them set can cause very confusing build problems env.pop('LD_LIBRARY_PATH', None) env.pop('CLASSPATH', None) - mx.run(runCmd, cwd=join(_graal_home, 'make'), err=filterXusage, env=env) + if mx._opts.verbose: + # Issue an env prefix that can be used to run the make on the command line + envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) + if len(envPrefix): + mx.log('env ' + envPrefix + ' \\') + + runCmd.append(build + buildSuffix) + mx.run(runCmd, err=filterXusage, env=env) jvmCfg = _vmCfgInJdk(jdk) if not exists(jvmCfg):
--- a/src/share/vm/runtime/compilationPolicy.cpp Wed Jun 04 13:53:34 2014 -0700 +++ b/src/share/vm/runtime/compilationPolicy.cpp Wed Jun 04 23:43:49 2014 +0200 @@ -203,7 +203,7 @@ // - if neither is defined - always return zero. int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); -#ifdef COMPILER2 +#if defined(COMPILER2) || defined(COMPILERGRAAL) if (is_c2_compile(comp_level)) { return _compiler_count; } else {
--- a/src/share/vm/runtime/thread.hpp Wed Jun 04 13:53:34 2014 -0700 +++ b/src/share/vm/runtime/thread.hpp Wed Jun 04 23:43:49 2014 +0200 @@ -1882,6 +1882,8 @@ #ifdef COMPILERGRAAL virtual bool can_call_java() const; +#else + virtual bool can_call_java() const { return false; } #endif // Hide this compiler thread from external view.