diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGNode.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGNode.h | 111 |
1 files changed, 106 insertions, 5 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGNode.h b/Source/JavaScriptCore/dfg/DFGNode.h index e66629ec4..18c8ce16f 100644 --- a/Source/JavaScriptCore/dfg/DFGNode.h +++ b/Source/JavaScriptCore/dfg/DFGNode.h @@ -62,6 +62,7 @@ struct StructureTransitionData { struct NewArrayBufferData { unsigned startConstant; unsigned numConstants; + IndexingType indexingType; }; // This type used in passing an immediate argument to Node constructor; @@ -268,6 +269,26 @@ struct Node { convertToStructureTransitionWatchpoint(structureSet().singletonStructure()); } + void convertToGetByOffset(unsigned storageAccessDataIndex, NodeIndex storage) + { + ASSERT(m_op == GetById || m_op == GetByIdFlush); + m_opInfo = storageAccessDataIndex; + children.setChild1(Edge(storage)); + m_op = GetByOffset; + m_flags &= ~NodeClobbersWorld; + } + + void convertToPutByOffset(unsigned storageAccessDataIndex, NodeIndex storage) + { + ASSERT(m_op == PutById || m_op == PutByIdDirect); + m_opInfo = storageAccessDataIndex; + children.setChild3(children.child2()); + children.setChild2(children.child1()); + children.setChild1(Edge(storage)); + m_op = PutByOffset; + m_flags &= ~NodeClobbersWorld; + } + JSCell* weakConstant() { ASSERT(op() == WeakJSConstant); @@ -433,6 +454,32 @@ struct Node { return newArrayBufferData()->numConstants; } + bool hasIndexingType() + { + switch (op()) { + case NewArray: + case NewArrayWithSize: + case NewArrayBuffer: + return true; + default: + return false; + } + } + + IndexingType indexingType() + { + ASSERT(hasIndexingType()); + if (op() == NewArrayBuffer) + return newArrayBufferData()->indexingType; + return m_opInfo; + } + + void setIndexingType(IndexingType indexingType) + { + ASSERT(hasIndexingType()); + m_opInfo = indexingType; + } + bool hasRegexpIndex() { return op() == NewRegexp; @@ -518,6 +565,11 @@ struct Node { return (m_flags & NodeResultMask) == NodeResultBoolean; } + bool hasStorageResult() + { + return (m_flags & NodeResultMask) == NodeResultStorage; + } + bool isJump() { return op() == Jump; @@ -649,15 +701,23 @@ struct Node { return mergeSpeculation(m_opInfo2, prediction); } - bool hasFunctionCheckData() + bool hasFunction() { - return op() == CheckFunction; + switch (op()) { + case CheckFunction: + case InheritorIDWatchpoint: + return true; + default: + return false; + } } - JSFunction* function() + JSCell* function() { - ASSERT(hasFunctionCheckData()); - return reinterpret_cast<JSFunction*>(m_opInfo); + ASSERT(hasFunction()); + JSCell* result = reinterpret_cast<JSFunction*>(m_opInfo); + ASSERT(JSValue(result).isFunction()); + return result; } bool hasStructureTransitionData() @@ -702,6 +762,7 @@ struct Node { case StructureTransitionWatchpoint: case ForwardStructureTransitionWatchpoint: case ArrayifyToStructure: + case NewObject: return true; default: return false; @@ -922,16 +983,36 @@ struct Node { return isInt32Speculation(prediction()); } + bool shouldSpeculateIntegerForArithmetic() + { + return isInt32SpeculationForArithmetic(prediction()); + } + + bool shouldSpeculateIntegerExpectingDefined() + { + return isInt32SpeculationExpectingDefined(prediction()); + } + bool shouldSpeculateDouble() { return isDoubleSpeculation(prediction()); } + bool shouldSpeculateDoubleForArithmetic() + { + return isDoubleSpeculationForArithmetic(prediction()); + } + bool shouldSpeculateNumber() { return isNumberSpeculation(prediction()); } + bool shouldSpeculateNumberExpectingDefined() + { + return isNumberSpeculationExpectingDefined(prediction()); + } + bool shouldSpeculateBoolean() { return isBooleanSpeculation(prediction()); @@ -1037,11 +1118,31 @@ struct Node { return op1.shouldSpeculateInteger() && op2.shouldSpeculateInteger(); } + static bool shouldSpeculateIntegerForArithmetic(Node& op1, Node& op2) + { + return op1.shouldSpeculateIntegerForArithmetic() && op2.shouldSpeculateIntegerForArithmetic(); + } + + static bool shouldSpeculateIntegerExpectingDefined(Node& op1, Node& op2) + { + return op1.shouldSpeculateIntegerExpectingDefined() && op2.shouldSpeculateIntegerExpectingDefined(); + } + + static bool shouldSpeculateDoubleForArithmetic(Node& op1, Node& op2) + { + return op1.shouldSpeculateDoubleForArithmetic() && op2.shouldSpeculateDoubleForArithmetic(); + } + static bool shouldSpeculateNumber(Node& op1, Node& op2) { return op1.shouldSpeculateNumber() && op2.shouldSpeculateNumber(); } + static bool shouldSpeculateNumberExpectingDefined(Node& op1, Node& op2) + { + return op1.shouldSpeculateNumberExpectingDefined() && op2.shouldSpeculateNumberExpectingDefined(); + } + static bool shouldSpeculateFinalObject(Node& op1, Node& op2) { return op1.shouldSpeculateFinalObject() && op2.shouldSpeculateFinalObject(); |