diff options
Diffstat (limited to 'runtime/common_dex_operations.h')
-rw-r--r-- | runtime/common_dex_operations.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h index b8d9cbe141..0b9d3fbb53 100644 --- a/runtime/common_dex_operations.h +++ b/runtime/common_dex_operations.h @@ -61,18 +61,14 @@ namespace interpreter { inline bool EnsureInitialized(Thread* self, ShadowFrame* shadow_frame) REQUIRES_SHARED(Locks::mutator_lock_) { - if (!NeedsClinitCheckBeforeCall(shadow_frame->GetMethod())) { - return true; - } - ObjPtr<mirror::Class> declaring_class = shadow_frame->GetMethod()->GetDeclaringClass(); - if (LIKELY(declaring_class->IsVisiblyInitialized())) { + if (LIKELY(!shadow_frame->GetMethod()->StillNeedsClinitCheck())) { return true; } // Save the shadow frame. ScopedStackedShadowFramePusher pusher(self, shadow_frame); StackHandleScope<1> hs(self); - Handle<mirror::Class> h_class(hs.NewHandle(declaring_class)); + Handle<mirror::Class> h_class = hs.NewHandle(shadow_frame->GetMethod()->GetDeclaringClass()); if (UNLIKELY(!Runtime::Current()->GetClassLinker()->EnsureInitialized( self, h_class, /*can_init_fields=*/ true, /*can_init_parents=*/ true))) { DCHECK(self->IsExceptionPending()); |