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/optimizing_unit_test.h | |
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/optimizing_unit_test.h')
-rw-r--r-- | compiler/optimizing/optimizing_unit_test.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_unit_test.h b/compiler/optimizing/optimizing_unit_test.h index b256d439fb..c8412b876b 100644 --- a/compiler/optimizing/optimizing_unit_test.h +++ b/compiler/optimizing/optimizing_unit_test.h @@ -542,9 +542,13 @@ class OptimizingUnitTestHelper { const std::vector<HInstruction*>& args, uint32_t dex_pc = kNoDexPc) { MethodReference method_reference{/* file= */ &graph_->GetDexFile(), /* index= */ method_idx_++}; + size_t num_64bit_args = std::count_if(args.begin(), args.end(), [](HInstruction* insn) { + return DataType::Is64BitType(insn->GetType()); + }); HInvokeStaticOrDirect* invoke = new (GetAllocator()) HInvokeStaticOrDirect(GetAllocator(), args.size(), + /* number_of_out_vregs= */ args.size() + num_64bit_args, return_type, dex_pc, method_reference, |