diff options
author | 2023-01-06 16:44:38 +0000 | |
---|---|---|
committer | 2023-01-17 09:20:34 +0000 | |
commit | 9e3761d6b98e090cff2e30e0f5e9714f434dd0f2 (patch) | |
tree | 9fba285742b0658a623dd42c14f9241cceb7ba18 /runtime/interpreter/interpreter_switch_impl.h | |
parent | 9ab12375de1b61ebfa924a6fbff7428e3b54d1f1 (diff) |
Remove one template argument to the switch interpreter.
Dynamically check for SkipAccessChecks instead.
arm64 apex goes from 49545216 bytes to 49324032, ~200KB savings.
Test: test.py
Change-Id: Iaa64f56485b15c0e3c0eaa31e469a2795035debe
Diffstat (limited to 'runtime/interpreter/interpreter_switch_impl.h')
-rw-r--r-- | runtime/interpreter/interpreter_switch_impl.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/interpreter/interpreter_switch_impl.h b/runtime/interpreter/interpreter_switch_impl.h index d4dca11c60..3a42c217a9 100644 --- a/runtime/interpreter/interpreter_switch_impl.h +++ b/runtime/interpreter/interpreter_switch_impl.h @@ -45,7 +45,7 @@ struct SwitchImplContext { }; // The actual internal implementation of the switch interpreter. -template<bool do_access_check, bool transaction_active> +template<bool transaction_active> void ExecuteSwitchImplCpp(SwitchImplContext* ctx) REQUIRES_SHARED(Locks::mutator_lock_); @@ -55,9 +55,11 @@ extern "C" void ExecuteSwitchImplAsm(SwitchImplContext* ctx, void* impl, const u REQUIRES_SHARED(Locks::mutator_lock_); // Wrapper around the switch interpreter which ensures we can unwind through it. -template<bool do_access_check, bool transaction_active> -ALWAYS_INLINE JValue ExecuteSwitchImpl(Thread* self, const CodeItemDataAccessor& accessor, - ShadowFrame& shadow_frame, JValue result_register, +template<bool transaction_active> +ALWAYS_INLINE JValue ExecuteSwitchImpl(Thread* self, + const CodeItemDataAccessor& accessor, + ShadowFrame& shadow_frame, + JValue result_register, bool interpret_one_instruction) REQUIRES_SHARED(Locks::mutator_lock_) { SwitchImplContext ctx { @@ -68,7 +70,7 @@ ALWAYS_INLINE JValue ExecuteSwitchImpl(Thread* self, const CodeItemDataAccessor& .interpret_one_instruction = interpret_one_instruction, .result = JValue(), }; - void* impl = reinterpret_cast<void*>(&ExecuteSwitchImplCpp<do_access_check, transaction_active>); + void* impl = reinterpret_cast<void*>(&ExecuteSwitchImplCpp<transaction_active>); const uint16_t* dex_pc = ctx.accessor.Insns(); ExecuteSwitchImplAsm(&ctx, impl, dex_pc); return ctx.result; |