diff options
| author | 2023-09-06 09:48:56 +0800 | |
|---|---|---|
| committer | 2023-09-25 13:23:52 +0000 | |
| commit | 49c5411f40f58608fa3d7d8cd0a724b02895ac00 (patch) | |
| tree | 21ffccdbed9a18c00c01ec34878da4f6bf37c735 | |
| parent | dd0ea2528646ffae488decaf6b378fa5d4712da0 (diff) | |
RISCV: [Codegen] Add VisitNewArray
Test: m test-art-host-gtest
Bug: 283082089
Change-Id: I93f0ac9c3a7617e91ea480fc89617a7af0b109b6
Signed-off-by: Lifang Xia <lifang_xia@linux.alibaba.com>
Signed-off-by: Wendong Wang <wangwd@xcvmbyte.com>
| -rw-r--r-- | compiler/optimizing/code_generator_riscv64.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index 955ae8b0db..d5c8cdf531 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -4354,13 +4354,19 @@ void InstructionCodeGeneratorRISCV64::VisitNeg(HNeg* instruction) { } void LocationsBuilderRISCV64::VisitNewArray(HNewArray* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + LocationSummary* locations = new (GetGraph()->GetAllocator()) + LocationSummary(instruction, LocationSummary::kCallOnMainOnly); + InvokeRuntimeCallingConvention calling_convention; + locations->SetOut(calling_convention.GetReturnLocation(DataType::Type::kReference)); + locations->SetInAt(0, Location::RegisterLocation(calling_convention.GetRegisterAt(0))); + locations->SetInAt(1, Location::RegisterLocation(calling_convention.GetRegisterAt(1))); } void InstructionCodeGeneratorRISCV64::VisitNewArray(HNewArray* instruction) { - UNUSED(instruction); - LOG(FATAL) << "Unimplemented"; + QuickEntrypointEnum entrypoint = CodeGenerator::GetArrayAllocationEntrypoint(instruction); + codegen_->InvokeRuntime(entrypoint, instruction, instruction->GetDexPc()); + CheckEntrypointTypes<kQuickAllocArrayResolved, void*, mirror::Class*, int32_t>(); + DCHECK(!codegen_->IsLeafMethod()); } void LocationsBuilderRISCV64::VisitNewInstance(HNewInstance* instruction) { |