8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation

Enhance method resolution and resulting data structures, plus some refactoring.

Reviewed-by: twisti, acorn, jrose
This commit is contained in:
David Chase 2013-09-13 22:38:02 -04:00
parent 98d8f57603
commit 222c735458
40 changed files with 715 additions and 601 deletions

View file

@ -509,24 +509,31 @@ bool Method::compute_has_loops_flag() {
return _access_flags.has_loops();
}
bool Method::is_final_method(AccessFlags class_access_flags) const {
// or "does_not_require_vtable_entry"
// overpass can occur, is not final (reuses vtable entry)
// private methods get vtable entries for backward class compatibility.
if (is_overpass()) return false;
return is_final() || class_access_flags.is_final();
}
bool Method::is_final_method() const {
// %%% Should return true for private methods also,
// since there is no way to override them.
return is_final() || method_holder()->is_final();
return is_final_method(method_holder()->access_flags());
}
bool Method::is_strict_method() const {
return is_strict();
}
bool Method::can_be_statically_bound() const {
if (is_final_method()) return true;
bool Method::can_be_statically_bound(AccessFlags class_access_flags) const {
if (is_final_method(class_access_flags)) return true;
#ifdef ASSERT
bool is_nonv = (vtable_index() == nonvirtual_vtable_index);
if (class_access_flags.is_interface()) assert(is_nonv == is_static(), err_msg("is_nonv=%s", is_nonv));
#endif
assert(valid_vtable_index() || valid_itable_index(), "method must be linked before we ask this question");
return vtable_index() == nonvirtual_vtable_index;
}
bool Method::can_be_statically_bound() const {
return can_be_statically_bound(method_holder()->access_flags());
}
bool Method::is_accessor() const {
if (code_size() != 5) return false;
@ -967,7 +974,7 @@ bool Method::is_overridden_in(Klass* k) const {
assert(ik->is_subclass_of(method_holder()), "should be subklass");
assert(ik->vtable() != NULL, "vtable should exist");
if (vtable_index() == nonvirtual_vtable_index) {
if (!has_vtable_index()) {
return false;
} else {
Method* vt_m = ik->method_at_vtable(vtable_index());
@ -1959,7 +1966,7 @@ void Method::print_on(outputStream* st) const {
void Method::print_value_on(outputStream* st) const {
assert(is_method(), "must be method");
st->print_cr(internal_name());
st->print(internal_name());
print_address_on(st);
st->print(" ");
name()->print_value_on(st);
@ -1967,6 +1974,7 @@ void Method::print_value_on(outputStream* st) const {
signature()->print_value_on(st);
st->print(" in ");
method_holder()->print_value_on(st);
if (WizardMode) st->print("#%d", _vtable_index);
if (WizardMode) st->print("[%d,%d]", size_of_parameters(), max_locals());
if (WizardMode && code() != NULL) st->print(" ((nmethod*)%p)", code());
}