diff options
author | 2025-02-12 10:25:46 +0000 | |
---|---|---|
committer | 2025-02-17 04:47:25 -0800 | |
commit | 474e99956e8be96e84404b5be6ad075bb5cb6b79 (patch) | |
tree | 9c0b2b1d686c906912cbe842b18a9100258d0c10 /dex2oat | |
parent | e7776615ea6b005051219845a143231b5bb1e4f8 (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 'dex2oat')
-rw-r--r-- | dex2oat/driver/compiler_driver_test.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/dex2oat/driver/compiler_driver_test.cc b/dex2oat/driver/compiler_driver_test.cc index 7d4c32b25c..5dc6589d53 100644 --- a/dex2oat/driver/compiler_driver_test.cc +++ b/dex2oat/driver/compiler_driver_test.cc @@ -31,6 +31,7 @@ #include "dex/dex_file_types.h" #include "gc/heap.h" #include "handle_scope-inl.h" +#include "instrumentation-inl.h" #include "mirror/class-inl.h" #include "mirror/class_loader.h" #include "mirror/dex_cache-inl.h" @@ -93,7 +94,11 @@ class CompilerDriverTest : public CommonCompilerDriverTest { LOG(INFO) << "MakeExecutable " << method->PrettyMethod() << " code=" << method_code; } } - runtime_->GetInstrumentation()->InitializeMethodsCode(method, /*aot_code=*/ method_code); + instrumentation::Instrumentation* instr = runtime_->GetInstrumentation(); + const void* entrypoint = instr->GetInitialEntrypoint(method->GetAccessFlags(), method_code); + CHECK(!instr->IsForcedInterpretOnly()); + CHECK(!instr->EntryExitStubsInstalled()); + instr->UpdateMethodsCode(method, entrypoint); } void MakeDexFileExecutable(jobject class_loader, const DexFile& dex_file) { |