From 3e75615ad25b6af1842b194e78b429b0f585b46a Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 8 Aug 2024 15:33:56 +0000 Subject: 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 --- compiler/optimizing/optimizing_unit_test.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/optimizing/optimizing_unit_test.h') 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& 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, -- cgit v1.2.3-59-g8ed1b