< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
Print this page
*** 42,62 ****
* @see LoadJavaMirrorWithKlassPhase
*/
public class AheadOfTimeVerificationPhase extends VerifyPhase<PhaseContext> {
@Override
! protected boolean verify(StructuredGraph graph, PhaseContext context) {
for (ConstantNode node : getConstantNodes(graph)) {
if (isIllegalObjectConstant(node)) {
throw new VerificationError("illegal object constant: " + node);
}
}
- return true;
}
public static boolean isIllegalObjectConstant(ConstantNode node) {
! return isObject(node) && !isNullReference(node) && !isInternedString(node) && !isDirectMethodHandle(node) && !isBoundMethodHandle(node);
}
private static boolean isObject(ConstantNode node) {
return node.getStackKind() == JavaKind.Object;
}
--- 42,66 ----
* @see LoadJavaMirrorWithKlassPhase
*/
public class AheadOfTimeVerificationPhase extends VerifyPhase<PhaseContext> {
@Override
! protected void verify(StructuredGraph graph, PhaseContext context) {
for (ConstantNode node : getConstantNodes(graph)) {
if (isIllegalObjectConstant(node)) {
throw new VerificationError("illegal object constant: " + node);
}
}
}
public static boolean isIllegalObjectConstant(ConstantNode node) {
! return isObject(node) &&
! !isNullReference(node) &&
! !isInternedString(node) &&
! !isDirectMethodHandle(node) &&
! !isBoundMethodHandle(node) &&
! !isVarHandle(node);
}
private static boolean isObject(ConstantNode node) {
return node.getStackKind() == JavaKind.Object;
}
*** 77,86 ****
--- 81,98 ----
return false;
}
return StampTool.typeOrNull(node).getName().startsWith("Ljava/lang/invoke/BoundMethodHandle");
}
+ private static boolean isVarHandle(ConstantNode node) {
+ if (!isObject(node)) {
+ return false;
+ }
+ String name = StampTool.typeOrNull(node).getName();
+ return name.equals("Ljava/lang/invoke/VarHandle$AccessDescriptor;");
+ }
+
private static boolean isInternedString(ConstantNode node) {
if (!isObject(node)) {
return false;
}
< prev index next >