#ifndef DFGBasicBlock_h
#define DFGBasicBlock_h
#if ENABLE(DFG_JIT)
#include "DFGAbstractValue.h"
#include "DFGNode.h"
#include "Operands.h"
#include <wtf/OwnPtr.h>
#include <wtf/Vector.h>
namespace JSC { namespace DFG {
typedef Vector <BlockIndex, 2> PredecessorList;
struct BasicBlock : Vector<NodeIndex, 8> {
BasicBlock(unsigned bytecodeBegin, unsigned numArguments, unsigned numLocals)
: bytecodeBegin(bytecodeBegin)
, isOSRTarget(false)
, cfaHasVisited(false)
, cfaShouldRevisit(false)
#if !ASSERT_DISABLED
, isLinked(false)
#endif
, isReachable(false)
, variablesAtHead(numArguments, numLocals)
, variablesAtTail(numArguments, numLocals)
, valuesAtHead(numArguments, numLocals)
, valuesAtTail(numArguments, numLocals)
{
}
void ensureLocals(unsigned newNumLocals)
{
variablesAtHead.ensureLocals(newNumLocals);
variablesAtTail.ensureLocals(newNumLocals);
valuesAtHead.ensureLocals(newNumLocals);
valuesAtTail.ensureLocals(newNumLocals);
}
unsigned bytecodeBegin;
bool isOSRTarget;
bool cfaHasVisited;
bool cfaShouldRevisit;
#if !ASSERT_DISABLED
bool isLinked;
#endif
bool isReachable;
Vector<NodeIndex> phis;
PredecessorList m_predecessors;
Operands<NodeIndex, NodeIndexTraits> variablesAtHead;
Operands<NodeIndex, NodeIndexTraits> variablesAtTail;
Operands<AbstractValue> valuesAtHead;
Operands<AbstractValue> valuesAtTail;
};
struct UnlinkedBlock {
BlockIndex m_blockIndex;
bool m_needsNormalLinking;
bool m_needsEarlyReturnLinking;
UnlinkedBlock() { }
explicit UnlinkedBlock(BlockIndex blockIndex)
: m_blockIndex(blockIndex)
, m_needsNormalLinking(true)
, m_needsEarlyReturnLinking(false)
{
}
};
} }
#endif // ENABLE(DFG_JIT)
#endif // DFGBasicBlock_h