summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2025-02-12 10:25:46 +0000
committer VladimĂ­r Marko <vmarko@google.com> 2025-02-17 04:47:25 -0800
commit474e99956e8be96e84404b5be6ad075bb5cb6b79 (patch)
tree9c0b2b1d686c906912cbe842b18a9100258d0c10 /compiler
parente7776615ea6b005051219845a143231b5bb1e4f8 (diff)
Refactor `ArtMethod` entrypoint initialization.
Introduce `Instrumentation::ReinitializeMethodsCode()` for the cases where we want to reset the entrypoint after the method has already been initialized. Keep the old function `Instrumentation::InitializeMethodsCode()` exclusively for the initialization of a newly loaded method's entrypoint, split out the work that can be done in suspended state and remove any unnecessary work. For example, we do not use the Nterp entrypoint until the class has been verified, so all the Nterp checks can be removed. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 329196666 Change-Id: I1d0c195b0118fe50434d496f56346a9f744fbaf7
Diffstat (limited to 'compiler')
-rw-r--r--compiler/common_compiler_test.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc
index f24406e599..26800637fa 100644
--- a/compiler/common_compiler_test.cc
+++ b/compiler/common_compiler_test.cc
@@ -32,6 +32,7 @@
#include "driver/compiled_code_storage.h"
#include "driver/compiler_options.h"
#include "jni/java_vm_ext.h"
+#include "instrumentation-inl.h"
#include "interpreter/interpreter.h"
#include "mirror/class-inl.h"
#include "mirror/class_loader.h"
@@ -306,7 +307,11 @@ void CommonCompilerTestImpl::CompileMethod(ArtMethod* method) {
storage.GetStackMap(),
storage.GetInstructionSet());
LOG(INFO) << "MakeExecutable " << method->PrettyMethod() << " code=" << method_code;
- GetRuntime()->GetInstrumentation()->InitializeMethodsCode(method, /*aot_code=*/ method_code);
+ instrumentation::Instrumentation* instr = GetRuntime()->GetInstrumentation();
+ const void* entrypoint = instr->GetInitialEntrypoint(method->GetAccessFlags(), method_code);
+ CHECK(!instr->IsForcedInterpretOnly());
+ CHECK(!instr->EntryExitStubsInstalled());
+ instr->UpdateMethodsCode(method, entrypoint);
}
}