Merge
This commit is contained in:
commit
15a9c29036
1
.hgtags
1
.hgtags
@ -652,4 +652,5 @@ a32f58c6b8be81877411767de7ba9c4cf087c1b5 jdk-15+31
|
||||
4a8fd81d64bafa523cddb45f82805536edace106 jdk-16+6
|
||||
6b65f4e7a975628df51ef755b02642075390041d jdk-15+33
|
||||
c3a4a7ea7c304cabdacdc31741eb94c51351668d jdk-16+7
|
||||
b0817631d2f4395508cb10e81c3858a94d9ae4de jdk-15+34
|
||||
0a73d6f3aab48ff6d7e61e47f0bc2d87a054f217 jdk-16+8
|
||||
|
@ -185,8 +185,10 @@ public class Net {
|
||||
nx = new SocketException("Socket is not bound yet");
|
||||
else if (x instanceof UnsupportedAddressTypeException)
|
||||
nx = new SocketException("Unsupported address type");
|
||||
else if (x instanceof UnresolvedAddressException) {
|
||||
else if (x instanceof UnresolvedAddressException)
|
||||
nx = new SocketException("Unresolved address");
|
||||
else if (x instanceof IOException) {
|
||||
nx = new SocketException(x.getMessage());
|
||||
}
|
||||
if (nx != x)
|
||||
nx.initCause(x);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -24,7 +24,9 @@
|
||||
|
||||
package org.graalvm.compiler.core.test;
|
||||
|
||||
import org.graalvm.compiler.api.directives.GraalDirectives;
|
||||
import org.graalvm.compiler.nodes.CallTargetNode.InvokeKind;
|
||||
import org.graalvm.compiler.phases.OptimisticOptimizations;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ConditionalNodeTest extends GraalCompilerTest {
|
||||
@ -126,4 +128,73 @@ public class ConditionalNodeTest extends GraalCompilerTest {
|
||||
node.a = a;
|
||||
return a;
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
static int lastIndexOf(char[] source, int sourceOffset, int sourceCount,
|
||||
char[] target, int targetOffset, int targetCount,
|
||||
int fromIndex) {
|
||||
/*
|
||||
* Check arguments; return immediately where possible. For consistency, don't check for null
|
||||
* str.
|
||||
*/
|
||||
int rightIndex = sourceCount - targetCount;
|
||||
if (fromIndex < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (fromIndex > rightIndex) {
|
||||
fromIndex = rightIndex;
|
||||
}
|
||||
/* Empty string always matches. */
|
||||
if (targetCount == 0) {
|
||||
return fromIndex;
|
||||
}
|
||||
|
||||
int strLastIndex = targetOffset + targetCount - 1;
|
||||
char strLastChar = target[strLastIndex];
|
||||
int min = sourceOffset + targetCount - 1;
|
||||
int i = min + fromIndex;
|
||||
|
||||
startSearchForLastChar: while (true) {
|
||||
while (i >= min && source[i] != strLastChar) {
|
||||
i--;
|
||||
}
|
||||
if (i < min) {
|
||||
return -1;
|
||||
}
|
||||
int j = i - 1;
|
||||
int start = j - (targetCount - 1);
|
||||
int k = strLastIndex - 1;
|
||||
|
||||
while (j > start) {
|
||||
if (source[j--] != target[k--]) {
|
||||
i--;
|
||||
continue startSearchForLastChar;
|
||||
}
|
||||
}
|
||||
return start - sourceOffset + 1;
|
||||
}
|
||||
}
|
||||
|
||||
public static String simple(String simpleName) {
|
||||
char[] value = simpleName.toCharArray();
|
||||
char[] target = ".".toCharArray();
|
||||
int lastDotIndex = lastIndexOf(value, 0, value.length,
|
||||
target, 0, target.length, value.length);
|
||||
if (lastDotIndex < 0) {
|
||||
return null;
|
||||
}
|
||||
GraalDirectives.deoptimize();
|
||||
return simpleName.substring(0, lastDotIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OptimisticOptimizations getOptimisticOptimizations() {
|
||||
// Disable profile based optimizations
|
||||
return OptimisticOptimizations.NONE;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConditionalExit() {
|
||||
test("simple", Object.class.getName());
|
||||
}
|
||||
}
|
||||
|
@ -549,6 +549,10 @@ public final class IfNode extends ControlSplitNode implements Simplifiable, LIRL
|
||||
return false;
|
||||
}
|
||||
|
||||
if (falseSuccessor instanceof LoopExitNode && ((LoopExitNode) falseSuccessor).stateAfter != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PhiNode phi = merge.phis().first();
|
||||
ValueNode falseValue = phi.valueAt(falseEnd);
|
||||
ValueNode trueValue = phi.valueAt(trueEnd);
|
||||
@ -868,6 +872,11 @@ public final class IfNode extends ControlSplitNode implements Simplifiable, LIRL
|
||||
AbstractEndNode trueEnd = (AbstractEndNode) trueSuccessor().next();
|
||||
AbstractEndNode falseEnd = (AbstractEndNode) falseSuccessor().next();
|
||||
AbstractMergeNode merge = trueEnd.merge();
|
||||
|
||||
if (falseSuccessor instanceof LoopExitNode && ((LoopExitNode) falseSuccessor).stateAfter != null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (merge == falseEnd.merge() && trueSuccessor().anchored().isEmpty() && falseSuccessor().anchored().isEmpty()) {
|
||||
PhiNode singlePhi = null;
|
||||
int distinct = 0;
|
||||
@ -986,6 +995,11 @@ public final class IfNode extends ControlSplitNode implements Simplifiable, LIRL
|
||||
}
|
||||
|
||||
protected void removeThroughFalseBranch(SimplifierTool tool, AbstractMergeNode merge) {
|
||||
// If the LoopExitNode and the Merge still have states then it's incorrect to arbitrarily
|
||||
// pick one side of the branch the represent the control flow. The state on the merge is the
|
||||
// real after state but it would need to be adjusted to represent the effects of the
|
||||
// conditional conversion.
|
||||
assert !(falseSuccessor instanceof LoopExitNode) || ((LoopExitNode) falseSuccessor).stateAfter == null;
|
||||
AbstractBeginNode trueBegin = trueSuccessor();
|
||||
LogicNode conditionNode = condition();
|
||||
graph().removeSplitPropagate(this, trueBegin);
|
||||
|
Loading…
Reference in New Issue
Block a user