Changeset 204393 in webkit for trunk/Source/JavaScriptCore/dfg/DFGGraph.h
- Timestamp:
- Aug 11, 2016, 5:22:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGGraph.h
r204355 r204393 30 30 31 31 #include "AssemblyHelpers.h" 32 #include "B3SparseCollection.h"33 32 #include "BytecodeLivenessAnalysisInlines.h" 34 33 #include "CodeBlock.h" … … 36 35 #include "DFGBasicBlock.h" 37 36 #include "DFGFrozenValue.h" 37 #include "DFGLongLivedState.h" 38 38 #include "DFGNode.h" 39 #include "DFGNodeAllocator.h" 39 40 #include "DFGPlan.h" 40 41 #include "DFGPropertyTypeKey.h" … … 124 125 class Graph : public virtual Scannable { 125 126 public: 126 Graph(VM&, Plan& );127 Graph(VM&, Plan&, LongLivedState&); 127 128 ~Graph(); 128 129 … … 184 185 Node* addNode(Params... params) 185 186 { 186 Node* node = new Node(params...);187 m_nodes.add(std::unique_ptr<Node>(node));187 Node* node = new (m_allocator) Node(params...); 188 addNodeToMapByIndex(node); 188 189 return node; 189 190 } … … 191 192 Node* addNode(SpeculatedType type, Params... params) 192 193 { 193 Node* node = addNode(params...);194 Node* node = new (m_allocator) Node(params...); 194 195 node->predict(type); 196 addNodeToMapByIndex(node); 195 197 return node; 196 198 } 199 197 200 void deleteNode(Node*); 198 unsigned maxNodeCount() const { return m_nodes .size(); }199 Node* nodeAt(unsigned index) const { return m_nodes [index]; }201 unsigned maxNodeCount() const { return m_nodesByIndex.size(); } 202 Node* nodeAt(unsigned index) const { return m_nodesByIndex[index]; } 200 203 void packNodeIndices(); 201 204 … … 835 838 CodeBlock* m_codeBlock; 836 839 CodeBlock* m_profiledBlock; 840 841 NodeAllocator& m_allocator; 837 842 838 843 Vector< RefPtr<BasicBlock> , 8> m_blocks; … … 923 928 bool m_hasExceptionHandlers { false }; 924 929 private: 925 void ad optNodeOutOfLine(Node&);930 void addNodeToMapByIndex(Node*); 926 931 927 932 bool isStringPrototypeMethodSane(JSGlobalObject*, UniquedStringImpl*); … … 957 962 } 958 963 959 B3::SparseCollection<Node> m_nodes; 964 Vector<Node*, 0, UnsafeVectorOverflow> m_nodesByIndex; 965 Vector<unsigned, 0, UnsafeVectorOverflow> m_nodeIndexFreeList; 960 966 Vector<AbstractValue, 0, UnsafeVectorOverflow> m_abstractValuesCache; 961 967 };
Note:
See TracChangeset
for help on using the changeset viewer.