# HG changeset patch # User Doug Simon # Date 1399930048 -7200 # Node ID d556971b409ca9f5ff13900d8b7b82549fd1f17a # Parent b7fb36e57da85206f01101918db6ffd9b66706c9# Parent 4aeb0b80324f86bb12976dbb3964e15929c5c718 Merge. diff -r b7fb36e57da8 -r d556971b409c CHANGELOG.md --- a/CHANGELOG.md Mon May 12 23:27:07 2014 +0200 +++ b/CHANGELOG.md Mon May 12 23:27:28 2014 +0200 @@ -5,6 +5,7 @@ * Made initialization of Graal runtime lazy in hosted mode. ### Truffle +* `truffle.jar`: strip out build-time only dependency into a seperated JAR file (`truffle-dsl-processor.jar`) * ... ## Version 0.3 @@ -74,4 +75,3 @@ * Initial version of a multi-language framework on top of Graal. * Update of the [Truffle Inlining API](http://mail.openjdk.java.net/pipermail/graal-dev/2014-January/001516.html). - diff -r b7fb36e57da8 -r d556971b409c graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Mon May 12 23:27:07 2014 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Mon May 12 23:27:28 2014 +0200 @@ -83,32 +83,56 @@ } private class KillSet implements Iterable { - private final Set set; + private List list; public KillSet() { - this.set = new ArraySet<>(); + list = null; } public KillSet(KillSet other) { - this.set = new HashSet<>(other.set); + if (other.list != null && other.list.size() > 0) { + list = new ArrayList<>(other.list); + } + } + + private void initSet() { + if (list == null) { + list = new ArrayList<>(4); + } } public void add(LocationIdentity locationIdentity) { - set.add(locationIdentity); + if (list == null || !list.contains(locationIdentity)) { + initSet(); + list.add(locationIdentity); + } } public void addAll(KillSet other) { - set.addAll(other.set); + if (other.list == null) { + return; + } + initSet(); + for (LocationIdentity locationIdentity : other) { + if (!list.contains(locationIdentity)) { + list.add(locationIdentity); + } + } } public Iterator iterator() { - return set.iterator(); + if (list == null) { + return Collections.emptyIterator(); + } + return list.iterator(); } public boolean isKilled(LocationIdentity locationIdentity) { - return set.contains(locationIdentity); + if (list == null) { + return false; + } + return list.contains(locationIdentity); } - } private class NewMemoryScheduleClosure extends BlockIteratorClosure { diff -r b7fb36e57da8 -r d556971b409c graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/ArraySet.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/ArraySet.java Mon May 12 23:27:07 2014 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/ArraySet.java Mon May 12 23:27:28 2014 +0200 @@ -47,7 +47,7 @@ public boolean add(E e) { // avoid duplicated entries if (contains(e)) { - return true; + return false; } return super.add(e); } diff -r b7fb36e57da8 -r d556971b409c mx/projects --- a/mx/projects Mon May 12 23:27:07 2014 +0200 +++ b/mx/projects Mon May 12 23:27:28 2014 +0200 @@ -87,7 +87,7 @@ distribution@TRUFFLE-DSL-PROCESSOR@sourcesPath=truffle-dsl-processor-sources.jar distribution@TRUFFLE-DSL-PROCESSOR@dependencies=\ com.oracle.truffle.dsl.processor -distribution@TRUFFLE-DSL-PROCESSOR@exclude=com.oracle.truffle.api.dsl,com.oracle.truffle.api +distribution@TRUFFLE-DSL-PROCESSOR@distDependency=TRUFFLE # graal.api.collections project@com.oracle.graal.api.collections@subDir=graal diff -r b7fb36e57da8 -r d556971b409c mxtool/mx.py --- a/mxtool/mx.py Mon May 12 23:27:07 2014 +0200 +++ b/mxtool/mx.py Mon May 12 23:27:28 2014 +0200 @@ -62,7 +62,7 @@ A distribution is a jar or zip file containing the output from one or more Java projects. """ class Distribution: - def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies): + def __init__(self, suite, name, path, sourcesPath, deps, excludedDependencies, distDependency): self.suite = suite self.name = name self.path = path.replace('/', os.sep) @@ -71,6 +71,7 @@ self.deps = deps self.update_listeners = set() self.excludedDependencies = excludedDependencies + self.distDependency = distDependency def sorted_deps(self, includeLibs=False): try: @@ -124,6 +125,11 @@ srcArc.zf.writestr(arcname, lp.read(arcname)) else: p = dep + + if self.distDependency and p in _dists[self.distDependency].sorted_deps(): + logv("Excluding {0} from {1} because it's provided by the dependency {2}".format(p.name, self.path, self.distDependency)) + continue + # skip a Java project if its Java compliance level is "higher" than the configured JDK jdk = java(p.javaCompliance) if not jdk: @@ -749,7 +755,8 @@ sourcesPath = attrs.pop('sourcesPath', None) deps = pop_list(attrs, 'dependencies') exclDeps = pop_list(attrs, 'exclude') - d = Distribution(self, name, path, sourcesPath, deps, exclDeps) + distDep = attrs.pop('distDependency', None) + d = Distribution(self, name, path, sourcesPath, deps, exclDeps, distDep) d.__dict__.update(attrs) self.dists.append(d)