Changeset 194135 in webkit for trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
- Timestamp:
- Dec 16, 2015, 1:10:09 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
r193766 r194135 140 140 // replace any use of those pointers by the corresponding 141 141 // materialization 142 enum class Kind { Escaped, Object, Activation, Function, NewArrowFunction };142 enum class Kind { Escaped, Object, Activation, Function, ArrowFunction, GeneratorFunction }; 143 143 144 144 explicit Allocation(Node* identifier = nullptr, Kind kind = Kind::Escaped) … … 234 234 bool isFunctionAllocation() const 235 235 { 236 return m_kind == Kind::Function || m_kind == Kind::NewArrowFunction; 237 } 238 239 bool isArrowFunctionAllocation() const 240 { 241 return m_kind == Kind::NewArrowFunction; 236 return m_kind == Kind::Function || m_kind == Kind::ArrowFunction || m_kind == Kind::GeneratorFunction; 242 237 } 243 238 … … 275 270 break; 276 271 277 case Kind::NewArrowFunction: 278 out.print("NewArrowFunction"); 272 case Kind::ArrowFunction: 273 out.print("ArrowFunction"); 274 break; 275 276 case Kind::GeneratorFunction: 277 out.print("GeneratorFunction"); 279 278 break; 280 279 … … 838 837 839 838 case NewFunction: 840 case NewArrowFunction: { 839 case NewArrowFunction: 840 case NewGeneratorFunction: { 841 841 if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid()) { 842 842 m_heap.escape(node->child1().node()); … … 844 844 } 845 845 846 target = &m_heap.newAllocation(node, Allocation::Kind::Function); 846 if (node->op() == NewGeneratorFunction) 847 target = &m_heap.newAllocation(node, Allocation::Kind::GeneratorFunction); 848 else if (node->op() == NewArrowFunction) 849 target = &m_heap.newAllocation(node, Allocation::Kind::ArrowFunction); 850 else 851 target = &m_heap.newAllocation(node, Allocation::Kind::Function); 847 852 writes.add(FunctionExecutablePLoc, LazyNode(node->cellOperand())); 848 853 writes.add(FunctionActivationPLoc, LazyNode(node->child1().node())); … … 1447 1452 } 1448 1453 1449 case Allocation::Kind::NewArrowFunction: 1454 case Allocation::Kind::ArrowFunction: 1455 case Allocation::Kind::GeneratorFunction: 1450 1456 case Allocation::Kind::Function: { 1451 1457 FrozenValue* executable = allocation.identifier()->cellOperand(); 1452 1458 1453 NodeType nodeType = allocation.kind() == Allocation::Kind::NewArrowFunction ? NewArrowFunction : NewFunction; 1459 NodeType nodeType = 1460 allocation.kind() == Allocation::Kind::ArrowFunction ? NewArrowFunction : 1461 allocation.kind() == Allocation::Kind::GeneratorFunction ? NewGeneratorFunction : NewFunction; 1454 1462 1455 1463 return m_graph.addNode( … … 1783 1791 case NewArrowFunction: 1784 1792 case NewFunction: 1793 case NewGeneratorFunction: 1785 1794 node->convertToPhantomNewFunction(); 1786 1795 break; … … 2034 2043 2035 2044 case NewFunction: 2036 case NewArrowFunction: { 2045 case NewArrowFunction: 2046 case NewGeneratorFunction: { 2037 2047 Vector<PromotedHeapLocation> locations = m_locationsForAllocation.get(escapee); 2038 2048 ASSERT(locations.size() == 2);
Note:
See TracChangeset
for help on using the changeset viewer.