# HG changeset patch # User Christian Wirth # Date 1412853571 -7200 # Node ID 0e120f2819ce7f0700daf8a0b726c3834e45f110 # Parent 538cbc117324e25d810bb432ab18dcd06ef7cc5b# Parent 07462ba5a12aa46eb4e2f43af3d5f83fe95930e8 Merged diff -r 538cbc117324 -r 0e120f2819ce graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java Thu Oct 09 13:19:11 2014 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java Thu Oct 09 13:19:31 2014 +0200 @@ -42,7 +42,7 @@ */ public BailoutException(String format, Object... args) { super(String.format(Locale.ENGLISH, format, args)); - this.permanent = false; + this.permanent = true; } /** diff -r 538cbc117324 -r 0e120f2819ce 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 Thu Oct 09 13:19:11 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Thu Oct 09 13:19:31 2014 +0200 @@ -49,6 +49,8 @@ @NodeInfo public class IfNode extends ControlSplitNode implements Simplifiable, LIRLowerable { + private static final DebugMetric CORRECTED_PROBABILITIES = Debug.metric("CorrectedProbabilities"); + @Successor BeginNode trueSuccessor; @Successor BeginNode falseSuccessor; @Input(InputType.Condition) LogicNode condition; @@ -147,6 +149,18 @@ @Override public void simplify(SimplifierTool tool) { + if (trueSuccessor().next() instanceof DeoptimizeNode) { + if (trueSuccessorProbability != 0) { + CORRECTED_PROBABILITIES.increment(); + trueSuccessorProbability = 0; + } + } else if (falseSuccessor().next() instanceof DeoptimizeNode) { + if (trueSuccessorProbability != 1) { + CORRECTED_PROBABILITIES.increment(); + trueSuccessorProbability = 1; + } + } + if (condition() instanceof LogicNegationNode) { BeginNode trueSucc = trueSuccessor(); BeginNode falseSucc = falseSuccessor(); diff -r 538cbc117324 -r 0e120f2819ce graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Thu Oct 09 13:19:11 2014 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Thu Oct 09 13:19:31 2014 +0200 @@ -172,7 +172,7 @@ public CompilationResult compileMethodHelper(StructuredGraph graph, Assumptions assumptions, String name, SpeculationLog speculationLog, InstalledCode predefinedInstalledCode) { try (Scope s = Debug.scope("TruffleFinal")) { - Debug.dump(graph, "After TruffleTier"); + Debug.dump(1, graph, "After TruffleTier"); } catch (Throwable e) { throw Debug.handle(e); } diff -r 538cbc117324 -r 0e120f2819ce graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Thu Oct 09 13:19:11 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Thu Oct 09 13:19:31 2014 +0200 @@ -29,6 +29,7 @@ import java.util.concurrent.*; import com.oracle.truffle.api.*; +import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.source.*; import com.oracle.truffle.api.utilities.*; @@ -39,7 +40,7 @@ private Node parent; - private SourceSection sourceSection; + @CompilationFinal private SourceSection sourceSection; /** * Marks array fields that are children of this node. diff -r 538cbc117324 -r 0e120f2819ce mx/suite.py --- a/mx/suite.py Thu Oct 09 13:19:11 2014 +0200 +++ b/mx/suite.py Thu Oct 09 13:19:31 2014 +0200 @@ -1,3 +1,5 @@ +from suite_helper import maven + suite = { "mxversion" : "1.0", "name" : "graal", @@ -6,14 +8,14 @@ "path" : "lib/junit-4.11.jar", "urls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11.jar", - "http://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11.jar", + maven("junit/junit/4.11/junit-4.11.jar"), ], "sha1" : "4e031bb61df09069aeb2bffb4019e7a5034a4ee0", "eclipse.container" : "org.eclipse.jdt.junit.JUNIT_CONTAINER/4", "sourcePath" : "lib/junit-4.11-sources.jar", "sourceUrls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/junit-4.11-sources.jar", - "http://repo1.maven.org/maven2/junit/junit/4.11/junit-4.11-sources.jar", + maven("junit/junit/4.11/junit-4.11-sources.jar"), ], "sourceSha1" : "28e0ad201304e4a4abf999ca0570b7cffc352c3c", "dependencies" : ["HAMCREST"], @@ -23,13 +25,13 @@ "path" : "lib/hamcrest-core-1.3.jar", "urls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3.jar", - "http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar", + maven("org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"), ], "sha1" : "42a25dc3219429f0e5d060061f71acb49bf010a0", "sourcePath" : "lib/hamcrest-core-1.3-sources.jar", "sourceUrls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/hamcrest-core-1.3-sources.jar", - "http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar", + maven("org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar"), ], "sourceSha1" : "1dc37250fbc78e23a65a67fbbaf71d2e9cbc3c0b", }, @@ -134,14 +136,14 @@ "path" : "lib/asm-5.0.3.jar", "urls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3.jar", - "http://central.maven.org/maven2/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar", + maven("org/ow2/asm/asm/5.0.3/asm-5.0.3.jar"), ], "sha1" : "dcc2193db20e19e1feca8b1240dbbc4e190824fa", "sourcePath" : "lib/asm-5.0.3-sources.jar", "sourceSha1" : "f0f24f6666c1a15c7e202e91610476bd4ce59368", "sourceUrls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/asm-5.0.3-sources.jar", - "http://central.maven.org/maven2/org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar", + maven("org/ow2/asm/asm/5.0.3/asm-5.0.3-sources.jar"), ], }, @@ -157,7 +159,7 @@ "path" : "lib/vecmath-1.3.1.jar", "urls" : [ "http://lafo.ssw.uni-linz.ac.at/graal-external-deps/vecmath-1.3.1.jar", - "http://mirrors.ibiblio.org/pub/mirrors/maven/java3d/jars/vecmath-1.3.1.jar", + maven("java3d/vecmath/1.3.1/vecmath-1.3.1.jar"), ], "sha1" : "a0ae4f51da409fa0c20fa0ca59e6bbc9413ae71d", } diff -r 538cbc117324 -r 0e120f2819ce mx/suite_helper.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mx/suite_helper.py Thu Oct 09 13:19:31 2014 +0200 @@ -0,0 +1,2 @@ +def maven(filepath): + return 'https://search.maven.org/remotecontent?filepath=%s' % filepath diff -r 538cbc117324 -r 0e120f2819ce mxtool/URLConnectionDownload.java --- a/mxtool/URLConnectionDownload.java Thu Oct 09 13:19:11 2014 +0200 +++ b/mxtool/URLConnectionDownload.java Thu Oct 09 13:19:31 2014 +0200 @@ -32,15 +32,51 @@ * @param urls the URLs to try, stopping after the first successful one */ public class URLConnectionDownload { + /** + * Iterate over list of environment variable to find one that correctly specify an proxy. + * + * @param propPrefix indicates which proxy property to set (i.e., http or https) + * @param proxyEnvVariableNames list of environment variable + * @return a string specifying the proxy url + */ + private static String setProxy(String[] proxyEnvVariableNames, String propPrefix) { + String proxy = null; + String proxyEnvVar = ""; + for (String envvar : proxyEnvVariableNames) { + proxy = System.getenv(envvar); + if (proxy != null) { + proxyEnvVar = envvar; + break; + } + } + if (proxy != null) { + Pattern p = Pattern.compile("(?:http://)?([^:]+)(:\\d+)?"); + Matcher m = p.matcher(proxy); + if (m.matches()) { + String host = m.group(1); + String port = m.group(2); + System.setProperty(propPrefix + ".proxyHost", host); + if (port != null) { + port = port.substring(1); // strip ':' + System.setProperty(propPrefix + ".proxyPort", port); + } + return proxy; + } else { + System.err.println("Value of " + proxyEnvVar + " is not valid: " + proxy); + } + } else { + System.err.println("** If behind a firewall without direct internet access, use the " + proxyEnvVariableNames[0] + " environment variable (e.g. 'env " + proxyEnvVariableNames[0] + + "=proxy.company.com:80 max ...') or download manually with a web browser."); + } + return ""; + } - /** - * Downloads content from a given URL to a given file. - * - * @param args - * arg[0] is the path where to write the content. The remainder - * of args are the URLs to try, stopping after the first - * successful one - */ + /** + * Downloads content from a given URL to a given file. + * + * @param args arg[0] is the path where to write the content. The remainder of args are the URLs + * to try, stopping after the first successful one + */ public static void main(String[] args) { File path = new File(args[0]); boolean verbose = args[1].equals("-v"); @@ -50,33 +86,21 @@ File parent = path.getParentFile(); makeDirectory(parent); - + // Enable use of system proxies System.setProperty("java.net.useSystemProxies", "true"); - String proxy = System.getenv("HTTP_PROXY"); - if (proxy == null) { - proxy = System.getenv("http_proxy"); - } - + // Set standard proxy if any + String proxy = setProxy(new String[]{"HTTP_PROXY", "http_proxy"}, "http"); + // Set proxy for secure http if explicitely set, default to http proxy otherwise + String secureProxy = setProxy(new String[]{"HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"}, "https"); String proxyMsg = ""; - if (proxy != null) { - Pattern p = Pattern.compile("(?:http://)?([^:]+)(:\\d+)?"); - Matcher m = p.matcher(proxy); - if (m.matches()) { - String host = m.group(1); - String port = m.group(2); - System.setProperty("http.proxyHost", host); - if (port != null) { - port = port.substring(1); // strip ':' - System.setProperty("http.proxyPort", port); - } - proxyMsg = " via proxy " + proxy; - } else { - System.err.println("Value of HTTP_PROXY is not valid: " + proxy); - } - } else { - System.err.println("** If behind a firewall without direct internet access, use the HTTP_PROXY environment variable (e.g. 'env HTTP_PROXY=proxy.company.com:80 max ...') or download manually with a web browser."); + if (secureProxy.length() > 0 && proxy.length() > 0 && !secureProxy.equals(proxy)) { + proxyMsg = " via " + proxy + " / " + secureProxy; + } else if (proxy.length() > 0) { + proxyMsg = " via " + proxy; + } else if (secureProxy.length() > 0) { + proxyMsg = " via " + secureProxy; } for (String s : urls) { @@ -91,7 +115,7 @@ if (conn instanceof HttpURLConnection) { // HttpURLConnection per default follows redirections, // but not if it changes the protocol (e.g. http -> - // https). While this is a sane default, in our + // https). While this is a sane default, in our // situation it's okay to follow a protocol transition. HttpURLConnection httpconn = (HttpURLConnection) conn; switch (httpconn.getResponseCode()) { @@ -137,4 +161,3 @@ } } } -