2533 UPDATE_PC_AND_RETURN(0); // I'll be back... |
2533 UPDATE_PC_AND_RETURN(0); // I'll be back... |
2534 } |
2534 } |
2535 |
2535 |
2536 // this could definitely be cleaned up QQQ |
2536 // this could definitely be cleaned up QQQ |
2537 Method* callee; |
2537 Method* callee; |
2538 Klass* iclass = cache->f1_as_klass(); |
2538 Method *interface_method = cache->f2_as_interface_method(); |
2539 // InstanceKlass* interface = (InstanceKlass*) iclass; |
2539 InstanceKlass* iclass = interface_method->method_holder(); |
|
2540 |
2540 // get receiver |
2541 // get receiver |
2541 int parms = cache->parameter_size(); |
2542 int parms = cache->parameter_size(); |
2542 oop rcvr = STACK_OBJECT(-parms); |
2543 oop rcvr = STACK_OBJECT(-parms); |
2543 CHECK_NULL(rcvr); |
2544 CHECK_NULL(rcvr); |
2544 InstanceKlass* int2 = (InstanceKlass*) rcvr->klass(); |
2545 InstanceKlass* int2 = (InstanceKlass*) rcvr->klass(); |
|
2546 |
|
2547 // Receiver subtype check against resolved interface klass (REFC). |
|
2548 { |
|
2549 Klass* refc = cache->f1_as_klass(); |
|
2550 itableOffsetEntry* scan; |
|
2551 for (scan = (itableOffsetEntry*) int2->start_of_itable(); |
|
2552 scan->interface_klass() != NULL; |
|
2553 scan++) { |
|
2554 if (scan->interface_klass() == refc) { |
|
2555 break; |
|
2556 } |
|
2557 } |
|
2558 // Check that the entry is non-null. A null entry means |
|
2559 // that the receiver class doesn't implement the |
|
2560 // interface, and wasn't the same as when the caller was |
|
2561 // compiled. |
|
2562 if (scan->interface_klass() == NULL) { |
|
2563 VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap); |
|
2564 } |
|
2565 } |
|
2566 |
2545 itableOffsetEntry* ki = (itableOffsetEntry*) int2->start_of_itable(); |
2567 itableOffsetEntry* ki = (itableOffsetEntry*) int2->start_of_itable(); |
2546 int i; |
2568 int i; |
2547 for ( i = 0 ; i < int2->itable_length() ; i++, ki++ ) { |
2569 for ( i = 0 ; i < int2->itable_length() ; i++, ki++ ) { |
2548 if (ki->interface_klass() == iclass) break; |
2570 if (ki->interface_klass() == iclass) break; |
2549 } |
2571 } |
2551 // interface. The link resolver checks this but only for the first |
2573 // interface. The link resolver checks this but only for the first |
2552 // time this interface is called. |
2574 // time this interface is called. |
2553 if (i == int2->itable_length()) { |
2575 if (i == int2->itable_length()) { |
2554 VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap); |
2576 VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), "", note_no_trap); |
2555 } |
2577 } |
2556 int mindex = cache->f2_as_index(); |
2578 int mindex = interface_method->itable_index(); |
|
2579 |
2557 itableMethodEntry* im = ki->first_method_entry(rcvr->klass()); |
2580 itableMethodEntry* im = ki->first_method_entry(rcvr->klass()); |
2558 callee = im[mindex].method(); |
2581 callee = im[mindex].method(); |
2559 if (callee == NULL) { |
2582 if (callee == NULL) { |
2560 VM_JAVA_ERROR(vmSymbols::java_lang_AbstractMethodError(), "", note_no_trap); |
2583 VM_JAVA_ERROR(vmSymbols::java_lang_AbstractMethodError(), "", note_no_trap); |
2561 } |
2584 } |