src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8014013 Cdiff src/share/vm/oops/method.cpp

src/share/vm/oops/method.cpp

Print this page

        

*** 507,535 **** } _access_flags.set_loops_flag_init(); 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_strict_method() const { ! return is_strict(); } - bool Method::can_be_statically_bound() const { ! if (is_final_method()) return true; ! return vtable_index() == nonvirtual_vtable_index; } - bool Method::is_accessor() const { if (code_size() != 5) return false; if (size_of_parameters() != 1) return false; if (java_code_at(0) != Bytecodes::_aload_0 ) return false; if (java_code_at(1) != Bytecodes::_getfield) return false; --- 507,542 ---- } _access_flags.set_loops_flag_init(); 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 { ! return is_final_method(method_holder()->access_flags()); } ! 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; if (size_of_parameters() != 1) return false; if (java_code_at(0) != Bytecodes::_aload_0 ) return false; if (java_code_at(1) != Bytecodes::_getfield) return false;
*** 965,975 **** return true; } assert(ik->is_subclass_of(method_holder()), "should be subklass"); assert(ik->vtable() != NULL, "vtable should exist"); ! if (vtable_index() == nonvirtual_vtable_index) { return false; } else { Method* vt_m = ik->method_at_vtable(vtable_index()); return vt_m != this; } --- 972,982 ---- return true; } assert(ik->is_subclass_of(method_holder()), "should be subklass"); assert(ik->vtable() != NULL, "vtable should exist"); ! if (!has_vtable_index()) { return false; } else { Method* vt_m = ik->method_at_vtable(vtable_index()); return vt_m != this; }
*** 1957,1974 **** #endif //PRODUCT void Method::print_value_on(outputStream* st) const { assert(is_method(), "must be method"); ! st->print_cr(internal_name()); print_address_on(st); st->print(" "); name()->print_value_on(st); st->print(" "); signature()->print_value_on(st); st->print(" in "); method_holder()->print_value_on(st); if (WizardMode) st->print("[%d,%d]", size_of_parameters(), max_locals()); if (WizardMode && code() != NULL) st->print(" ((nmethod*)%p)", code()); } #if INCLUDE_SERVICES --- 1964,1982 ---- #endif //PRODUCT void Method::print_value_on(outputStream* st) const { assert(is_method(), "must be method"); ! st->print(internal_name()); print_address_on(st); st->print(" "); name()->print_value_on(st); st->print(" "); 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()); } #if INCLUDE_SERVICES
src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File