Mercurial > hg > truffle
diff mx/mx_graal.py @ 15916:6aa352b260f4
removed use of ServiceLoader in runtime initialization
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 26 May 2014 18:55:06 +0200 |
parents | db776f9bea7c |
children | 7c84f0ce7cae |
line wrap: on
line diff
--- a/mx/mx_graal.py Mon May 26 17:44:19 2014 +0200 +++ b/mx/mx_graal.py Mon May 26 18:55:06 2014 +0200 @@ -484,27 +484,21 @@ if exists(toDelete): os.unlink(toDelete) -def _update_HotSpotOptions_inline_hpp(graalJar): - p = mx.project('com.oracle.graal.hotspot') - mainClass = 'com.oracle.graal.hotspot.HotSpotOptionsLoader' - assert exists(join(p.source_dirs()[0], mainClass.replace('.', os.sep) + '.java')) - - def mainClassExists(): - with zipfile.ZipFile(graalJar, 'r') as zf: - mainClassFile = mainClass.replace('.', '/') + '.class' - return mainClassFile in zf.namelist() - - if mainClassExists(): - hsSrcGenDir = join(p.source_gen_dir(), 'hotspot') +def _update_graalRuntime_inline_hpp(graalJar): + p = mx.project('com.oracle.graal.hotspot.codegen') + mainClass = 'com.oracle.graal.hotspot.codegen.GenGraalRuntimeInlineHpp' + if exists(join(p.output_dir(), mainClass.replace('.', os.sep) + '.class')): + hsSrcGenDir = join(mx.project('com.oracle.graal.hotspot').source_gen_dir(), 'hotspot') if not exists(hsSrcGenDir): os.makedirs(hsSrcGenDir) + tmp = StringIO.StringIO() - mx.run_java(['-cp', graalJar, mainClass], out=tmp.write) - mx.update_file(join(hsSrcGenDir, 'HotSpotOptions.inline.hpp'), tmp.getvalue()) + mx.run_java(['-cp', '{}{}{}'.format(graalJar, os.pathsep, p.output_dir()), mainClass], out=tmp.write) + mx.update_file(join(hsSrcGenDir, 'graalRuntime.inline.hpp'), tmp.getvalue()) def _installGraalJarInJdks(graalDist): graalJar = graalDist.path - _update_HotSpotOptions_inline_hpp(graalJar) + _update_graalRuntime_inline_hpp(graalJar) jdks = _jdksDir() if exists(jdks):