summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 8bf38d35b2..3ea4a8d06f 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2185,9 +2185,14 @@ bool ClassLinker::AddImageSpace(
header.VisitPackedArtMethods([&](ArtMethod& method) REQUIRES_SHARED(Locks::mutator_lock_) {
if (!method.IsRuntimeMethod()) {
DCHECK(method.GetDeclaringClass() != nullptr);
- if (!method.IsNative() && !method.IsResolutionMethod()) {
- method.SetEntryPointFromQuickCompiledCodePtrSize(GetQuickToInterpreterBridge(),
- image_pointer_size_);
+ if (!method.IsResolutionMethod()) {
+ if (!method.IsNative()) {
+ method.SetEntryPointFromQuickCompiledCodePtrSize(GetQuickToInterpreterBridge(),
+ image_pointer_size_);
+ } else if (Runtime::SimulatorMode()) {
+ method.SetEntryPointFromQuickCompiledCodePtrSize(GetQuickGenericJniStub(),
+ image_pointer_size_);
+ }
}
}
}, space->Begin(), image_pointer_size_);
@@ -3554,6 +3559,10 @@ bool ClassLinker::ShouldUseInterpreterEntrypoint(ArtMethod* method, const void*
return true;
}
+ if (Runtime::SimulatorMode()) {
+ return !method->CanBeSimulated();
+ }
+
Runtime* runtime = Runtime::Current();
instrumentation::Instrumentation* instr = runtime->GetInstrumentation();
if (instr->InterpretOnly()) {
@@ -3671,7 +3680,7 @@ void ClassLinker::FixupStaticTrampolines(Thread* self, ObjPtr<mirror::Class> kla
}
// Check whether the method is native, in which case it's generic JNI.
- if (quick_code == nullptr && method->IsNative()) {
+ if ((Runtime::SimulatorMode() || quick_code == nullptr) && method->IsNative()) {
quick_code = GetQuickGenericJniStub();
} else if (ShouldUseInterpreterEntrypoint(method, quick_code)) {
// Use interpreter entry point.
@@ -3731,7 +3740,7 @@ static void LinkCode(ClassLinker* class_linker,
// Note: this mimics the logic in image_writer.cc that installs the resolution
// stub only if we have compiled code and the method needs a class initialization
// check.
- if (quick_code == nullptr) {
+ if (quick_code == nullptr || Runtime::SimulatorMode()) {
method->SetEntryPointFromQuickCompiledCode(
method->IsNative() ? GetQuickGenericJniStub() : GetQuickToInterpreterBridge());
} else if (enter_interpreter) {