comparison mx/commands.py @ 8135:8d10fc6b4f6c

graal.jar is now the only way Graal is deployed in the VM (GRAAL-136)
author Doug Simon <doug.simon@oracle.com>
date Wed, 06 Mar 2013 20:48:32 +0100
parents 6e3ebc6fd5a4
children 9786ac8fff61 0934903d28f3
comparison
equal deleted inserted replaced
8134:6e3ebc6fd5a4 8135:8d10fc6b4f6c
498 498
499 def filterXusage(line): 499 def filterXusage(line):
500 if not 'Xusage.txt' in line: 500 if not 'Xusage.txt' in line:
501 sys.stderr.write(line + os.linesep) 501 sys.stderr.write(line + os.linesep)
502 502
503 # Check that the declaration of graal_projects in arguments.cpp is up to date
504 argumentsCpp = join(_graal_home, 'src', 'share', 'vm', 'runtime', 'arguments.cpp')
505 assert exists(argumentsCpp), 'File does not exist: ' + argumentsCpp
506 with open(argumentsCpp) as fp:
507 source = fp.read();
508 decl = 'const char* graal_projects[] = {'
509 start = source.find(decl)
510 assert start != -1, 'Could not find "' + decl + '" in ' + fp.name
511 end = source.find('};', start)
512 assert end != -1, 'Could not find "' + decl + '" ... "};" in ' + fp.name
513 actual = frozenset(re.findall(r'"([^"]+)"', source[start + len(decl):end]))
514 expected = frozenset([p.name for p in mx.project('com.oracle.graal.hotspot.' + _arch()).all_deps([], False)])
515 missing = expected - actual
516 extra = actual - expected
517 if len(missing) != 0:
518 mx.abort(fp.name + ':' + str(source[:start].count('\n') + 1) + ': add missing project(s) to declaration:\n ' + '\n '.join(missing))
519 if len(extra) != 0:
520 mx.abort(fp.name + ':' + str(source[:start].count('\n') + 1) + ': remove project(s) from declaration:\n ' + '\n '.join(extra))
521
522 # Check if a build really needs to be done 503 # Check if a build really needs to be done
523 timestampFile = join(vmDir, '.build-timestamp') 504 timestampFile = join(vmDir, '.build-timestamp')
524 if opts2.force or not exists(timestampFile): 505 if opts2.force or not exists(timestampFile):
525 mustBuild = True 506 mustBuild = True
526 else: 507 else:
667 } 648 }
668 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args 649 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args
669 if '-d64' not in args: 650 if '-d64' not in args:
670 args = ['-d64'] + args 651 args = ['-d64'] + args
671 652
672 graalJar = join(_graal_home, 'graal.jar')
673 if exists(graalJar):
674 args = ['-XX:GraalClassPath=' + graalJar] + args
675 exe = join(jdk, 'bin', mx.exe_suffix('java')) 653 exe = join(jdk, 'bin', mx.exe_suffix('java'))
676 dbg = _native_dbg.split() if _native_dbg is not None else [] 654 dbg = _native_dbg.split() if _native_dbg is not None else []
677 return mx.run(dbg + [exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) 655 return mx.run(dbg + [exe, '-' + vm] + args, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
678 656
679 def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False): 657 def _find_classes_with_annotations(p, pkgRoot, annotations, includeInnerClasses=False):