From dec7817522eeaf8f88dcae9ce065969aeebda3b3 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 19 Jun 2020 15:31:23 +0100 Subject: Optimizing: Introduce {Increase,Decrease}Frame(). And use it to clean up code generators. Also fix CFI in MaybeIncrementHotness() for arm/arm64/x86. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: testrunner.py --host --debuggable --ndebuggable \ --optimizing --jit --jit-on-first-use -t 178 Test: aosp_cf_x86_phone-userdebug boots. Test: aosp_cf_x86_phone-userdebug/jitzygote boots. Test: # On blueline: testrunner.py --target --debuggable --ndebuggable \ --optimizing --jit --jit-on-first-use -t 178 Bug: 112189621 Change-Id: I524e6c3054ffe1b05e2860fd7988cd9995df2963 --- compiler/optimizing/code_generator.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 4bfc14a12b..12e2e9745e 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -573,12 +573,12 @@ class CodeGenerator : public DeletableArenaObject { template - static size_t PrepareCriticalNativeCall(HInvokeStaticOrDirect* invoke, - /*out*/HParallelMove* parallel_move) { + size_t PrepareCriticalNativeCall(HInvokeStaticOrDirect* invoke) { DCHECK(!invoke->GetLocations()->Intrinsified()); CriticalNativeCallingConventionVisitor calling_convention_visitor( /*for_register_allocation=*/ false); - PrepareCriticalNativeArgumentMoves(invoke, &calling_convention_visitor, parallel_move); + HParallelMove parallel_move(GetGraph()->GetAllocator()); + PrepareCriticalNativeArgumentMoves(invoke, &calling_convention_visitor, ¶llel_move); size_t out_frame_size = RoundUp(calling_convention_visitor.GetStackOffset(), kNativeStackAlignment); if (kIsDebugBuild) { @@ -587,7 +587,7 @@ class CodeGenerator : public DeletableArenaObject { DCHECK_EQ(GetCriticalNativeDirectCallFrameSize(shorty, shorty_len), out_frame_size); } if (out_frame_size != 0u) { - AdjustCriticalNativeArgumentMoves(out_frame_size, parallel_move); + FinishCriticalNativeFrameSetup(out_frame_size, ¶llel_move); } return out_frame_size; } @@ -690,6 +690,9 @@ class CodeGenerator : public DeletableArenaObject { // Copy the result of a call into the given target. virtual void MoveFromReturnRegister(Location trg, DataType::Type type) = 0; + virtual void IncreaseFrame(size_t adjustment) = 0; + virtual void DecreaseFrame(size_t adjustment) = 0; + virtual void GenerateNop() = 0; static QuickEntrypointEnum GetArrayAllocationEntrypoint(HNewArray* new_array); @@ -826,8 +829,7 @@ class CodeGenerator : public DeletableArenaObject { /*inout*/InvokeDexCallingConventionVisitor* visitor, /*out*/HParallelMove* parallel_move); - static void AdjustCriticalNativeArgumentMoves(size_t out_frame_size, - /*inout*/HParallelMove* parallel_move); + void FinishCriticalNativeFrameSetup(size_t out_frame_size, /*inout*/HParallelMove* parallel_move); static const char* GetCriticalNativeShorty(HInvokeStaticOrDirect* invoke, uint32_t* shorty_len); -- cgit v1.2.3-59-g8ed1b