java-9-openjdk/java-9-openjdk-9.0.4.11-JDK...

67 lines
2.6 KiB
Diff

diff --git a/openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
index 8b7beb155..427ff470d 100644
--- a/openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
+++ b/openjdk/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp
@@ -183,3 +183,9 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
return NULL;
}
}
+
+#ifndef PRODUCT
+void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) {
+ // This is just a stub.
+}
+#endif //PRODUCT
diff --git a/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
index 655b58af1..2b4c0d819 100644
--- a/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
+++ b/openjdk/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp
@@ -2538,13 +2538,35 @@ run:
// this could definitely be cleaned up QQQ
Method* callee;
- Klass* iclass = cache->f1_as_klass();
- // InstanceKlass* interface = (InstanceKlass*) iclass;
+ Method *interface_method = cache->f2_as_interface_method();
+ InstanceKlass* iclass = interface_method->method_holder();
+
// get receiver
int parms = cache->parameter_size();
oop rcvr = STACK_OBJECT(-parms);
CHECK_NULL(rcvr);
InstanceKlass* int2 = (InstanceKlass*) rcvr->klass();
+
+ // Receiver subtype check against resolved interface klass (REFC).
+ {
+ Klass* refc = cache->f1_as_klass();
+ itableOffsetEntry* scan;
+ for (scan = (itableOffsetEntry*) int2->start_of_itable();
+ scan->interface_klass() != NULL;
+ scan++) {
+ if (scan->interface_klass() == refc) {
+ break;
+ }
+ }
+ // Check that the entry is non-null. A null entry means
+ // that the receiver class doesn't implement the
+ // interface, and wasn't the same as when the caller was
+ // compiled.
+ if (scan->interface_klass() == NULL) {
+ VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap);
+ }
+ }
+
itableOffsetEntry* ki = (itableOffsetEntry*) int2->start_of_itable();
int i;
for ( i = 0 ; i < int2->itable_length() ; i++, ki++ ) {
@@ -2556,7 +2578,8 @@ run:
if (i == int2->itable_length()) {
VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap);
}
- int mindex = cache->f2_as_index();
+ int mindex = interface_method->itable_index();
+
itableMethodEntry* im = ki->first_method_entry(rcvr->klass());
callee = im[mindex].method();
if (callee == NULL) {