Fix reading Time zone rules using Julian days (#17672)
[platform/upstream/coreclr.git] / src / jit / stacklevelsetter.h
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.
4
5 #pragma once
6
7 #include "compiler.h"
8 #include "phase.h"
9
10 class StackLevelSetter : public Phase
11 {
12 public:
13     StackLevelSetter(Compiler* compiler);
14
15     virtual void DoPhase() override;
16
17 private:
18     void ProcessBlock(BasicBlock* block);
19
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
24
25     unsigned PopArgumentsFromCall(GenTreeCall* call);
26     void AddStackLevel(unsigned value);
27     void SubStackLevel(unsigned value);
28
29 private:
30     unsigned currentStackLevel; // current number of stack slots used by arguments.
31     unsigned maxStackLevel;     // max number of stack slots for arguments.
32
33     CompAllocator memAllocator;
34
35     typedef JitHashTable<GenTreePutArgStk*, JitPtrKeyFuncs<GenTreePutArgStk>, unsigned> PutArgNumSlotsMap;
36     PutArgNumSlotsMap putArgNumSlots; // The hash table keeps stack slot sizes for active GT_PUTARG_STK nodes.
37
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
42 };