summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter_common.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2019-12-10 10:17:23 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2019-12-18 06:50:39 +0000
commit00391824f4ee89f9fbed178a1ee32bc29fa77b3b (patch)
treeaea6bc5e49801c5b4816257ab16a97181ef0d911 /runtime/interpreter/interpreter_common.h
parent001e5b33ba7065dde0b85450830b605733ae1685 (diff)
Add an implementation of Nterp for x64.
And enable it on x64 when runtime and ArtMethod requirements are met (see nterp.cc). Test: test.py Bug: 112676029 Change-Id: I772cd20a20fdc0ff99529df7495801d773091584
Diffstat (limited to 'runtime/interpreter/interpreter_common.h')
-rw-r--r--runtime/interpreter/interpreter_common.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h
index 9fccde9d2d..d7fee020a2 100644
--- a/runtime/interpreter/interpreter_common.h
+++ b/runtime/interpreter/interpreter_common.h
@@ -245,13 +245,14 @@ static ALWAYS_INLINE bool DoInvoke(Thread* self,
const uint32_t vregC = (is_range) ? inst->VRegC_3rc() : inst->VRegC_35c();
ArtMethod* sf_method = shadow_frame.GetMethod();
- // Try to find the method in small thread-local cache first.
+ // Try to find the method in small thread-local cache first (only used when
+ // nterp is not used as mterp and nterp use the cache in an incompatible way).
InterpreterCache* tls_cache = self->GetInterpreterCache();
size_t tls_value;
ArtMethod* resolved_method;
if (is_quick) {
resolved_method = nullptr; // We don't know/care what the original method was.
- } else if (LIKELY(tls_cache->Get(inst, &tls_value))) {
+ } else if (!IsNterpSupported() && LIKELY(tls_cache->Get(inst, &tls_value))) {
resolved_method = reinterpret_cast<ArtMethod*>(tls_value);
} else {
ClassLinker* const class_linker = Runtime::Current()->GetClassLinker();
@@ -264,7 +265,9 @@ static ALWAYS_INLINE bool DoInvoke(Thread* self,
result->SetJ(0);
return false;
}
- tls_cache->Set(inst, reinterpret_cast<size_t>(resolved_method));
+ if (!IsNterpSupported()) {
+ tls_cache->Set(inst, reinterpret_cast<size_t>(resolved_method));
+ }
}
// Null pointer check and virtual method resolution.