mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-25 13:54:38 +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
|
@ -83,6 +83,18 @@ IRT_ENTRY(void, InterpreterRuntime::ldc(JavaThread* thread, bool wide))
|
|||
}
|
||||
IRT_END
|
||||
|
||||
IRT_ENTRY(void, InterpreterRuntime::resolve_ldc(JavaThread* thread, Bytecodes::Code bytecode)) {
|
||||
assert(bytecode == Bytecodes::_fast_aldc ||
|
||||
bytecode == Bytecodes::_fast_aldc_w, "wrong bc");
|
||||
ResourceMark rm(thread);
|
||||
methodHandle m (thread, method(thread));
|
||||
Bytecode_loadconstant* ldc = Bytecode_loadconstant_at(m, bci(thread));
|
||||
oop result = ldc->resolve_constant(THREAD);
|
||||
DEBUG_ONLY(ConstantPoolCacheEntry* cpce = m->constants()->cache()->entry_at(ldc->cache_index()));
|
||||
assert(result == cpce->f1(), "expected result for assembly code");
|
||||
}
|
||||
IRT_END
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
// Allocation
|
||||
|
@ -328,7 +340,7 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
|
|||
typeArrayHandle h_extable (thread, h_method->exception_table());
|
||||
bool should_repeat;
|
||||
int handler_bci;
|
||||
int current_bci = bcp(thread) - h_method->code_base();
|
||||
int current_bci = bci(thread);
|
||||
|
||||
// Need to do this check first since when _do_not_unlock_if_synchronized
|
||||
// is set, we don't want to trigger any classloading which may make calls
|
||||
|
@ -615,8 +627,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes
|
|||
if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface) {
|
||||
ResourceMark rm(thread);
|
||||
methodHandle m (thread, method(thread));
|
||||
int bci = m->bci_from(bcp(thread));
|
||||
Bytecode_invoke* call = Bytecode_invoke_at(m, bci);
|
||||
Bytecode_invoke* call = Bytecode_invoke_at(m, bci(thread));
|
||||
symbolHandle signature (thread, call->signature());
|
||||
receiver = Handle(thread,
|
||||
thread->last_frame().interpreter_callee_receiver(signature));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue