forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreelifeupdater.h
32 lines (27 loc) · 1.08 KB
/
treelifeupdater.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma once
#include "compiler.h"
//------------------------------------------------------------------------
// TreeLifeUpdater: class that handles changes in variable liveness from a given tree.
// Keeps set of temporary VARSET_TP during its lifetime to avoid unnecessary memory allocations.
template <bool ForCodeGen>
class TreeLifeUpdater
{
public:
TreeLifeUpdater(Compiler* compiler);
void UpdateLife(GenTree* tree);
bool UpdateLifeFieldVar(GenTreeLclVar* lclNode, unsigned multiRegIndex);
private:
void UpdateLifeVar(GenTree* tree, GenTreeLclVarCommon* lclVarTree);
void UpdateLifeBit(VARSET_TP& set, LclVarDsc* dsc, bool isBorn, bool isDying);
void StoreCurrentLifeForDump();
void DumpLifeDelta(GenTree* tree);
private:
Compiler* compiler;
#ifdef DEBUG
unsigned epoch; // VarSets epoch when the class was created, must stay the same during its using.
VARSET_TP oldLife;
VARSET_TP oldStackPtrsLife;
#endif // DEBUG
};