Changeset 194141 in webkit
- Timestamp:
- Dec 16, 2015 4:47:55 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194136 r194141 1 2015-12-16 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r194135. 4 https://bugs.webkit.org/show_bug.cgi?id=152333 5 6 due to missing OSR exit materialization support in FTL 7 (Requested by yusukesuzuki on #webkit). 8 9 Reverted changeset: 10 11 "[ES6] Handle new_generator_func / new_generator_func_exp in 12 DFG / FTL" 13 https://bugs.webkit.org/show_bug.cgi?id=152227 14 http://trac.webkit.org/changeset/194135 15 1 16 2015-12-16 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 17 -
trunk/LayoutTests/js/regress/script-tests/generator-function-create.js
r194135 r194141 8 8 return gen; 9 9 } 10 function test() 11 { 12 for (var i = 0; i < 500; ++i) 13 createGeneratorFunction(); 14 } 15 noInline(test); 16 10 noInline(createGeneratorFunction); 17 11 for (var i = 0; i < 1e4; ++i) 18 test();12 createGeneratorFunction(); -
trunk/Source/JavaScriptCore/ChangeLog
r194140 r194141 1 2015-12-16 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r194135. 4 https://bugs.webkit.org/show_bug.cgi?id=152333 5 6 due to missing OSR exit materialization support in FTL 7 (Requested by yusukesuzuki on #webkit). 8 9 Reverted changeset: 10 11 "[ES6] Handle new_generator_func / new_generator_func_exp in 12 DFG / FTL" 13 https://bugs.webkit.org/show_bug.cgi?id=152227 14 http://trac.webkit.org/changeset/194135 15 1 16 2015-12-16 Youenn Fablet <youenn.fablet@crf.canon.fr> 2 17 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r194135 r194141 1761 1761 m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->arrowFunctionStructure()); 1762 1762 break; 1763 1764 case NewGeneratorFunction: 1765 forNode(node).set( 1766 m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->generatorFunctionStructure()); 1767 break; 1768 1763 1769 1764 case NewFunction: 1770 1765 forNode(node).set( -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r194135 r194141 4558 4558 } 4559 4559 4560 case op_new_func: 4561 case op_new_generator_func: { 4560 case op_new_func: { 4562 4561 FunctionExecutable* decl = m_inlineStackTop->m_profiledBlock->functionDecl(currentInstruction[3].u.operand); 4563 4562 FrozenValue* frozen = m_graph.freezeStrong(decl); 4564 NodeType op = (opcodeID == op_new_generator_func) ? NewGeneratorFunction : NewFunction; 4565 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(op, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand)))); 4566 static_assert(OPCODE_LENGTH(op_new_func) == OPCODE_LENGTH(op_new_generator_func), "The length of op_new_func should eqaual to one of op_new_generator_func"); 4563 set(VirtualRegister(currentInstruction[1].u.operand), 4564 addToGraph(NewFunction, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand)))); 4567 4565 NEXT_OPCODE(op_new_func); 4568 4566 } 4569 4567 4570 4568 case op_new_func_exp: 4571 case op_new_generator_func_exp:4572 4569 case op_new_arrow_func_exp: { 4573 4570 FunctionExecutable* expr = m_inlineStackTop->m_profiledBlock->functionExpr(currentInstruction[3].u.operand); 4574 4571 FrozenValue* frozen = m_graph.freezeStrong(expr); 4575 NodeType op = (opcodeID == op_new_generator_func_exp) ? NewGeneratorFunction : NewFunction;4576 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(op, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand))));4577 4578 if (opcodeID == op_new_func_exp || opcodeID == op_new_generator_func_exp) {4572 set(VirtualRegister(currentInstruction[1].u.operand), 4573 addToGraph(NewFunction, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand)))); 4574 4575 if (opcodeID == op_new_func_exp) { 4579 4576 // Curly braces are necessary 4580 static_assert(OPCODE_LENGTH(op_new_func_exp) == OPCODE_LENGTH(op_new_generator_func_exp), "The length of op_new_func_exp should eqaual to one of op_new_generator_func_exp");4581 4577 NEXT_OPCODE(op_new_func_exp); 4582 4578 } else { -
trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
r194135 r194141 216 216 case op_new_func: 217 217 case op_new_func_exp: 218 case op_new_generator_func:219 case op_new_generator_func_exp:220 218 case op_new_arrow_func_exp: 221 219 case op_create_lexical_environment: -
trunk/Source/JavaScriptCore/dfg/DFGClobberize.h
r194135 r194141 1034 1034 case NewArrowFunction: 1035 1035 case NewFunction: 1036 case NewGeneratorFunction:1037 1036 if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid()) 1038 1037 write(Watchpoint_fire); -
trunk/Source/JavaScriptCore/dfg/DFGClobbersExitState.cpp
r194135 r194141 78 78 case NewArrowFunction: 79 79 case NewFunction: 80 case NewGeneratorFunction:81 80 // Like above, but with the JSFunction allocation caveat. 82 81 return node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid(); -
trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
r194135 r194141 248 248 case NewArrowFunction: 249 249 case NewFunction: 250 case NewGeneratorFunction:251 250 case NewTypedArray: 252 251 case ThrowReferenceError: -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r194135 r194141 1388 1388 case CreateScopedArguments: 1389 1389 case CreateActivation: 1390 case NewFunction: 1391 case NewGeneratorFunction: { 1390 case NewFunction: { 1392 1391 fixEdge<CellUse>(node->child1()); 1393 1392 break; -
trunk/Source/JavaScriptCore/dfg/DFGMayExit.cpp
r194135 r194141 144 144 case NewFunction: 145 145 case NewArrowFunction: 146 case NewGeneratorFunction:147 146 case NewStringObject: 148 147 case CreateActivation: -
trunk/Source/JavaScriptCore/dfg/DFGNode.h
r194135 r194141 586 586 void convertToPhantomNewFunction() 587 587 { 588 ASSERT(m_op == NewFunction || m_op == NewArrowFunction || m_op == NewGeneratorFunction);588 ASSERT(m_op == NewFunction || m_op == NewArrowFunction); 589 589 m_op = PhantomNewFunction; 590 590 m_flags |= NodeMustGenerate; … … 1357 1357 case NewFunction: 1358 1358 case NewArrowFunction: 1359 case NewGeneratorFunction:1360 1359 case CreateActivation: 1361 1360 case MaterializeCreateActivation: … … 1576 1575 case NewArrowFunction: 1577 1576 case NewFunction: 1578 case NewGeneratorFunction:1579 1577 return true; 1580 1578 default: -
trunk/Source/JavaScriptCore/dfg/DFGNodeType.h
r194135 r194141 313 313 \ 314 314 macro(NewArrowFunction, NodeResultJS) \ 315 macro(NewGeneratorFunction, NodeResultJS) \316 315 \ 317 316 /* These aren't terminals but always exit */ \ -
trunk/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
r194135 r194141 140 140 // replace any use of those pointers by the corresponding 141 141 // materialization 142 enum class Kind { Escaped, Object, Activation, Function, ArrowFunction, GeneratorFunction };142 enum class Kind { Escaped, Object, Activation, Function, NewArrowFunction }; 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::ArrowFunction || m_kind == Kind::GeneratorFunction; 236 return m_kind == Kind::Function || m_kind == Kind::NewArrowFunction; 237 } 238 239 bool isArrowFunctionAllocation() const 240 { 241 return m_kind == Kind::NewArrowFunction; 237 242 } 238 243 … … 270 275 break; 271 276 272 case Kind::ArrowFunction: 273 out.print("ArrowFunction"); 274 break; 275 276 case Kind::GeneratorFunction: 277 out.print("GeneratorFunction"); 277 case Kind::NewArrowFunction: 278 out.print("NewArrowFunction"); 278 279 break; 279 280 … … 837 838 838 839 case NewFunction: 839 case NewArrowFunction: 840 case NewGeneratorFunction: { 840 case NewArrowFunction: { 841 841 if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid()) { 842 842 m_heap.escape(node->child1().node()); … … 844 844 } 845 845 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); 846 target = &m_heap.newAllocation(node, Allocation::Kind::Function); 852 847 writes.add(FunctionExecutablePLoc, LazyNode(node->cellOperand())); 853 848 writes.add(FunctionActivationPLoc, LazyNode(node->child1().node())); … … 1452 1447 } 1453 1448 1454 case Allocation::Kind::ArrowFunction: 1455 case Allocation::Kind::GeneratorFunction: 1449 case Allocation::Kind::NewArrowFunction: 1456 1450 case Allocation::Kind::Function: { 1457 1451 FrozenValue* executable = allocation.identifier()->cellOperand(); 1458 1452 1459 NodeType nodeType = 1460 allocation.kind() == Allocation::Kind::ArrowFunction ? NewArrowFunction : 1461 allocation.kind() == Allocation::Kind::GeneratorFunction ? NewGeneratorFunction : NewFunction; 1453 NodeType nodeType = allocation.kind() == Allocation::Kind::NewArrowFunction ? NewArrowFunction : NewFunction; 1462 1454 1463 1455 return m_graph.addNode( … … 1791 1783 case NewArrowFunction: 1792 1784 case NewFunction: 1793 case NewGeneratorFunction:1794 1785 node->convertToPhantomNewFunction(); 1795 1786 break; … … 2043 2034 2044 2035 case NewFunction: 2045 case NewArrowFunction: 2046 case NewGeneratorFunction: { 2036 case NewArrowFunction: { 2047 2037 Vector<PromotedHeapLocation> locations = m_locationsForAllocation.get(escapee); 2048 2038 ASSERT(locations.size() == 2); -
trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
r194135 r194141 210 210 case GetCallee: 211 211 case NewArrowFunction: 212 case NewFunction: 213 case NewGeneratorFunction: { 212 case NewFunction: { 214 213 changed |= setPrediction(SpecFunction); 215 214 break; -
trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
r194135 r194141 269 269 case NewArrowFunction: 270 270 case NewFunction: 271 case NewGeneratorFunction:272 271 case Jump: 273 272 case Branch: -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r194135 r194141 51 51 #include "JSCInlines.h" 52 52 #include "JSEnvironmentRecord.h" 53 #include "JSGeneratorFunction.h"54 53 #include "JSLexicalEnvironment.h" 55 54 #include "LinkBuffer.h" … … 5374 5373 { 5375 5374 NodeType nodeType = node->op(); 5376 ASSERT(nodeType == NewFunction || nodeType == NewArrowFunction || nodeType == NewGeneratorFunction);5375 ASSERT(nodeType == NewFunction || nodeType == NewArrowFunction); 5377 5376 5378 5377 SpeculateCellOperand scope(this, node->child1()); … … 5412 5411 callOperation(operationNewArrowFunction, resultGPR, scopeGPR, executable, thisValueTagGPR, thisValuePayloadGPR); 5413 5412 #endif 5414 else if (nodeType == NewGeneratorFunction)5415 callOperation(operationNewGeneratorFunction, resultGPR, scopeGPR, executable);5416 5413 else 5417 5414 callOperation(operationNewFunction, resultGPR, scopeGPR, executable); … … 5421 5418 } 5422 5419 5423 Structure* structure = 5424 nodeType == NewArrowFunction ? m_jit.graph().globalObjectFor(node->origin.semantic)->arrowFunctionStructure() : 5425 nodeType == NewGeneratorFunction ? m_jit.graph().globalObjectFor(node->origin.semantic)->generatorFunctionStructure() : 5426 m_jit.graph().globalObjectFor(node->origin.semantic)->functionStructure(); 5420 Structure* structure = nodeType == NewArrowFunction 5421 ? m_jit.graph().globalObjectFor(node->origin.semantic)->arrowFunctionStructure() 5422 : m_jit.graph().globalObjectFor(node->origin.semantic)->functionStructure(); 5427 5423 5428 5424 GPRTemporary result(this); … … 5440 5436 5441 5437 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable)); 5442 }5443 5444 if (nodeType == NewGeneratorFunction) {5445 compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable, JSGeneratorFunction::offsetOfScopeChain(), JSGeneratorFunction::offsetOfExecutable(), JSGeneratorFunction::offsetOfRareData());5446 5447 addSlowPathGenerator(slowPathCall(slowPath, this, operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable));5448 5438 } 5449 5439 -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
r194135 r194141 4409 4409 case NewFunction: 4410 4410 case NewArrowFunction: 4411 case NewGeneratorFunction:4412 4411 compileNewFunction(node); 4413 4412 break; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
r194135 r194141 4398 4398 case NewFunction: 4399 4399 case NewArrowFunction: 4400 case NewGeneratorFunction:4401 4400 compileNewFunction(node); 4402 4401 break; -
trunk/Source/JavaScriptCore/dfg/DFGStoreBarrierInsertionPhase.cpp
r194135 r194141 307 307 case NewArrowFunction: 308 308 case NewFunction: 309 case NewGeneratorFunction:310 309 // Nodes that allocate get to set their epoch because for those nodes we know 311 310 // that they will be the newest object in the heap. -
trunk/Source/JavaScriptCore/dfg/DFGStructureRegistrationPhase.cpp
r194135 r194141 147 147 registerStructure(m_graph.globalObjectFor(node->origin.semantic)->functionStructure()); 148 148 break; 149 case NewGeneratorFunction:150 registerStructure(m_graph.globalObjectFor(node->origin.semantic)->generatorFunctionStructure());151 break;152 149 153 150 default: -
trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp
r194135 r194141 112 112 case NewArrowFunction: 113 113 case NewFunction: 114 case NewGeneratorFunction:115 114 case GetClosureVar: 116 115 case PutClosureVar: -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
r194135 r194141 53 53 #include "JSArrowFunction.h" 54 54 #include "JSCInlines.h" 55 #include "JSGeneratorFunction.h"56 55 #include "JSLexicalEnvironment.h" 57 56 #include "OperandsInlines.h" … … 756 755 case NewFunction: 757 756 case NewArrowFunction: 758 case NewGeneratorFunction:759 757 compileNewFunction(); 760 758 break; … … 3563 3561 void compileNewFunction() 3564 3562 { 3565 ASSERT(m_node->op() == NewFunction || m_node->op() == NewArrowFunction || m_node->op() == NewGeneratorFunction); 3563 ASSERT(m_node->op() == NewFunction || m_node->op() == NewArrowFunction); 3564 3566 3565 bool isArrowFunction = m_node->op() == NewArrowFunction; 3567 bool isGeneratorFunction = m_node->op() == NewGeneratorFunction;3568 3566 3569 3567 LValue scope = lowCell(m_node->child1()); … … 3572 3570 FunctionExecutable* executable = m_node->castOperand<FunctionExecutable*>(); 3573 3571 if (executable->singletonFunction()->isStillValid()) { 3574 LValue callResult = 3575 isArrowFunction ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue) : 3576 isGeneratorFunction ? vmCall(m_out.int64, m_out.operation(operationNewGeneratorFunction), m_callFrame, scope, weakPointer(executable)) : 3577 vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable)); 3572 LValue callResult = isArrowFunction 3573 ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue) 3574 : vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable)); 3578 3575 setJSValue(callResult); 3579 3576 return; 3580 3577 } 3581 3578 3582 Structure* structure = 3583 isArrowFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->arrowFunctionStructure() : 3584 isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() : 3585 m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure(); 3579 Structure* structure = isArrowFunction 3580 ? m_graph.globalObjectFor(m_node->origin.semantic)->arrowFunctionStructure() 3581 : m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure(); 3586 3582 3587 3583 LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewFunction slow path")); … … 3590 3586 LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath); 3591 3587 3592 LValue fastObject = 3593 isArrowFunction ? allocateObject<JSArrowFunction>(structure, m_out.intPtrZero, slowPath) : 3594 isGeneratorFunction ? allocateObject<JSGeneratorFunction>(structure, m_out.intPtrZero, slowPath) : 3595 allocateObject<JSFunction>(structure, m_out.intPtrZero, slowPath); 3588 LValue fastObject = isArrowFunction 3589 ? allocateObject<JSArrowFunction>(structure, m_out.intPtrZero, slowPath) 3590 : allocateObject<JSFunction>(structure, m_out.intPtrZero, slowPath); 3596 3591 3597 3592 … … 3622 3617 locations[0].directGPR(), locations[1].directGPR(), 3623 3618 CCallHelpers::TrustedImmPtr(executable), locations[2].directGPR()); 3624 }3625 if (isGeneratorFunction) {3626 return createLazyCallGenerator(3627 operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint,3628 locations[0].directGPR(), locations[1].directGPR(),3629 CCallHelpers::TrustedImmPtr(executable));3630 3619 } 3631 3620 return createLazyCallGenerator(
Note: See TracChangeset
for help on using the changeset viewer.