changeset 15604:d556971b409c

Merge.
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 May 2014 23:27:28 +0200
parents b7fb36e57da8 (current diff) 4aeb0b80324f (diff)
children 357e7202de5b 8df3b6d4a035
files CHANGELOG.md
diffstat 5 files changed, 44 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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).
-
--- 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<LocationIdentity> {
-        private final Set<LocationIdentity> set;
+        private List<LocationIdentity> 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<LocationIdentity> 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<KillSet> {
--- 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);
     }
--- 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
--- 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)