8001658: No need to pass resolved_references as argument to ConstantPoolCacheEntry::set_method_handle_common
Reviewed-by: twisti
This commit is contained in:
parent
d81c4b5d7d
commit
642c6b415a
@ -733,12 +733,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokehandle(JavaThread* thread)) {
|
||||
get_index_u2_cpcache(thread, bytecode), bytecode, CHECK);
|
||||
} // end JvmtiHideSingleStepping
|
||||
|
||||
cache_entry(thread)->set_method_handle(
|
||||
pool,
|
||||
info.resolved_method(),
|
||||
info.resolved_appendix(),
|
||||
info.resolved_method_type(),
|
||||
pool->resolved_references());
|
||||
cache_entry(thread)->set_method_handle(pool, info);
|
||||
}
|
||||
IRT_END
|
||||
|
||||
@ -762,12 +757,7 @@ IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
|
||||
} // end JvmtiHideSingleStepping
|
||||
|
||||
ConstantPoolCacheEntry* cp_cache_entry = pool->invokedynamic_cp_cache_entry_at(index);
|
||||
cp_cache_entry->set_dynamic_call(
|
||||
pool,
|
||||
info.resolved_method(),
|
||||
info.resolved_appendix(),
|
||||
info.resolved_method_type(),
|
||||
pool->resolved_references());
|
||||
cp_cache_entry->set_dynamic_call(pool, info);
|
||||
}
|
||||
IRT_END
|
||||
|
||||
|
@ -243,25 +243,17 @@ void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index)
|
||||
}
|
||||
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool,
|
||||
methodHandle adapter,
|
||||
Handle appendix, Handle method_type,
|
||||
objArrayHandle resolved_references) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokehandle, adapter, appendix, method_type, resolved_references);
|
||||
void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool, const CallInfo &call_info) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokehandle, call_info);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool,
|
||||
methodHandle adapter,
|
||||
Handle appendix, Handle method_type,
|
||||
objArrayHandle resolved_references) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokedynamic, adapter, appendix, method_type, resolved_references);
|
||||
void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool, const CallInfo &call_info) {
|
||||
set_method_handle_common(cpool, Bytecodes::_invokedynamic, call_info);
|
||||
}
|
||||
|
||||
void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
Bytecodes::Code invoke_code,
|
||||
methodHandle adapter,
|
||||
Handle appendix, Handle method_type,
|
||||
objArrayHandle resolved_references) {
|
||||
const CallInfo &call_info) {
|
||||
// NOTE: This CPCE can be the subject of data races.
|
||||
// There are three words to update: flags, refs[f2], f1 (in that order).
|
||||
// Writers must store all other values before f1.
|
||||
@ -276,6 +268,9 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
return;
|
||||
}
|
||||
|
||||
const methodHandle adapter = call_info.resolved_method();
|
||||
const Handle appendix = call_info.resolved_appendix();
|
||||
const Handle method_type = call_info.resolved_method_type();
|
||||
const bool has_appendix = appendix.not_null();
|
||||
const bool has_method_type = method_type.not_null();
|
||||
|
||||
@ -315,6 +310,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
|
||||
// This allows us to create fewer method oops, while keeping type safety.
|
||||
//
|
||||
|
||||
objArrayHandle resolved_references = cpool->resolved_references();
|
||||
// Store appendix, if any.
|
||||
if (has_appendix) {
|
||||
const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset;
|
||||
|
@ -117,6 +117,8 @@ class PSPromotionManager;
|
||||
// The fields are volatile so that they are stored in the order written in the
|
||||
// source code. The _indices field with the bytecode must be written last.
|
||||
|
||||
class CallInfo;
|
||||
|
||||
class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
friend class VMStructs;
|
||||
friend class constantPoolCacheKlass;
|
||||
@ -223,18 +225,12 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
|
||||
void set_method_handle(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
methodHandle method, // adapter for invokeExact, etc.
|
||||
Handle appendix, // stored in refs[f2+0]; could be a java.lang.invoke.MethodType
|
||||
Handle method_type, // stored in refs[f2+1]; is a java.lang.invoke.MethodType
|
||||
objArrayHandle resolved_references
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
|
||||
void set_dynamic_call(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
methodHandle method, // adapter for this call site
|
||||
Handle appendix, // stored in refs[f2+0]; could be a java.lang.invoke.CallSite
|
||||
Handle method_type, // stored in refs[f2+1]; is a java.lang.invoke.MethodType
|
||||
objArrayHandle resolved_references
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
|
||||
// Common code for invokedynamic and MH invocations.
|
||||
@ -255,10 +251,7 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
|
||||
void set_method_handle_common(
|
||||
constantPoolHandle cpool, // holding constant pool (required for locking)
|
||||
Bytecodes::Code invoke_code, // _invokehandle or _invokedynamic
|
||||
methodHandle adapter, // invoker method (f1)
|
||||
Handle appendix, // appendix such as CallSite, MethodType, etc. (refs[f2+0])
|
||||
Handle method_type, // MethodType (refs[f2+1])
|
||||
objArrayHandle resolved_references
|
||||
const CallInfo &call_info // Call link information
|
||||
);
|
||||
|
||||
// invokedynamic and invokehandle call sites have two entries in the
|
||||
|
Loading…
Reference in New Issue
Block a user