mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6939203: JSR 292 needs method handle constants
Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode. Reviewed-by: twisti, never
This commit is contained in:
parent
154ae789ef
commit
1f4cfb029b
60 changed files with 1549 additions and 378 deletions
|
@ -267,20 +267,6 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) {
|
|||
}
|
||||
#endif // PRODUCT
|
||||
|
||||
static BasicType constant_pool_type(methodOop method, int index) {
|
||||
constantTag tag = method->constants()->tag_at(index);
|
||||
if (tag.is_int ()) return T_INT;
|
||||
else if (tag.is_float ()) return T_FLOAT;
|
||||
else if (tag.is_long ()) return T_LONG;
|
||||
else if (tag.is_double ()) return T_DOUBLE;
|
||||
else if (tag.is_string ()) return T_OBJECT;
|
||||
else if (tag.is_unresolved_string()) return T_OBJECT;
|
||||
else if (tag.is_klass ()) return T_OBJECT;
|
||||
else if (tag.is_unresolved_klass ()) return T_OBJECT;
|
||||
ShouldNotReachHere();
|
||||
return T_ILLEGAL;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// Deoptimization support
|
||||
|
@ -330,13 +316,15 @@ address AbstractInterpreter::deopt_continue_after_entry(methodOop method, addres
|
|||
}
|
||||
|
||||
case Bytecodes::_ldc :
|
||||
type = constant_pool_type( method, *(bcp+1) );
|
||||
break;
|
||||
|
||||
case Bytecodes::_ldc_w : // fall through
|
||||
case Bytecodes::_ldc2_w:
|
||||
type = constant_pool_type( method, Bytes::get_Java_u2(bcp+1) );
|
||||
break;
|
||||
{
|
||||
Thread *thread = Thread::current();
|
||||
ResourceMark rm(thread);
|
||||
methodHandle mh(thread, method);
|
||||
type = Bytecode_loadconstant_at(mh, bci)->result_type();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
type = Bytecodes::result_type(code);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue