File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2116,7 +2116,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
21162116 }
21172117
21182118 if (cha_monomorphic_target != nullptr ) {
2119- assert (!target->can_be_statically_bound () || target == cha_monomorphic_target, " " );
2119+ assert (!target->can_be_statically_bound () || target-> equals ( cha_monomorphic_target) , " " );
21202120 assert (!cha_monomorphic_target->is_abstract (), " " );
21212121 if (!cha_monomorphic_target->can_be_statically_bound (actual_recv)) {
21222122 // If we inlined because CHA revealed only a single target method,
Original file line number Diff line number Diff line change @@ -781,6 +781,22 @@ bool ciMethod::can_omit_stack_trace() const {
781781 return _can_omit_stack_trace;
782782}
783783
784+ // ------------------------------------------------------------------
785+ // ciMethod::equals
786+ //
787+ // Returns true if the methods are the same, taking redefined methods
788+ // into account.
789+ bool ciMethod::equals (const ciMethod* m) const {
790+ if (this == m) return true ;
791+ VM_ENTRY_MARK;
792+ Method* m1 = this ->get_Method ();
793+ Method* m2 = m->get_Method ();
794+ if (m1->is_old ()) m1 = m1->get_new_method ();
795+ if (m2->is_old ()) m2 = m2->get_new_method ();
796+ return m1 == m2;
797+ }
798+
799+
784800// ------------------------------------------------------------------
785801// ciMethod::resolve_invoke
786802//
Original file line number Diff line number Diff line change @@ -366,6 +366,8 @@ class ciMethod : public ciMetadata {
366366
367367 bool can_omit_stack_trace () const ;
368368
369+ bool equals (const ciMethod* m) const ;
370+
369371 // Replay data methods
370372 static void dump_name_as_ascii (outputStream* st, Method* method);
371373 void dump_name_as_ascii (outputStream* st);
You can’t perform that action at this time.
0 commit comments