summaryrefslogtreecommitdiff
path: root/runtime/common_dex_operations.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2022-12-12 09:12:21 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2022-12-12 15:57:57 +0000
commita20ec9bb10d7ded8ae7d95d4de1e190d22260c73 (patch)
tree50b5a757c4aa9f5aa7c663d47d96474f538476a2 /runtime/common_dex_operations.h
parentb9df137d1dbdab1fdca13bb459705b6603e9328b (diff)
Fix clinit debug check in instrumentation.
Test: m test-art-host-gtest Test: testrunner.py --host --optimizing --jit --interpreter Change-Id: Idae620b0b8f9ed67574f5b785fdac3efcb534cfd
Diffstat (limited to 'runtime/common_dex_operations.h')
-rw-r--r--runtime/common_dex_operations.h8
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());