diff options
author | 2024-08-08 15:33:56 +0000 | |
---|---|---|
committer | 2024-08-13 08:09:37 +0000 | |
commit | 3e75615ad25b6af1842b194e78b429b0f585b46a (patch) | |
tree | cd74101af342d0798827aa853f1f5e34cc1c01a6 /compiler/optimizing/instruction_builder.cc | |
parent | ccbbe37bb19c714be0beac4d21bbe7abc214738c (diff) |
Calculate the number of out vregs.
Determine the number of out vregs needed by invokes that
actually make a call, and by `HStringBuilderAppend`s.
This can yield smaller frame sizes of compiled methods when
some calls are inlined or fully intrinsified.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 358519867
Change-Id: I4930a9bd811b1de14658f5ef44e65eadea6a7961
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r-- | compiler/optimizing/instruction_builder.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index c97c78ca17..5cdefd9717 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -501,6 +501,7 @@ void HInstructionBuilder::BuildIntrinsic(ArtMethod* method) { HInvokeStaticOrDirect* invoke = new (allocator_) HInvokeStaticOrDirect( allocator_, number_of_arguments, + /* number_of_out_vregs= */ in_vregs, return_type_, kNoDexPc, target_method, @@ -1066,6 +1067,7 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, MethodCompilationStat::kUnresolvedMethod); HInvoke* invoke = new (allocator_) HInvokeUnresolved(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), return_type, dex_pc, method_reference, @@ -1086,6 +1088,7 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, HInvoke* invoke = new (allocator_) HInvokeStaticOrDirect( allocator_, number_of_arguments - 1, + operands.GetNumberOfOperands() - 1, /* return_type= */ DataType::Type::kReference, dex_pc, method_reference, @@ -1151,6 +1154,7 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, } invoke = new (allocator_) HInvokeStaticOrDirect(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), return_type, dex_pc, method_reference, @@ -1170,6 +1174,7 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, } else if (invoke_type == kVirtual) { invoke = new (allocator_) HInvokeVirtual(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), return_type, dex_pc, method_reference, @@ -1191,6 +1196,7 @@ bool HInstructionBuilder::BuildInvoke(const Instruction& instruction, .method_load_kind; invoke = new (allocator_) HInvokeInterface(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), return_type, dex_pc, method_reference, @@ -1392,6 +1398,7 @@ bool HInstructionBuilder::BuildInvokePolymorphic(uint32_t dex_pc, MethodReference method_reference(&graph_->GetDexFile(), method_idx); HInvoke* invoke = new (allocator_) HInvokePolymorphic(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), return_type, dex_pc, method_reference, @@ -1433,6 +1440,7 @@ bool HInstructionBuilder::BuildInvokeCustom(uint32_t dex_pc, MethodReference method_reference(&graph_->GetDexFile(), dex::kDexNoIndex); HInvoke* invoke = new (allocator_) HInvokeCustom(allocator_, number_of_arguments, + operands.GetNumberOfOperands(), call_site_idx, return_type, dex_pc, |