8148945: JDK-8148481: Devirtualize Klass::vtable breaks Zero build
Use Klass::method_at_vtable() instead of InstanceClass::start_of_vtable()[index] Reviewed-by: mgerdin, coleenp
This commit is contained in:
parent
bbbbfdbf3f
commit
c647cd04b0
@ -2502,10 +2502,10 @@ run:
|
|||||||
// Same comments as invokevirtual apply here.
|
// Same comments as invokevirtual apply here.
|
||||||
oop rcvr = STACK_OBJECT(-parms);
|
oop rcvr = STACK_OBJECT(-parms);
|
||||||
VERIFY_OOP(rcvr);
|
VERIFY_OOP(rcvr);
|
||||||
InstanceKlass* rcvrKlass = (InstanceKlass*)rcvr->klass();
|
Klass* rcvrKlass = rcvr->klass();
|
||||||
callee = (Method*) rcvrKlass->start_of_vtable()[ cache->f2_as_index()];
|
callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index());
|
||||||
// Profile 'special case of invokeinterface' virtual call.
|
// Profile 'special case of invokeinterface' virtual call.
|
||||||
BI_PROFILE_UPDATE_VIRTUALCALL(rcvr->klass());
|
BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass);
|
||||||
}
|
}
|
||||||
istate->set_callee(callee);
|
istate->set_callee(callee);
|
||||||
istate->set_callee_entry_point(callee->from_interpreted_entry());
|
istate->set_callee_entry_point(callee->from_interpreted_entry());
|
||||||
@ -2594,7 +2594,7 @@ run:
|
|||||||
// but this works
|
// but this works
|
||||||
oop rcvr = STACK_OBJECT(-parms);
|
oop rcvr = STACK_OBJECT(-parms);
|
||||||
VERIFY_OOP(rcvr);
|
VERIFY_OOP(rcvr);
|
||||||
InstanceKlass* rcvrKlass = (InstanceKlass*)rcvr->klass();
|
Klass* rcvrKlass = rcvr->klass();
|
||||||
/*
|
/*
|
||||||
Executing this code in java.lang.String:
|
Executing this code in java.lang.String:
|
||||||
public String(char value[]) {
|
public String(char value[]) {
|
||||||
@ -2611,9 +2611,9 @@ run:
|
|||||||
However it seems to have a vtable in the right location. Huh?
|
However it seems to have a vtable in the right location. Huh?
|
||||||
Because vtables have the same offset for ArrayKlass and InstanceKlass.
|
Because vtables have the same offset for ArrayKlass and InstanceKlass.
|
||||||
*/
|
*/
|
||||||
callee = (Method*) rcvrKlass->start_of_vtable()[ cache->f2_as_index()];
|
callee = (Method*) rcvrKlass->method_at_vtable(cache->f2_as_index());
|
||||||
// Profile virtual call.
|
// Profile virtual call.
|
||||||
BI_PROFILE_UPDATE_VIRTUALCALL(rcvr->klass());
|
BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((Bytecodes::Code)opcode == Bytecodes::_invokespecial) {
|
if ((Bytecodes::Code)opcode == Bytecodes::_invokespecial) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user