summaryrefslogtreecommitdiff
path: root/runtime/common_dex_operations.h
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2022-08-02 16:58:30 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2022-08-05 19:47:42 +0000
commitb96054f6f3704dcb039af56532b2ce10896e2b81 (patch)
tree1076edb232bb03e870e23cb28445c62e688966d1 /runtime/common_dex_operations.h
parent5513fa8b1f35c19048b44359f7337442f92e5a76 (diff)
Revert "Ensure we initialize before pushing the method invoked."
This reverts commit 9f1a9bcfa320de7b4409cfd85cbe9b192c022f06. Reason for revert: Just to confirm if it resolves presubmit tests on the userfaultfd GC CLs (topic uffd-gc). This CL definitely causes art-test failures (with uffd GC) on local tests due to double reference to same shadow-frame on mutator stack. Test: test/testrunner/testrunner.py --host --debug --interpreter --gcstress Change-Id: I69affec203416aceb6f77e1ea2d1ec9bb1add6a6
Diffstat (limited to 'runtime/common_dex_operations.h')
-rw-r--r--runtime/common_dex_operations.h47
1 files changed, 8 insertions, 39 deletions
diff --git a/runtime/common_dex_operations.h b/runtime/common_dex_operations.h
index 22057c91b8..882e3ce4c7 100644
--- a/runtime/common_dex_operations.h
+++ b/runtime/common_dex_operations.h
@@ -26,7 +26,6 @@
#include "dex/code_item_accessors.h"
#include "dex/dex_file_structs.h"
#include "dex/primitive.h"
-#include "entrypoints/entrypoint_utils.h"
#include "handle_scope-inl.h"
#include "instrumentation.h"
#include "interpreter/interpreter.h"
@@ -56,33 +55,8 @@ namespace interpreter {
ShadowFrame* shadow_frame,
uint16_t arg_offset,
JValue* result);
-
} // 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())) {
- return true;
- }
-
- // Save the shadow frame.
- ScopedStackedShadowFramePusher pusher(
- self, shadow_frame, StackedShadowFrameType::kShadowFrameUnderConstruction);
- StackHandleScope<1> hs(self);
- Handle<mirror::Class> h_class(hs.NewHandle(declaring_class));
- if (UNLIKELY(!Runtime::Current()->GetClassLinker()->EnsureInitialized(
- self, h_class, /*can_init_fields=*/ true, /*can_init_parents=*/ true))) {
- DCHECK(self->IsExceptionPending());
- return false;
- }
- DCHECK(h_class->IsInitializing());
- return true;
-}
-
inline void PerformCall(Thread* self,
const CodeItemDataAccessor& accessor,
ArtMethod* caller_method,
@@ -91,20 +65,15 @@ inline void PerformCall(Thread* self,
JValue* result,
bool use_interpreter_entrypoint)
REQUIRES_SHARED(Locks::mutator_lock_) {
- if (UNLIKELY(!Runtime::Current()->IsStarted())) {
- interpreter::UnstartedRuntime::Invoke(self, accessor, callee_frame, result, first_dest_reg);
- return;
- }
-
- if (!EnsureInitialized(self, callee_frame)) {
- return;
- }
-
- if (use_interpreter_entrypoint) {
- interpreter::ArtInterpreterToInterpreterBridge(self, accessor, callee_frame, result);
+ if (LIKELY(Runtime::Current()->IsStarted())) {
+ if (use_interpreter_entrypoint) {
+ interpreter::ArtInterpreterToInterpreterBridge(self, accessor, callee_frame, result);
+ } else {
+ interpreter::ArtInterpreterToCompiledCodeBridge(
+ self, caller_method, callee_frame, first_dest_reg, result);
+ }
} else {
- interpreter::ArtInterpreterToCompiledCodeBridge(
- self, caller_method, callee_frame, first_dest_reg, result);
+ interpreter::UnstartedRuntime::Invoke(self, accessor, callee_frame, result, first_dest_reg);
}
}