summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGNode.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGNode.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGNode.h111
1 files changed, 77 insertions, 34 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h
index 12ebba823..64e6fe097 100644
--- a/Source/JavaScriptCore/dfg/DFGNode.h
+++ b/Source/JavaScriptCore/dfg/DFGNode.h
@@ -39,7 +39,7 @@
#include "DFGVariableAccessData.h"
#include "JSValue.h"
#include "Operands.h"
-#include "PredictedType.h"
+#include "SpeculatedType.h"
#include "ValueProfile.h"
namespace JSC { namespace DFG {
@@ -82,7 +82,7 @@ struct Node {
, children(AdjacencyList::Fixed, child1, child2, child3)
, m_virtualRegister(InvalidVirtualRegister)
, m_refCount(0)
- , m_prediction(PredictNone)
+ , m_prediction(SpecNone)
{
setOpAndDefaultFlags(op);
ASSERT(!(m_flags & NodeHasVarArgs));
@@ -95,7 +95,7 @@ struct Node {
, m_virtualRegister(InvalidVirtualRegister)
, m_refCount(0)
, m_opInfo(imm.m_value)
- , m_prediction(PredictNone)
+ , m_prediction(SpecNone)
{
setOpAndDefaultFlags(op);
ASSERT(!(m_flags & NodeHasVarArgs));
@@ -109,7 +109,7 @@ struct Node {
, m_refCount(0)
, m_opInfo(imm1.m_value)
, m_opInfo2(safeCast<unsigned>(imm2.m_value))
- , m_prediction(PredictNone)
+ , m_prediction(SpecNone)
{
setOpAndDefaultFlags(op);
ASSERT(!(m_flags & NodeHasVarArgs));
@@ -123,7 +123,7 @@ struct Node {
, m_refCount(0)
, m_opInfo(imm1.m_value)
, m_opInfo2(safeCast<unsigned>(imm2.m_value))
- , m_prediction(PredictNone)
+ , m_prediction(SpecNone)
{
setOpAndDefaultFlags(op);
ASSERT(m_flags & NodeHasVarArgs);
@@ -421,7 +421,7 @@ struct Node {
bool hasVarNumber()
{
- return op() == GetGlobalVar || op() == PutGlobalVar || op() == GetScopedVar || op() == PutScopedVar;
+ return op() == GetScopedVar || op() == PutScopedVar;
}
unsigned varNumber()
@@ -429,6 +429,27 @@ struct Node {
ASSERT(hasVarNumber());
return m_opInfo;
}
+
+ bool hasIdentifierNumberForCheck()
+ {
+ return op() == GlobalVarWatchpoint || op() == PutGlobalVarCheck;
+ }
+
+ unsigned identifierNumberForCheck()
+ {
+ ASSERT(hasIdentifierNumberForCheck());
+ return m_opInfo2;
+ }
+
+ bool hasRegisterPointer()
+ {
+ return op() == GetGlobalVar || op() == PutGlobalVar || op() == GlobalVarWatchpoint || op() == PutGlobalVarCheck;
+ }
+
+ WriteBarrier<Unknown>* registerPointer()
+ {
+ return bitwise_cast<WriteBarrier<Unknown>*>(m_opInfo);
+ }
bool hasScopeChainDepth()
{
@@ -584,17 +605,17 @@ struct Node {
}
}
- PredictedType getHeapPrediction()
+ SpeculatedType getHeapPrediction()
{
ASSERT(hasHeapPrediction());
- return static_cast<PredictedType>(m_opInfo2);
+ return static_cast<SpeculatedType>(m_opInfo2);
}
- bool predictHeap(PredictedType prediction)
+ bool predictHeap(SpeculatedType prediction)
{
ASSERT(hasHeapPrediction());
- return mergePrediction(m_opInfo2, prediction);
+ return mergeSpeculation(m_opInfo2, prediction);
}
bool hasFunctionCheckData()
@@ -630,6 +651,17 @@ struct Node {
return *reinterpret_cast<StructureSet*>(m_opInfo);
}
+ bool hasStructure()
+ {
+ return op() == StructureTransitionWatchpoint;
+ }
+
+ Structure* structure()
+ {
+ ASSERT(hasStructure());
+ return reinterpret_cast<Structure*>(m_opInfo);
+ }
+
bool hasStorageAccessData()
{
return op() == GetByOffset || op() == PutByOffset;
@@ -682,6 +714,17 @@ struct Node {
ASSERT(m_virtualRegister == InvalidVirtualRegister);
m_virtualRegister = virtualRegister;
}
+
+ bool hasArgumentPositionStart()
+ {
+ return op() == InlineStart;
+ }
+
+ unsigned argumentPositionStart()
+ {
+ ASSERT(hasArgumentPositionStart());
+ return m_opInfo;
+ }
bool shouldGenerate()
{
@@ -756,114 +799,114 @@ struct Node {
return children.numChildren();
}
- PredictedType prediction()
+ SpeculatedType prediction()
{
return m_prediction;
}
- bool predict(PredictedType prediction)
+ bool predict(SpeculatedType prediction)
{
- return mergePrediction(m_prediction, prediction);
+ return mergeSpeculation(m_prediction, prediction);
}
bool shouldSpeculateInteger()
{
- return isInt32Prediction(prediction());
+ return isInt32Speculation(prediction());
}
bool shouldSpeculateDouble()
{
- return isDoublePrediction(prediction());
+ return isDoubleSpeculation(prediction());
}
bool shouldSpeculateNumber()
{
- return isNumberPrediction(prediction());
+ return isNumberSpeculation(prediction());
}
bool shouldSpeculateBoolean()
{
- return isBooleanPrediction(prediction());
+ return isBooleanSpeculation(prediction());
}
bool shouldSpeculateFinalObject()
{
- return isFinalObjectPrediction(prediction());
+ return isFinalObjectSpeculation(prediction());
}
bool shouldSpeculateFinalObjectOrOther()
{
- return isFinalObjectOrOtherPrediction(prediction());
+ return isFinalObjectOrOtherSpeculation(prediction());
}
bool shouldSpeculateArray()
{
- return isArrayPrediction(prediction());
+ return isArraySpeculation(prediction());
}
bool shouldSpeculateArguments()
{
- return isArgumentsPrediction(prediction());
+ return isArgumentsSpeculation(prediction());
}
bool shouldSpeculateInt8Array()
{
- return isInt8ArrayPrediction(prediction());
+ return isInt8ArraySpeculation(prediction());
}
bool shouldSpeculateInt16Array()
{
- return isInt16ArrayPrediction(prediction());
+ return isInt16ArraySpeculation(prediction());
}
bool shouldSpeculateInt32Array()
{
- return isInt32ArrayPrediction(prediction());
+ return isInt32ArraySpeculation(prediction());
}
bool shouldSpeculateUint8Array()
{
- return isUint8ArrayPrediction(prediction());
+ return isUint8ArraySpeculation(prediction());
}
bool shouldSpeculateUint8ClampedArray()
{
- return isUint8ClampedArrayPrediction(prediction());
+ return isUint8ClampedArraySpeculation(prediction());
}
bool shouldSpeculateUint16Array()
{
- return isUint16ArrayPrediction(prediction());
+ return isUint16ArraySpeculation(prediction());
}
bool shouldSpeculateUint32Array()
{
- return isUint32ArrayPrediction(prediction());
+ return isUint32ArraySpeculation(prediction());
}
bool shouldSpeculateFloat32Array()
{
- return isFloat32ArrayPrediction(prediction());
+ return isFloat32ArraySpeculation(prediction());
}
bool shouldSpeculateFloat64Array()
{
- return isFloat64ArrayPrediction(prediction());
+ return isFloat64ArraySpeculation(prediction());
}
bool shouldSpeculateArrayOrOther()
{
- return isArrayOrOtherPrediction(prediction());
+ return isArrayOrOtherSpeculation(prediction());
}
bool shouldSpeculateObject()
{
- return isObjectPrediction(prediction());
+ return isObjectSpeculation(prediction());
}
bool shouldSpeculateCell()
{
- return isCellPrediction(prediction());
+ return isCellSpeculation(prediction());
}
static bool shouldSpeculateInteger(Node& op1, Node& op2)
@@ -921,7 +964,7 @@ private:
uintptr_t m_opInfo;
unsigned m_opInfo2;
// The prediction ascribed to this node after propagation.
- PredictedType m_prediction;
+ SpeculatedType m_prediction;
};
} } // namespace JSC::DFG