Mercurial > hg > truffle
diff src/share/vm/oops/method.cpp @ 12264:b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
Summary: Enhance method resolution and resulting data structures, plus some refactoring.
Reviewed-by: twisti, acorn, jrose
author | drchase |
---|---|
date | Fri, 13 Sep 2013 22:38:02 -0400 |
parents | 8947af8a9cec |
children | 510fbd28919c |
line wrap: on
line diff
--- a/src/share/vm/oops/method.cpp Tue Sep 17 23:12:27 2013 +0200 +++ b/src/share/vm/oops/method.cpp Fri Sep 13 22:38:02 2013 -0400 @@ -509,24 +509,31 @@ return _access_flags.has_loops(); } - -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(); +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_strict_method() const { - return is_strict(); +bool Method::is_final_method() const { + return is_final_method(method_holder()->access_flags()); } - -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 @@ 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_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 @@ 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()); }