# HG changeset patch # User Thomas Wuerthinger # Date 1362498214 -3600 # Node ID 57726bff1d9f707b9f27d88c33fd376144242cfd # Parent fe64b5da82291675dc9afd3e350f0cedd08a30a6# Parent 9e3c0d8bca65fa531c27f0acdec0796b9d41b6e9 Merge. diff -r fe64b5da8229 -r 57726bff1d9f graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Tue Mar 05 16:43:26 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Tue Mar 05 16:43:34 2013 +0100 @@ -152,10 +152,8 @@ ((StructuredGraph) graph()).removeSplit(this, falseSuccessor()); } } else if (trueSuccessor().guards().isEmpty() && falseSuccessor().guards().isEmpty()) { - if (removeOrMaterializeIf(tool)) { - return; - } else if (removeIntermediateMaterialization(tool)) { - return; + if (!removeOrMaterializeIf(tool)) { + removeIntermediateMaterialization(tool); } } } diff -r fe64b5da8229 -r 57726bff1d9f graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg Tue Mar 05 16:43:26 2013 +0100 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/parser/SimpleLanguage.atg Tue Mar 05 16:43:34 2013 +0100 @@ -131,16 +131,16 @@ | NumericLiteral | - Ternary + Ternary | "(" Expression ")" ) . -Ternary (. TypedNode condition, thenPart, elsePart; .) +Ternary (. TypedNode condition, thenPart, elsePart; .) = "#" Expression "?" Expression ":" Expression - (. result = factory.createTernary(condition, thenPart, elsePart); .) + (. result = factory.createTernary(condition, thenPart, elsePart); .) . TimeRef diff -r fe64b5da8229 -r 57726bff1d9f mx/commands.py --- a/mx/commands.py Tue Mar 05 16:43:26 2013 +0100 +++ b/mx/commands.py Tue Mar 05 16:43:34 2013 +0100 @@ -1096,20 +1096,6 @@ mx.abort('jacocoreport takes only one argument : an output directory') mx.run_java(['-jar', jacocoreport.get_path(True), '-in', 'jacoco.exec', '-g', join(_graal_home, 'graal'), out]) -def jar(args): - parser = ArgumentParser(prog='mx jar'); - parser.add_argument('projects', nargs=REMAINDER, metavar='projects...') - args = parser.parse_args(args) - - if not args.projects: - mx.abort('Please specify at least one project to jar.') - - for pname in args.projects: - p = mx.project(pname, fatalIfMissing=True) - outputDir = p.output_dir() - targetJar = join(p.dir, p.name + '.jar') - mx.jar(targetJar, [outputDir]) - def site(args): """create a website containing javadoc and the project dependency graph""" @@ -1136,7 +1122,6 @@ 'dacapo': [dacapo, '[[n] benchmark] [VM options|@DaCapo options]'], 'scaladacapo': [scaladacapo, '[[n] benchmark] [VM options|@Scala DaCapo options]'], 'specjvm2008': [specjvm2008, '[VM options|@specjvm2008 options]'], - 'jar': [jar, '[-options]'], #'example': [example, '[-v] example names...'], 'gate' : [gate, '[-options]'], 'gv' : [gv, ''], diff -r fe64b5da8229 -r 57726bff1d9f mxtool/mx.py --- a/mxtool/mx.py Tue Mar 05 16:43:26 2013 +0100 +++ b/mxtool/mx.py Tue Mar 05 16:43:34 2013 +0100 @@ -1575,7 +1575,7 @@ return 0 def processorjars(): - projects = set([]) + projects = set() for p in sorted_deps(): if _needsEclipseJarBuild(p): @@ -1584,50 +1584,39 @@ if len(projects) <= 0: return - build(['--projects', ",".join(map(lambda p: p.name, projects))]) - - for p in projects: - targetJar = join(p.dir, p.name + '.jar') - jar(targetJar, [p.output_dir()]) - - -def jar(destFileName, dirs): - latestMod = _latestModification(dirs) + pnames = [p.name for p in projects] + build(['--projects', ",".join(pnames)]) + jarprojects(pnames) + +def jarprojects(args): + """create jar files for the output of one or more projects""" + parser = ArgumentParser(prog='mx jar'); + parser.add_argument('-d', '--dest', help='single jar file to create') + parser.add_argument('projects', nargs=REMAINDER, metavar='projects...') + args = parser.parse_args(args) - if exists(destFileName): - mod = os.path.getmtime(destFileName) - if int(round(latestMod*1000)) == int(round(mod*1000)): - # nothing todo - return - - if latestMod is None and exists(destFileName): - return - - jarCmd = [java().jar, 'cf', destFileName] + if not args.projects: + args.projects = [p.name for p in projects()] + + if args.dest is not None: + zf = zipfile.ZipFile(args.dest, 'w') - for directory in dirs: - jarCmd += ['-C', directory, '.'] - - subprocess.check_call(jarCmd) - log('Written jar file {0}'.format(destFileName)) - - atime = os.path.getatime(destFileName) - os.utime(destFileName, (atime, latestMod)) - -def _latestModification(directories): - latestMod = None - for directory in directories: - if not os.path.exists (directory): - continue - for root, _, files in os.walk(directory): - for names in files: - filepath = os.path.join(root, names) - mod = os.path.getmtime(filepath) - if latestMod is None: - latestMod = mod - elif mod > latestMod: - latestMod = mod - return latestMod + for pname in args.projects: + p = project(pname, fatalIfMissing=True) + if args.dest is None: + jar = join(p.dir, p.name + '.jar') + zf = zipfile.ZipFile(jar, 'w') + outputDir = p.output_dir() + for root, _, files in os.walk(outputDir): + for f in files: + relpath = root[len(outputDir) + 1:] + arcname = join(relpath, f).replace(os.sep, '/') + zf.write(join(root, f), arcname) + if args.dest is None: + zf.close() + + if args.dest is not None: + zf.close() def canonicalizeprojects(args): """process all project files to canonicalize the dependencies @@ -2213,7 +2202,7 @@ def _genEclipseJarBuild(p): builders = [] - builders.append(_genEclipseLaunch(p, 'Jar.launch', ''.join(['jar ', p.name]), refresh = False, async = False)) + builders.append(_genEclipseLaunch(p, 'Jar.launch', ''.join(['jarprojects ', p.name]), refresh = False, async = False)) builders.append(_genEclipseLaunch(p, 'Refresh.launch', '', refresh = True, async = True)) return builders @@ -2967,6 +2956,7 @@ 'help': [help_, '[command]'], 'ideclean': [ideclean, ''], 'ideinit': [ideinit, ''], + 'jarprojects': [jarprojects, '[options]'], 'projectgraph': [projectgraph, ''], 'javap': [javap, ''], 'javadoc': [javadoc, '[options]'],