# HG changeset patch # User Doug Simon # Date 1381422369 -7200 # Node ID 6aef5b6bbdd88ed4ab24c5c12724e21fea7da544 # Parent e6fd83e09082936185547c4e121ccf7658e482e4# Parent 7e5cf369559f9ced2448c809efecbc7a934ef25b Merge. diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java --- a/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java Thu Oct 10 18:26:09 2013 +0200 @@ -104,7 +104,7 @@ boolean isStatic = Modifier.isStatic(compiledMethod.getModifiers()); Object[] executeArgs = argsWithReceiver((isStatic ? null : this), args); HotSpotRuntime hsr = (HotSpotRuntime) getCodeCache(); - InstalledCode installedCode = hsr.addExternalMethod(compiledMethod, result, sg); + InstalledCode installedCode = hsr.addExternalMethod(compiledMethod, result); Annotation[][] params = compiledMethod.getParameterAnnotations(); int dimensionX = 1; diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Thu Oct 10 18:26:09 2013 +0200 @@ -48,7 +48,7 @@ @Override protected InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; - HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, true, null); + HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, true); HotSpotCompiledNmethod compiledNmethod = new HotSpotCompiledNmethod(hsMethod, StructuredGraph.INVOCATION_ENTRY_BCI, compResult); CodeInstallResult result = graalRuntime().getCompilerToVM().installCode(compiledNmethod, installedCode, null); Assert.assertEquals("Error installing method " + method + ": " + result, result, CodeInstallResult.OK); diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotNmethod.java Thu Oct 10 18:26:09 2013 +0200 @@ -28,7 +28,6 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; -import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.bridge.*; /** @@ -47,20 +46,17 @@ private final HotSpotResolvedJavaMethod method; private final boolean isDefault; private final boolean isExternal; - private final Graph graph; - public HotSpotNmethod(HotSpotResolvedJavaMethod method, boolean isDefault, Graph graph) { + public HotSpotNmethod(HotSpotResolvedJavaMethod method, boolean isDefault) { this.method = method; this.isDefault = isDefault; this.isExternal = false; - this.graph = graph; } - public HotSpotNmethod(HotSpotResolvedJavaMethod method, boolean isDefault, boolean isExternal, Graph graph) { + public HotSpotNmethod(HotSpotResolvedJavaMethod method, boolean isDefault, boolean isExternal) { this.method = method; this.isDefault = isDefault; this.isExternal = isExternal; - this.graph = graph; } public boolean isDefault() { @@ -71,10 +67,6 @@ return isExternal; } - public Graph getGraph() { - return graph; - } - @Override public ResolvedJavaMethod getMethod() { return method; diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu Oct 10 18:26:09 2013 +0200 @@ -1095,20 +1095,15 @@ } public HotSpotInstalledCode installMethod(HotSpotResolvedJavaMethod method, int entryBCI, CompilationResult compResult) { - HotSpotInstalledCode installedCode = new HotSpotNmethod(method, true, null); + HotSpotInstalledCode installedCode = new HotSpotNmethod(method, true); graalRuntime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(method, entryBCI, compResult), installedCode, method.getSpeculationLog()); return installedCode; } @Override public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult) { - return addMethod(method, compResult, null); - } - - @Override - public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph) { HotSpotResolvedJavaMethod hotspotMethod = (HotSpotResolvedJavaMethod) method; - HotSpotInstalledCode code = new HotSpotNmethod(hotspotMethod, false, graph); + HotSpotInstalledCode code = new HotSpotNmethod(hotspotMethod, false); CodeInstallResult result = graalRuntime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(hotspotMethod, -1, compResult), code, null); if (result != CodeInstallResult.OK) { return null; @@ -1116,12 +1111,10 @@ return code; } - public InstalledCode addExternalMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph) { - - // compResult.getTargetCode() == assembled PTX method string + public InstalledCode addExternalMethod(ResolvedJavaMethod method, CompilationResult compResult) { HotSpotResolvedJavaMethod javaMethod = (HotSpotResolvedJavaMethod) method; - HotSpotInstalledCode icode = new HotSpotNmethod(javaMethod, false, true, graph); + HotSpotInstalledCode icode = new HotSpotNmethod(javaMethod, false, true); HotSpotCompiledNmethod compiled = new HotSpotCompiledNmethod(javaMethod, -1, compResult); CompilerToVM vm = graalRuntime.getCompilerToVM(); CodeInstallResult result = vm.installCode(compiled, icode, null); diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/DelegatingGraalCodeCacheProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/DelegatingGraalCodeCacheProvider.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/DelegatingGraalCodeCacheProvider.java Thu Oct 10 18:26:09 2013 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.spi; import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; @@ -42,10 +41,6 @@ return (GraalCodeCacheProvider) super.delegate(); } - public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph) { - return delegate().addMethod(method, compResult, graph); - } - public void lower(Node n, LoweringTool tool) { delegate().lower(n, tool); } diff -r 7e5cf369559f -r 6aef5b6bbdd8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java Thu Oct 10 17:07:11 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java Thu Oct 10 18:26:09 2013 +0200 @@ -23,7 +23,6 @@ package com.oracle.graal.nodes.spi; import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; @@ -33,23 +32,11 @@ */ public interface GraalCodeCacheProvider extends CodeCacheProvider { - /** - * Adds the given compilation result as an implementation of the given method without making it - * the default implementation. The graph might be inlined later on. - * - * @param method a method to which the executable code is begin added - * @param compResult the compilation result to be added - * @param graph the graph that represents the method - * @return a reference to the compiled and ready-to-run code or null if the code installation - * failed - */ - InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, Graph graph); - void lower(Node n, LoweringTool tool); /** - * Reconstructs the array index from a location node that was created as a lowering of an indexed - * access to an array. + * Reconstructs the array index from a location node that was created as a lowering of an + * indexed access to an array. * * @param location a location pointing to an element in an array * @return a node that gives the index of the element diff -r 7e5cf369559f -r 6aef5b6bbdd8 mx/commands.py --- a/mx/commands.py Thu Oct 10 17:07:11 2013 +0200 +++ b/mx/commands.py Thu Oct 10 18:26:09 2013 +0200 @@ -951,12 +951,14 @@ with VM('graal', 'product'): t = Task('BootstrapWithGCVerification:product') - vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version']) + out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write + vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) tasks.append(t.stop()) with VM('graal', 'product'): t = Task('BootstrapWithG1GCVerification:product') - vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+UseNewCode', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version']) + out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write + vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+UseNewCode', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) tasks.append(t.stop()) with VM('graal', 'product'): diff -r 7e5cf369559f -r 6aef5b6bbdd8 mxtool/mx.py --- a/mxtool/mx.py Thu Oct 10 17:07:11 2013 +0200 +++ b/mxtool/mx.py Thu Oct 10 18:26:09 2013 +0200 @@ -158,7 +158,7 @@ _mainSuite = None _opts = None _java = None -_check_global_structures = True # can be set False to allow suites with duplicate definitions to load without aborting +_check_global_structures = True # can be set False to allow suites with duplicate definitions to load without aborting """ @@ -1277,6 +1277,36 @@ return name """ +Utility for filtering duplicate lines. +""" +class DuplicateSuppressingStream: + """ + Creates an object that will suppress duplicate lines sent to 'out'. + The lines considered for suppression are those that contain one of the + strings in 'restrictTo' if it is not None. + """ + def __init__(self, restrictTo=None, out=sys.stdout): + self.restrictTo = restrictTo + self.seen = set() + self.out = out + + def isSuppressionCandidate(self, line): + if self.restrictTo: + for p in self.restrictTo: + if p in line: + return True + return False + else: + return True + + def write(self, line): + if self.isSuppressionCandidate(line): + if line in self.seen: + return + self.seen.add(line) + self.out.write(line) + +""" A JavaCompliance simplifies comparing Java compliance values extracted from a JDK version string. """ class JavaCompliance: @@ -2518,7 +2548,7 @@ return if buildProcessorJars: - ## todo suite specific + # todo suite specific processorjars() projToDist = dict() @@ -2810,7 +2840,7 @@ if exists(md): return wsdir split = os.path.split(wsdir) - if split[0] == wsdir: # root directory + if split[0] == wsdir: # root directory return None else: return _find_eclipse_wsroot(split[0])