DFGAtTailAbstractState.h [plain text]
#pragma once
#if ENABLE(DFG_JIT)
#include "DFGAbstractValue.h"
#include "DFGBasicBlock.h"
#include "DFGBlockMap.h"
#include "DFGGraph.h"
#include "DFGNodeFlowProjection.h"
namespace JSC { namespace DFG {
class AtTailAbstractState {
public:
AtTailAbstractState(Graph&);
~AtTailAbstractState();
explicit operator bool() const { return true; }
void initializeTo(BasicBlock* block)
{
m_block = block;
}
void createValueForNode(NodeFlowProjection);
AbstractValue& forNode(NodeFlowProjection);
AbstractValue& forNode(Edge edge) { return forNode(edge.node()); }
Operands<AbstractValue>& variables() { return m_block->valuesAtTail; }
BasicBlock* block() const { return m_block; }
bool isValid() { return m_block->cfaDidFinish; }
StructureClobberState structureClobberState() const { return m_block->cfaStructureClobberStateAtTail; }
void setDidClobber(bool) { }
void setStructureClobberState(StructureClobberState state) { RELEASE_ASSERT(state == m_block->cfaStructureClobberStateAtTail); }
void setIsValid(bool isValid) { m_block->cfaDidFinish = isValid; }
void setBranchDirection(BranchDirection) { }
void setFoundConstants(bool) { }
void trustEdgeProofs() { m_trustEdgeProofs = true; }
void dontTrustEdgeProofs() { m_trustEdgeProofs = false; }
void setProofStatus(Edge& edge, ProofStatus status)
{
if (m_trustEdgeProofs)
edge.setProofStatus(status);
}
private:
Graph& m_graph;
BlockMap<HashMap<NodeFlowProjection, AbstractValue>> m_valuesAtTailMap;
BasicBlock* m_block { nullptr };
bool m_trustEdgeProofs { false };
};
} }
#endif // ENABLE(DFG_JIT)