< prev index next >
src/hotspot/share/interpreter/rewriter.hpp
Print this page
rev 52749 : Bootstrap method consolidation
* clean up and simplify JDK support code for BSM invocation
* simplify JVM bootstrap handshake: use BootstrapCallInfo only
* remove unused JVM paths and data fields
* move bootstrap argument processing from MethodHandleNatives to ConstantPool
* remove ConstantGroup; merge argument access into BootstrapCallInfo
* adjust BSM argument access: remove copyArguments, add argumentRef API
* add metadata-free BSM modes, including symbolic arguments from CP
*** 39,49 ****
GrowableArray<int> _cp_map;
GrowableArray<int> _cp_cache_map; // for Methodref, Fieldref,
// InterfaceMethodref and InvokeDynamic
GrowableArray<int> _reference_map; // maps from cp index to resolved_refs index (or -1)
GrowableArray<int> _resolved_references_map; // for strings, methodHandle, methodType
! GrowableArray<int> _invokedynamic_references_map; // for invokedynamic resolved refs
GrowableArray<int> _method_handle_invokers;
int _resolved_reference_limit;
// For mapping invokedynamic bytecodes, which are discovered during method
// scanning. The invokedynamic entries are added at the end of the cpCache.
--- 39,49 ----
GrowableArray<int> _cp_map;
GrowableArray<int> _cp_cache_map; // for Methodref, Fieldref,
// InterfaceMethodref and InvokeDynamic
GrowableArray<int> _reference_map; // maps from cp index to resolved_refs index (or -1)
GrowableArray<int> _resolved_references_map; // for strings, methodHandle, methodType
! GrowableArray<int> _appendix_references_map; // for invokedynamic and invokehandle resolved refs
GrowableArray<int> _method_handle_invokers;
int _resolved_reference_limit;
// For mapping invokedynamic bytecodes, which are discovered during method
// scanning. The invokedynamic entries are added at the end of the cpCache.
*** 65,75 ****
_reference_map.trunc_to(0);
_reference_map.at_grow(length, -1);
_method_handle_invokers.trunc_to(0);
_resolved_references_map.trunc_to(0);
! _invokedynamic_references_map.trunc_to(0);
_resolved_reference_limit = -1;
_first_iteration_cp_cache_limit = -1;
// invokedynamic specific fields
_invokedynamic_cp_cache_map.trunc_to(0);
--- 65,75 ----
_reference_map.trunc_to(0);
_reference_map.at_grow(length, -1);
_method_handle_invokers.trunc_to(0);
_resolved_references_map.trunc_to(0);
! _appendix_references_map.trunc_to(0);
_resolved_reference_limit = -1;
_first_iteration_cp_cache_limit = -1;
// invokedynamic specific fields
_invokedynamic_cp_cache_map.trunc_to(0);
*** 158,179 ****
assert(cp_entry_to_resolved_references(cp_index) == ref_index, "");
return ref_index;
}
// add a new entries to the resolved_references map (for invokedynamic and invokehandle only)
! int add_invokedynamic_resolved_references_entries(int cp_index, int cache_index) {
assert(_resolved_reference_limit >= 0, "must add indy refs after first iteration");
! int ref_index = -1;
! for (int entry = 0; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) {
! const int index = _resolved_references_map.append(cp_index); // many-to-one
! assert(index >= _resolved_reference_limit, "");
! if (entry == 0) {
! ref_index = index;
! }
! assert((index - entry) == ref_index, "entries must be consecutive");
! _invokedynamic_references_map.at_put_grow(index, cache_index, -1);
! }
return ref_index;
}
int resolved_references_entry_to_pool_index(int ref_index) {
int cp_index = _resolved_references_map.at(ref_index);
--- 158,172 ----
assert(cp_entry_to_resolved_references(cp_index) == ref_index, "");
return ref_index;
}
// add a new entries to the resolved_references map (for invokedynamic and invokehandle only)
! int add_appendix_references_entry(int cp_index, int cache_index) {
assert(_resolved_reference_limit >= 0, "must add indy refs after first iteration");
! const int ref_index = _resolved_references_map.append(cp_index); // many-to-one
! assert(ref_index >= _resolved_reference_limit, "");
! _appendix_references_map.at_put_grow(ref_index, cache_index, -1);
return ref_index;
}
int resolved_references_entry_to_pool_index(int ref_index) {
int cp_index = _resolved_references_map.at(ref_index);
< prev index next >