Basic implementation of invoke / invoke-polymorphic.
Basic switch interpreter support for invoke-polymorphic. This change
allows for virtual/interface and static invokes on method handles.
Support for direct invokes (including constructors) and field
getters and setters will be added in follow up changes.
Bug: 30550796
Test: make test-art-host
Change-Id: Ieb3a991d974060d930d56467908d5c7c11d0e38e
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index 227130e..6cff1da 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -1542,6 +1542,21 @@
POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_3xx);
break;
}
+ case Instruction::INVOKE_POLYMORPHIC: {
+ PREAMBLE();
+ bool success = DoInvokePolymorphic<false, do_access_check>(
+ self, shadow_frame, inst, inst_data, &result_register);
+ POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_4xx);
+ break;
+ }
+ case Instruction::INVOKE_POLYMORPHIC_RANGE: {
+ PREAMBLE();
+ bool success = DoInvokePolymorphic<true, do_access_check>(
+ self, shadow_frame, inst, inst_data, &result_register);
+ POSSIBLY_HANDLE_PENDING_EXCEPTION(!success, Next_4xx);
+ break;
+ break;
+ }
case Instruction::NEG_INT:
PREAMBLE();
shadow_frame.SetVReg(
@@ -2323,8 +2338,6 @@
case Instruction::UNUSED_FC ... Instruction::UNUSED_FF:
case Instruction::UNUSED_79:
case Instruction::UNUSED_7A:
- case Instruction::INVOKE_POLYMORPHIC:
- case Instruction::INVOKE_POLYMORPHIC_RANGE:
UnexpectedOpcode(inst, shadow_frame);
}
} while (!interpret_one_instruction);