< prev index next >
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallInfo.java
Print this page
rev 47466 : 8132547: [AOT] support invokedynamic instructions
Reviewed-by: iveresov, kvn
*** 30,42 ****
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaMethod;
final class CallInfo {
static boolean isStaticCall(Call call) {
! if (isJavaCall(call)) {
! return ((getByteCode(call) & 0xFF) == Bytecodes.INVOKESTATIC);
}
return false;
}
static boolean isSpecialCall(Call call) {
--- 30,52 ----
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import jdk.vm.ci.meta.ResolvedJavaMethod;
final class CallInfo {
+ static boolean isStaticTarget(Call call) {
+ return !((HotSpotResolvedJavaMethod)call.target).hasReceiver();
+ }
+
+ private static boolean isStaticOpcode(Call call) {
+ int opcode = getByteCode(call) & 0xFF;
+ return opcode == Bytecodes.INVOKESTATIC || opcode == Bytecodes.INVOKEDYNAMIC || opcode == Bytecodes.INVOKEVIRTUAL /* invokehandle */;
+ }
+
static boolean isStaticCall(Call call) {
! if (isJavaCall(call) && isStaticTarget(call)) {
! assert isStaticOpcode(call);
! return true;
}
return false;
}
static boolean isSpecialCall(Call call) {
*** 52,62 ****
}
return false;
}
static boolean isVirtualCall(CompiledMethodInfo methodInfo, Call call) {
! return isInvokeVirtual(call) && !methodInfo.hasMark(call, MarkId.INVOKESPECIAL);
}
static boolean isOptVirtualCall(CompiledMethodInfo methodInfo, Call call) {
return isInvokeVirtual(call) && methodInfo.hasMark(call, MarkId.INVOKESPECIAL);
}
--- 62,72 ----
}
return false;
}
static boolean isVirtualCall(CompiledMethodInfo methodInfo, Call call) {
! return isInvokeVirtual(call) && !methodInfo.hasMark(call, MarkId.INVOKESPECIAL) && !isStaticTarget(call);
}
static boolean isOptVirtualCall(CompiledMethodInfo methodInfo, Call call) {
return isInvokeVirtual(call) && methodInfo.hasMark(call, MarkId.INVOKESPECIAL);
}
< prev index next >