summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2024-10-23 13:09:32 +0000
committer Mythri Alle <mythria@google.com> 2024-10-25 11:08:17 +0000
commitb6413c0a1c8d897280ae157cc8f9a50dc68e11e7 (patch)
tree834c697e46ccdde10a3406514b20f460283603bb
parente54bbb5c16009e6959b4e2b1e090f29edd990ad1 (diff)
Remove interpret_one_instruction from switch interpreter
This was used when mterp bailed out on executing an instruction. The idea was to fallback to switch interpreter for that instruction and continue with mterp. We no longer have mterp and removed the support for it (aosp/1763167). We no longer use this capability and is always set to false. So clean it up by removing this. Test: art/test.py Change-Id: Iaabf5d5afb240d7775b23d9b3fa8aee00a0c5660
-rw-r--r--runtime/interpreter/interpreter.cc8
-rw-r--r--runtime/interpreter/interpreter_switch_impl-inl.h8
-rw-r--r--runtime/interpreter/interpreter_switch_impl.h3
3 files changed, 4 insertions, 15 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 59388e7c96..2665d00c8b 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -235,14 +235,13 @@ NO_STACK_PROTECTOR
static JValue ExecuteSwitch(Thread* self,
const CodeItemDataAccessor& accessor,
ShadowFrame& shadow_frame,
- JValue result_register,
- bool interpret_one_instruction) REQUIRES_SHARED(Locks::mutator_lock_) {
+ JValue result_register) REQUIRES_SHARED(Locks::mutator_lock_) {
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);
+ self, accessor, shadow_frame, result_register, switch_impl_cpp);
}
NO_STACK_PROTECTOR
@@ -339,8 +338,7 @@ static inline JValue Execute(
VLOG(interpreter) << "Interpreting " << method->PrettyMethod();
- return ExecuteSwitch(
- self, accessor, shadow_frame, result_register, /*interpret_one_instruction=*/ false);
+ return ExecuteSwitch(self, accessor, shadow_frame, result_register);
}
void EnterInterpreterFromInvoke(Thread* self,
diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h
index 1ebac52c1e..3e741993db 100644
--- a/runtime/interpreter/interpreter_switch_impl-inl.h
+++ b/runtime/interpreter/interpreter_switch_impl-inl.h
@@ -2035,7 +2035,6 @@ void ExecuteSwitchImplCpp(SwitchImplContext* ctx) {
DCHECK(!shadow_frame.GetForceRetryInstruction())
<< "Entered interpreter from invoke without retry instruction being handled!";
- bool const interpret_one_instruction = ctx->interpret_one_instruction;
while (true) {
const Instruction* const inst = next;
dex_pc = inst->GetDexPc(insns);
@@ -2054,7 +2053,7 @@ void ExecuteSwitchImplCpp(SwitchImplContext* ctx) {
next = inst->RelativeAt(Instruction::SizeInCodeUnits(Instruction::FORMAT)); \
success = OP_##OPCODE_NAME<transaction_active>( \
ctx, instrumentation, self, shadow_frame, dex_pc, inst, inst_data, next, exit); \
- if (success && LIKELY(!interpret_one_instruction)) { \
+ if (success) { \
continue; \
} \
break; \
@@ -2076,11 +2075,6 @@ void ExecuteSwitchImplCpp(SwitchImplContext* ctx) {
}
// Continue execution in the catch block.
}
- if (interpret_one_instruction) {
- shadow_frame.SetDexPC(next->GetDexPc(insns)); // Record where we stopped.
- ctx->result = ctx->result_register;
- return;
- }
}
} // NOLINT(readability/fn_size)
diff --git a/runtime/interpreter/interpreter_switch_impl.h b/runtime/interpreter/interpreter_switch_impl.h
index 0b5a86f22d..9e5f8f5f7d 100644
--- a/runtime/interpreter/interpreter_switch_impl.h
+++ b/runtime/interpreter/interpreter_switch_impl.h
@@ -40,7 +40,6 @@ struct SwitchImplContext {
const CodeItemDataAccessor& accessor;
ShadowFrame& shadow_frame;
JValue& result_register;
- bool interpret_one_instruction;
JValue result;
};
@@ -60,7 +59,6 @@ ALWAYS_INLINE inline JValue ExecuteSwitchImpl(Thread* self,
const CodeItemDataAccessor& accessor,
ShadowFrame& shadow_frame,
JValue result_register,
- bool interpret_one_instruction,
const void* switch_impl_cpp)
REQUIRES_SHARED(Locks::mutator_lock_) {
SwitchImplContext ctx {
@@ -68,7 +66,6 @@ ALWAYS_INLINE inline JValue ExecuteSwitchImpl(Thread* self,
.accessor = accessor,
.shadow_frame = shadow_frame,
.result_register = result_register,
- .interpret_one_instruction = interpret_one_instruction,
.result = JValue(),
};
const uint16_t* dex_pc = ctx.accessor.Insns();