8217998: Remove method_type field associated with the appendix field of an indy or method handle call

Removed the unused method_type field associated with the appendix field of an indy or method handle call.

Reviewed-by: acorn, coleenp, dlong
This commit is contained in:
Lois Foltan 2019-02-13 15:50:08 -05:00
parent 29245f8878
commit 9631b06423
19 changed files with 141 additions and 162 deletions

View file

@ -392,23 +392,22 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
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();
// Write the flags.
// MHs and indy are always sig-poly and have a local signature.
set_method_flags(as_TosState(adapter->result_type()),
((has_appendix ? 1 : 0) << has_appendix_shift ) |
((has_method_type ? 1 : 0) << has_method_type_shift) |
( 1 << is_final_shift ),
((has_appendix ? 1 : 0) << has_appendix_shift ) |
( 1 << has_local_signature_shift ) |
( 1 << is_final_shift ),
adapter->size_of_parameters());
if (TraceInvokeDynamic) {
ttyLocker ttyl;
tty->print_cr("set_method_handle bc=%d appendix=" PTR_FORMAT "%s method_type=" PTR_FORMAT "%s method=" PTR_FORMAT " ",
tty->print_cr("set_method_handle bc=%d appendix=" PTR_FORMAT "%s method=" PTR_FORMAT " (local signature) ",
invoke_code,
p2i(appendix()), (has_appendix ? "" : " (unused)"),
p2i(method_type()), (has_method_type ? "" : " (unused)"),
p2i(appendix()),
(has_appendix ? "" : " (unused)"),
p2i(adapter()));
adapter->print();
if (has_appendix) appendix()->print();
@ -435,20 +434,12 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
// Store appendix, if any.
if (has_appendix) {
const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset;
const int appendix_index = f2_as_index();
assert(appendix_index >= 0 && appendix_index < resolved_references->length(), "oob");
assert(resolved_references->obj_at(appendix_index) == NULL, "init just once");
resolved_references->obj_at_put(appendix_index, appendix());
}
// Store MethodType, if any.
if (has_method_type) {
const int method_type_index = f2_as_index() + _indy_resolved_references_method_type_offset;
assert(method_type_index >= 0 && method_type_index < resolved_references->length(), "oob");
assert(resolved_references->obj_at(method_type_index) == NULL, "init just once");
resolved_references->obj_at_put(method_type_index, method_type());
}
release_set_f1(adapter()); // This must be the last one to set (see NOTE above)!
// The interpreter assembly code does not check byte_2,
@ -459,6 +450,9 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle&
ttyLocker ttyl;
this->print(tty, 0);
}
assert(has_appendix == this->has_appendix(), "proper storage of appendix flag");
assert(this->has_local_signature(), "proper storage of signature flag");
}
bool ConstantPoolCacheEntry::save_and_throw_indy_exc(
@ -544,16 +538,7 @@ Method* ConstantPoolCacheEntry::method_if_resolved(const constantPoolHandle& cpo
oop ConstantPoolCacheEntry::appendix_if_resolved(const constantPoolHandle& cpool) {
if (!has_appendix())
return NULL;
const int ref_index = f2_as_index() + _indy_resolved_references_appendix_offset;
objArrayOop resolved_references = cpool->resolved_references();
return resolved_references->obj_at(ref_index);
}
oop ConstantPoolCacheEntry::method_type_if_resolved(const constantPoolHandle& cpool) {
if (!has_method_type())
return NULL;
const int ref_index = f2_as_index() + _indy_resolved_references_method_type_offset;
const int ref_index = f2_as_index();
objArrayOop resolved_references = cpool->resolved_references();
return resolved_references->obj_at(ref_index);
}
@ -701,16 +686,7 @@ void ConstantPoolCache::initialize(const intArray& inverse_index_map,
for (int ref = 0; ref < invokedynamic_references_map.length(); ref++) {
const int cpci = invokedynamic_references_map.at(ref);
if (cpci >= 0) {
#ifdef ASSERT
// invokedynamic and invokehandle have more entries; check if they
// all point to the same constant pool cache entry.
for (int entry = 1; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) {
const int cpci_next = invokedynamic_references_map.at(ref + entry);
assert(cpci == cpci_next, "%d == %d", cpci, cpci_next);
}
#endif
entry_at(cpci)->initialize_resolved_reference_index(ref);
ref += ConstantPoolCacheEntry::_indy_resolved_references_entries - 1; // skip extra entries
}
}
}