Mercurial > hg > truffle
comparison mx/mx_graal.py @ 16610:8cdb9ef96c01
make up-to-date check for generated sources work with --installed-jdks
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 29 Jul 2014 16:53:42 +0200 |
parents | c55478e640e1 |
children | a4b7356f4a2b |
comparison
equal
deleted
inserted
replaced
16609:add3510d087b | 16610:8cdb9ef96c01 |
---|---|
489 if not exists(hsSrcGenDir): | 489 if not exists(hsSrcGenDir): |
490 os.makedirs(hsSrcGenDir) | 490 os.makedirs(hsSrcGenDir) |
491 return hsSrcGenDir | 491 return hsSrcGenDir |
492 | 492 |
493 | 493 |
494 def _graalRuntime_inline_hpp_path(): | |
495 return join(_makeHotspotGeneratedSourcesDir(), 'graalRuntime.inline.hpp') | |
496 | |
497 def _update_graalRuntime_inline_hpp(graalJar): | 494 def _update_graalRuntime_inline_hpp(graalJar): |
498 p = mx.project('com.oracle.graal.hotspot.sourcegen') | 495 p = mx.project('com.oracle.graal.hotspot.sourcegen') |
499 mainClass = 'com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp' | 496 mainClass = 'com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp' |
500 if exists(join(p.output_dir(), mainClass.replace('.', os.sep) + '.class')): | 497 if exists(join(p.output_dir(), mainClass.replace('.', os.sep) + '.class')): |
501 graalRuntime_inline_hpp = _graalRuntime_inline_hpp_path() | 498 graalRuntime_inline_hpp = join(_makeHotspotGeneratedSourcesDir(), 'graalRuntime.inline.hpp') |
502 tmp = StringIO.StringIO() | 499 tmp = StringIO.StringIO() |
503 mx.run_java(['-cp', '{}{}{}'.format(graalJar, os.pathsep, p.output_dir()), mainClass], out=tmp.write) | 500 mx.run_java(['-cp', '{}{}{}'.format(graalJar, os.pathsep, p.output_dir()), mainClass], out=tmp.write) |
504 mx.update_file(graalRuntime_inline_hpp, tmp.getvalue()) | 501 mx.update_file(graalRuntime_inline_hpp, tmp.getvalue()) |
505 | 502 |
506 def _checkVMIsNewerThanGeneratedSources(jdk, vm, bld): | 503 def _checkVMIsNewerThanGeneratedSources(jdk, vm, bld): |
507 if isGraalEnabled(vm): | 504 if isGraalEnabled(vm) and (not _installed_jdks or _installed_jdks == _graal_home): |
508 vmLib = mx.TimeStampFile(join(_vmLibDirInJdk(jdk), vm, mx.add_lib_prefix(mx.add_lib_suffix('jvm')))) | 505 vmLib = mx.TimeStampFile(join(_vmLibDirInJdk(jdk), vm, mx.add_lib_prefix(mx.add_lib_suffix('jvm')))) |
509 for name in ['graalRuntime.inline.hpp', 'HotSpotVMConfig.inline.hpp']: | 506 for name in ['graalRuntime.inline.hpp', 'HotSpotVMConfig.inline.hpp']: |
510 genSrc = join(_makeHotspotGeneratedSourcesDir(), name) | 507 genSrc = join(_makeHotspotGeneratedSourcesDir(), name) |
511 if vmLib.isOlderThan(genSrc): | 508 if vmLib.isOlderThan(genSrc): |
512 mx.log('The VM ' + vmLib.path + ' is older than ' + genSrc) | 509 mx.log('The VM ' + vmLib.path + ' is older than ' + genSrc) |
1069 cp = prefixCp + coreCp + os.pathsep + projectsCp | 1066 cp = prefixCp + coreCp + os.pathsep + projectsCp |
1070 if isGraalEnabled(_get_vm()): | 1067 if isGraalEnabled(_get_vm()): |
1071 graalDist = mx.distribution('GRAAL') | 1068 graalDist = mx.distribution('GRAAL') |
1072 graalJarCp = set([d.output_dir() for d in graalDist.sorted_deps()]) | 1069 graalJarCp = set([d.output_dir() for d in graalDist.sorted_deps()]) |
1073 cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in graalJarCp]) | 1070 cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in graalJarCp]) |
1074 vmArgs = vmArgs + ['-XX:-UseGraalClassLoader'] | 1071 vmArgs = ['-XX:-UseGraalClassLoader'] + vmArgs |
1075 | 1072 |
1076 if len(testclasses) == 1: | 1073 if len(testclasses) == 1: |
1077 # Execute Junit directly when one test is being run. This simplifies | 1074 # Execute Junit directly when one test is being run. This simplifies |
1078 # replaying the VM execution in a native debugger (e.g., gdb). | 1075 # replaying the VM execution in a native debugger (e.g., gdb). |
1079 vm(prefixArgs + vmArgs + ['-cp', cp, 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + testclasses) | 1076 vm(prefixArgs + vmArgs + ['-cp', cp, 'com.oracle.graal.test.GraalJUnitCore'] + coreArgs + testclasses) |