summaryrefslogtreecommitdiff
path: root/runtime/interpreter/interpreter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r--runtime/interpreter/interpreter.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index fb6f36d5e7..eeeb300a92 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -237,13 +237,12 @@ static JValue ExecuteSwitch(Thread* self,
ShadowFrame& shadow_frame,
JValue result_register,
bool interpret_one_instruction) REQUIRES_SHARED(Locks::mutator_lock_) {
- if (Runtime::Current()->IsActiveTransaction()) {
- return ExecuteSwitchImpl<true>(
- self, accessor, shadow_frame, result_register, interpret_one_instruction);
- } else {
- return ExecuteSwitchImpl<false>(
- self, accessor, shadow_frame, result_register, interpret_one_instruction);
- }
+ Runtime* runtime = Runtime::Current();
+ auto switch_impl_cpp = runtime->IsActiveTransaction()
+ ? runtime->GetClassLinker()->GetTransactionalInterpreter()
+ : reinterpret_cast<const void*>(&ExecuteSwitchImplCpp</*transaction_active=*/ false>);
+ return ExecuteSwitchImpl(
+ self, accessor, shadow_frame, result_register, interpret_one_instruction, switch_impl_cpp);
}
NO_STACK_PROTECTOR