From e3e187f29fa4025e30c5a43decb2b6f6c584d59c Mon Sep 17 00:00:00 2001 From: Andra Danciu Date: Thu, 30 Jul 2020 12:19:31 +0000 Subject: Check if VarHandle access mode is supported. This commit checks if a VarHandle access mode is supported. If not, an UnsupportedOperationException is raised by calling the runtime to handle it. I added the polymorphic intrinsics case in the IntrinsicSlowPath code generation to handle all the eventual exceptions. For now, none of the operations are actually compiled. If the slow path is not called, the runtime handles the operation. Bug: b/65872996 Test: art/test.py --host -r -t 712-varhandle-invocations --32 Test: art/test.py --host --all-compiler -r Change-Id: I5a637561549b3fdd64fa53e2d7dbf835d3ae0d64 --- compiler/optimizing/code_generator.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/code_generator.cc') diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 8e64e1819e..6bfdacfb7f 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -630,12 +630,13 @@ void CodeGenerator::GenerateInvokeUnresolvedRuntimeCall(HInvokeUnresolved* invok InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), nullptr); } -void CodeGenerator::GenerateInvokePolymorphicCall(HInvokePolymorphic* invoke) { +void CodeGenerator::GenerateInvokePolymorphicCall(HInvokePolymorphic* invoke, + SlowPathCode* slow_path) { // invoke-polymorphic does not use a temporary to convey any additional information (e.g. a // method index) since it requires multiple info from the instruction (registers A, B, H). Not // using the reservation has no effect on the registers used in the runtime call. QuickEntrypointEnum entrypoint = kQuickInvokePolymorphic; - InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), nullptr); + InvokeRuntime(entrypoint, invoke, invoke->GetDexPc(), slow_path); } void CodeGenerator::GenerateInvokeCustomCall(HInvokeCustom* invoke) { -- cgit v1.2.3