Changeset 193606 in webkit for trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
- Timestamp:
- Dec 6, 2015, 5:54:43 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
r193584 r193606 839 839 case NewFunction: 840 840 case NewArrowFunction: { 841 bool isArrowFunction = node->op() == NewArrowFunction; 841 842 if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid()) { 842 843 m_heap.escape(node->child1().node()); … … 844 845 } 845 846 846 target = &m_heap.newAllocation(node, Allocation::Kind::Function);847 target = &m_heap.newAllocation(node, isArrowFunction ? Allocation::Kind::NewArrowFunction : Allocation::Kind::Function); 847 848 writes.add(FunctionExecutablePLoc, LazyNode(node->cellOperand())); 848 849 writes.add(FunctionActivationPLoc, LazyNode(node->child1().node())); 850 if (isArrowFunction) 851 writes.add(ArrowFunctionBoundThisPLoc, LazyNode(node->child2().node())); 849 852 break; 850 853 } … … 1016 1019 break; 1017 1020 1021 case LoadArrowFunctionThis: 1022 target = m_heap.onlyLocalAllocation(node->child1().node()); 1023 if (target && target->isArrowFunctionAllocation()) 1024 exactRead = ArrowFunctionBoundThisPLoc; 1025 else 1026 m_heap.escape(node->child1().node()); 1027 break; 1028 1018 1029 case GetScope: 1019 1030 target = m_heap.onlyLocalAllocation(node->child1().node()); … … 2035 2046 case NewFunction: 2036 2047 case NewArrowFunction: { 2048 bool isArrowFunction = node->op() == NewArrowFunction; 2037 2049 Vector<PromotedHeapLocation> locations = m_locationsForAllocation.get(escapee); 2038 ASSERT(locations.size() == 2);2050 ASSERT(locations.size() == (isArrowFunction ? 3 : 2)); 2039 2051 2040 2052 PromotedHeapLocation executable(FunctionExecutablePLoc, allocation.identifier()); … … 2045 2057 2046 2058 node->child1() = Edge(resolve(block, activation), KnownCellUse); 2059 2060 if (isArrowFunction) { 2061 PromotedHeapLocation boundThis(ArrowFunctionBoundThisPLoc, allocation.identifier()); 2062 ASSERT(locations.contains(boundThis)); 2063 node->child2() = Edge(resolve(block, boundThis), CellUse); 2064 } 2065 2047 2066 break; 2048 2067 }
Note:
See TracChangeset
for help on using the changeset viewer.