1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
10 class StackLevelSetter : public Phase
13 StackLevelSetter(Compiler* compiler);
15 virtual void DoPhase() override;
18 void ProcessBlock(BasicBlock* block);
20 #if !FEATURE_FIXED_OUT_ARGS
21 void SetThrowHelperBlocks(GenTree* node, BasicBlock* block);
22 void SetThrowHelperBlock(SpecialCodeKind kind, BasicBlock* block);
23 #endif // !FEATURE_FIXED_OUT_ARGS
25 unsigned PopArgumentsFromCall(GenTreeCall* call);
26 void AddStackLevel(unsigned value);
27 void SubStackLevel(unsigned value);
30 unsigned currentStackLevel; // current number of stack slots used by arguments.
31 unsigned maxStackLevel; // max number of stack slots for arguments.
33 CompAllocator memAllocator;
35 typedef JitHashTable<GenTreePutArgStk*, JitPtrKeyFuncs<GenTreePutArgStk>, unsigned> PutArgNumSlotsMap;
36 PutArgNumSlotsMap putArgNumSlots; // The hash table keeps stack slot sizes for active GT_PUTARG_STK nodes.
38 #if !FEATURE_FIXED_OUT_ARGS
39 bool framePointerRequired; // Is frame pointer required based on the analysis made by this phase.
40 bool throwHelperBlocksUsed; // Were any throw helper blocks created for this method.
41 #endif // !FEATURE_FIXED_OUT_ARGS