6829187: compiler optimizations required for JSR 292

C2 implementation for invokedynamic support.

Reviewed-by: kvn, never
This commit is contained in:
Christian Thalinger 2010-01-05 13:05:58 +01:00
parent 9be2e29930
commit 375527d84e
31 changed files with 566 additions and 89 deletions

View file

@ -322,14 +322,17 @@ bool pass_initial_checks(ciMethod* caller_method, int caller_bci, ciMethod* call
// stricter than callee_holder->is_initialized()
ciBytecodeStream iter(caller_method);
iter.force_bci(caller_bci);
int index = iter.get_index_int();
if( !caller_method->is_klass_loaded(index, true) ) {
return false;
}
// Try to do constant pool resolution if running Xcomp
Bytecodes::Code call_bc = iter.cur_bc();
if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) {
return false;
// An invokedynamic instruction does not have a klass.
if (call_bc != Bytecodes::_invokedynamic) {
int index = iter.get_index_int();
if (!caller_method->is_klass_loaded(index, true)) {
return false;
}
// Try to do constant pool resolution if running Xcomp
if( !caller_method->check_call(index, call_bc == Bytecodes::_invokestatic) ) {
return false;
}
}
}
// We will attempt to see if a class/field/etc got properly loaded. If it