diff options
author | Vladimir Marko <vmarko@google.com> | 2020-06-19 15:31:23 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2020-06-22 08:05:28 +0000 |
commit | dec7817522eeaf8f88dcae9ce065969aeebda3b3 (patch) | |
tree | a15fd16ccb4a1929ec60584ead8f095b565c9e3e /compiler/optimizing/code_generator.h | |
parent | ea4d7d2d52dd9795cf39eccd46cb07551c62392f (diff) |
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
Diffstat (limited to 'compiler/optimizing/code_generator.h')
-rw-r--r-- | compiler/optimizing/code_generator.h | 14 |
1 files changed, 8 insertions, 6 deletions
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<kArenaAllocCodeGenerator> { template <typename CriticalNativeCallingConventionVisitor, size_t kNativeStackAlignment, size_t GetCriticalNativeDirectCallFrameSize(const char* shorty, uint32_t shorty_len)> - 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<kArenaAllocCodeGenerator> { 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<kArenaAllocCodeGenerator> { // 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<kArenaAllocCodeGenerator> { /*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); |