diff options
author | 2018-10-15 11:46:46 +0100 | |
---|---|---|
committer | 2018-10-17 18:37:32 +0000 | |
commit | 1f5ab4ecc6589a8d5a671ef56e6efcc3e40d7c5b (patch) | |
tree | a0912961631749e7bca17a527b1e106a10554185 /runtime/interpreter/interpreter_common.h | |
parent | 21ff4ad92e8d74cfe8d95ec64b177d47084ec374 (diff) |
Rename fast_invoke template argument of DoInvoke to is_mterp.
This is more descriptive than "fast".
Test: test.py -b --interpreter --host
Change-Id: I107c59db2aa00dd6fd727fe08c739c940dd7899c
Diffstat (limited to 'runtime/interpreter/interpreter_common.h')
-rw-r--r-- | runtime/interpreter/interpreter_common.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index 1e4239edfd..3c5abe124e 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -123,7 +123,7 @@ bool DoCall(ArtMethod* called_method, Thread* self, ShadowFrame& shadow_frame, // Handles all invoke-XXX/range instructions except for invoke-polymorphic[/range]. // Returns true on success, otherwise throws an exception and returns false. -template<InvokeType type, bool is_range, bool do_access_check, bool fast_invoke = false> +template<InvokeType type, bool is_range, bool do_access_check, bool is_mterp> static ALWAYS_INLINE bool DoInvoke(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst, @@ -169,29 +169,29 @@ static ALWAYS_INLINE bool DoInvoke(Thread* self, CHECK(self->IsExceptionPending()); result->SetJ(0); return false; - } else if (UNLIKELY(!called_method->IsInvokable())) { + } + if (UNLIKELY(!called_method->IsInvokable())) { called_method->ThrowInvocationTimeError(); result->SetJ(0); return false; - } else { - jit::Jit* jit = Runtime::Current()->GetJit(); - if (jit != nullptr && (type == kVirtual || type == kInterface)) { - jit->InvokeVirtualOrInterface(receiver, sf_method, shadow_frame.GetDexPC(), called_method); - } - // The fast invoke is used from mterp for some invoke variants. - // The non-fast version is used from switch interpreter and it might not support intrinsics. - // TODO: Unify both paths. - if (fast_invoke) { - if (called_method->IsIntrinsic()) { - if (MterpHandleIntrinsic(&shadow_frame, called_method, inst, inst_data, - shadow_frame.GetResultRegister())) { - return !self->IsExceptionPending(); - } + } + + jit::Jit* jit = Runtime::Current()->GetJit(); + if (jit != nullptr && (type == kVirtual || type == kInterface)) { + jit->InvokeVirtualOrInterface(receiver, sf_method, shadow_frame.GetDexPC(), called_method); + } + + if (is_mterp && !is_range && called_method->IsIntrinsic()) { + if (type == kDirect || type == kStatic || type == kVirtual) { + if (MterpHandleIntrinsic(&shadow_frame, called_method, inst, inst_data, + shadow_frame.GetResultRegister())) { + return !self->IsExceptionPending(); } } - return DoCall<is_range, do_access_check>(called_method, self, shadow_frame, inst, inst_data, - result); } + + return DoCall<is_range, do_access_check>(called_method, self, shadow_frame, inst, inst_data, + result); } static inline ObjPtr<mirror::MethodHandle> ResolveMethodHandle(Thread* self, |