aboutsummaryrefslogtreecommitdiff
path: root/src/share
diff options
context:
space:
mode:
authortwisti <none@none>2012-11-02 12:30:46 -0700
committertwisti <none@none>2012-11-02 12:30:46 -0700
commitdee72e10bb46938404c7c3dcf416ef6f74b5f5ba (patch)
treef27e25932751253c8d0787fd2a8b2125447e5221 /src/share
parentb86be73a96b98878fc89cd2d903b8f3c2da93a0e (diff)
8001658: No need to pass resolved_references as argument to ConstantPoolCacheEntry::set_method_handle_common
Reviewed-by: twisti Contributed-by: Bharadwaj Yadavalli <bharadwaj.yadavalli@oracle.com>
Diffstat (limited to 'src/share')
-rw-r--r--src/share/vm/interpreter/interpreterRuntime.cpp14
-rw-r--r--src/share/vm/oops/cpCache.cpp22
-rw-r--r--src/share/vm/oops/cpCache.hpp17
3 files changed, 16 insertions, 37 deletions
diff --git a/src/share/vm/interpreter/interpreterRuntime.cpp b/src/share/vm/interpreter/interpreterRuntime.cpp
index 6aa8ea116..377e013c6 100644
--- a/src/share/vm/interpreter/interpreterRuntime.cpp
+++ b/src/share/vm/interpreter/interpreterRuntime.cpp
@@ -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
diff --git a/src/share/vm/oops/cpCache.cpp b/src/share/vm/oops/cpCache.cpp
index b246cbad3..0eeb2b63a 100644
--- a/src/share/vm/oops/cpCache.cpp
+++ b/src/share/vm/oops/cpCache.cpp
@@ -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;
diff --git a/src/share/vm/oops/cpCache.hpp b/src/share/vm/oops/cpCache.hpp
index 164e34d9a..90308e44a 100644
--- a/src/share/vm/oops/cpCache.hpp
+++ b/src/share/vm/oops/cpCache.hpp
@@ -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