Title: [194141] trunk
Revision
194141
Author
[email protected]
Date
2015-12-16 04:47:55 -0800 (Wed, 16 Dec 2015)

Log Message

Unreviewed, rolling out r194135.
https://bugs.webkit.org/show_bug.cgi?id=152333

due to missing OSR exit materialization support in FTL
(Requested by yusukesuzuki on #webkit).

Reverted changeset:

"[ES6] Handle new_generator_func / new_generator_func_exp in
DFG / FTL"
https://bugs.webkit.org/show_bug.cgi?id=152227
http://trac.webkit.org/changeset/194135

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (194140 => 194141)


--- trunk/LayoutTests/ChangeLog	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/LayoutTests/ChangeLog	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,3 +1,18 @@
+2015-12-16  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r194135.
+        https://bugs.webkit.org/show_bug.cgi?id=152333
+
+        due to missing OSR exit materialization support in FTL
+        (Requested by yusukesuzuki on #webkit).
+
+        Reverted changeset:
+
+        "[ES6] Handle new_generator_func / new_generator_func_exp in
+        DFG / FTL"
+        https://bugs.webkit.org/show_bug.cgi?id=152227
+        http://trac.webkit.org/changeset/194135
+
 2015-12-16  Youenn Fablet  <[email protected]>
 
         Align WebKit testharness.js with WPT testharness.js

Modified: trunk/LayoutTests/js/regress/script-tests/generator-function-create.js (194140 => 194141)


--- trunk/LayoutTests/js/regress/script-tests/generator-function-create.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/LayoutTests/js/regress/script-tests/generator-function-create.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -7,12 +7,6 @@
     }
     return gen;
 }
-function test()
-{
-    for (var i = 0; i < 500; ++i)
-        createGeneratorFunction();
-}
-noInline(test);
-
+noInline(createGeneratorFunction);
 for (var i = 0; i < 1e4; ++i)
-    test();
+    createGeneratorFunction();

Modified: trunk/Source/_javascript_Core/ChangeLog (194140 => 194141)


--- trunk/Source/_javascript_Core/ChangeLog	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,3 +1,18 @@
+2015-12-16  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r194135.
+        https://bugs.webkit.org/show_bug.cgi?id=152333
+
+        due to missing OSR exit materialization support in FTL
+        (Requested by yusukesuzuki on #webkit).
+
+        Reverted changeset:
+
+        "[ES6] Handle new_generator_func / new_generator_func_exp in
+        DFG / FTL"
+        https://bugs.webkit.org/show_bug.cgi?id=152227
+        http://trac.webkit.org/changeset/194135
+
 2015-12-16  Youenn Fablet  <[email protected]>
 
         [Fetch API] Add fetch API compile time flag

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1760,12 +1760,7 @@
         forNode(node).set(
             m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->arrowFunctionStructure());
         break;
-
-    case NewGeneratorFunction:
-        forNode(node).set(
-            m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->generatorFunctionStructure());
-        break;
-
+            
     case NewFunction:
         forNode(node).set(
             m_graph, m_codeBlock->globalObjectFor(node->origin.semantic)->functionStructure());

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -4557,27 +4557,23 @@
             NEXT_OPCODE(op_put_to_arguments);
         }
             
-        case op_new_func:
-        case op_new_generator_func: {
+        case op_new_func: {
             FunctionExecutable* decl = m_inlineStackTop->m_profiledBlock->functionDecl(currentInstruction[3].u.operand);
             FrozenValue* frozen = m_graph.freezeStrong(decl);
-            NodeType op = (opcodeID == op_new_generator_func) ? NewGeneratorFunction : NewFunction;
-            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(op, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand))));
-            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");
+            set(VirtualRegister(currentInstruction[1].u.operand),
+                addToGraph(NewFunction, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand))));
             NEXT_OPCODE(op_new_func);
         }
 
         case op_new_func_exp:
-        case op_new_generator_func_exp:
         case op_new_arrow_func_exp: {
             FunctionExecutable* expr = m_inlineStackTop->m_profiledBlock->functionExpr(currentInstruction[3].u.operand);
             FrozenValue* frozen = m_graph.freezeStrong(expr);
-            NodeType op = (opcodeID == op_new_generator_func_exp) ? NewGeneratorFunction : NewFunction;
-            set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(op, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand))));
+            set(VirtualRegister(currentInstruction[1].u.operand),
+                addToGraph(NewFunction, OpInfo(frozen), get(VirtualRegister(currentInstruction[2].u.operand))));
             
-            if (opcodeID == op_new_func_exp || opcodeID == op_new_generator_func_exp) {
+            if (opcodeID == op_new_func_exp) {
                 // Curly braces are necessary
-                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");
                 NEXT_OPCODE(op_new_func_exp);
             } else {
                 // Curly braces are necessary

Modified: trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGCapabilities.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -215,8 +215,6 @@
     case op_to_index_string:
     case op_new_func:
     case op_new_func_exp:
-    case op_new_generator_func:
-    case op_new_generator_func_exp:
     case op_new_arrow_func_exp:
     case op_create_lexical_environment:
     case op_get_parent_scope:

Modified: trunk/Source/_javascript_Core/dfg/DFGClobberize.h (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1033,7 +1033,6 @@
     
     case NewArrowFunction:
     case NewFunction:
-    case NewGeneratorFunction:
         if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid())
             write(Watchpoint_fire);
         read(HeapObjectCount);

Modified: trunk/Source/_javascript_Core/dfg/DFGClobbersExitState.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGClobbersExitState.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGClobbersExitState.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -77,7 +77,6 @@
 
     case NewArrowFunction:
     case NewFunction:
-    case NewGeneratorFunction:
         // Like above, but with the JSFunction allocation caveat.
         return node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid();
 

Modified: trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -247,7 +247,6 @@
     case MakeRope:
     case NewArrowFunction:
     case NewFunction:
-    case NewGeneratorFunction:
     case NewTypedArray:
     case ThrowReferenceError:
     case GetPropertyEnumerator:

Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1387,8 +1387,7 @@
 
         case CreateScopedArguments:
         case CreateActivation:
-        case NewFunction:
-        case NewGeneratorFunction: {
+        case NewFunction: {
             fixEdge<CellUse>(node->child1());
             break;
         }

Modified: trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGMayExit.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -143,7 +143,6 @@
     case MaterializeNewObject:
     case NewFunction:
     case NewArrowFunction:
-    case NewGeneratorFunction:
     case NewStringObject:
     case CreateActivation:
         result = ExitsForExceptions;

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2015-12-16 12:47:55 UTC (rev 194141)
@@ -585,7 +585,7 @@
 
     void convertToPhantomNewFunction()
     {
-        ASSERT(m_op == NewFunction || m_op == NewArrowFunction || m_op == NewGeneratorFunction);
+        ASSERT(m_op == NewFunction || m_op == NewArrowFunction);
         m_op = PhantomNewFunction;
         m_flags |= NodeMustGenerate;
         m_opInfo = 0;
@@ -1356,7 +1356,6 @@
         case CheckCell:
         case NewFunction:
         case NewArrowFunction:
-        case NewGeneratorFunction:
         case CreateActivation:
         case MaterializeCreateActivation:
             return true;
@@ -1575,7 +1574,6 @@
         switch (op()) {
         case NewArrowFunction:
         case NewFunction:
-        case NewGeneratorFunction:
             return true;
         default:
             return false;

Modified: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2015-12-16 12:47:55 UTC (rev 194141)
@@ -312,7 +312,6 @@
     macro(NewFunction, NodeResultJS) \
     \
     macro(NewArrowFunction, NodeResultJS) \
-    macro(NewGeneratorFunction, NodeResultJS) \
     \
     /* These aren't terminals but always exit */ \
     macro(Throw, NodeMustGenerate) \

Modified: trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGObjectAllocationSinkingPhase.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -139,7 +139,7 @@
     // once it is escaped if it still has pointers to it in order to
     // replace any use of those pointers by the corresponding
     // materialization
-    enum class Kind { Escaped, Object, Activation, Function, ArrowFunction, GeneratorFunction };
+    enum class Kind { Escaped, Object, Activation, Function, NewArrowFunction };
 
     explicit Allocation(Node* identifier = nullptr, Kind kind = Kind::Escaped)
         : m_identifier(identifier)
@@ -233,8 +233,13 @@
 
     bool isFunctionAllocation() const
     {
-        return m_kind == Kind::Function || m_kind == Kind::ArrowFunction || m_kind == Kind::GeneratorFunction;
+        return m_kind == Kind::Function || m_kind == Kind::NewArrowFunction;
     }
+    
+    bool isArrowFunctionAllocation() const
+    {
+        return m_kind == Kind::NewArrowFunction;
+    }
 
     bool operator==(const Allocation& other) const
     {
@@ -269,14 +274,10 @@
             out.print("Function");
             break;
                 
-        case Kind::ArrowFunction:
-            out.print("ArrowFunction");
+        case Kind::NewArrowFunction:
+            out.print("NewArrowFunction");
             break;
 
-        case Kind::GeneratorFunction:
-            out.print("GeneratorFunction");
-            break;
-
         case Kind::Activation:
             out.print("Activation");
             break;
@@ -836,19 +837,13 @@
             break;
 
         case NewFunction:
-        case NewArrowFunction:
-        case NewGeneratorFunction: {
+        case NewArrowFunction: {
             if (node->castOperand<FunctionExecutable*>()->singletonFunction()->isStillValid()) {
                 m_heap.escape(node->child1().node());
                 break;
             }
             
-            if (node->op() == NewGeneratorFunction)
-                target = &m_heap.newAllocation(node, Allocation::Kind::GeneratorFunction);
-            else if (node->op() == NewArrowFunction)
-                target = &m_heap.newAllocation(node, Allocation::Kind::ArrowFunction);
-            else
-                target = &m_heap.newAllocation(node, Allocation::Kind::Function);
+            target = &m_heap.newAllocation(node, Allocation::Kind::Function);
             writes.add(FunctionExecutablePLoc, LazyNode(node->cellOperand()));
             writes.add(FunctionActivationPLoc, LazyNode(node->child1().node()));
             break;
@@ -1451,14 +1446,11 @@
                 OpInfo(set), OpInfo(data), 0, 0);
         }
 
-        case Allocation::Kind::ArrowFunction:
-        case Allocation::Kind::GeneratorFunction:
+        case Allocation::Kind::NewArrowFunction:
         case Allocation::Kind::Function: {
             FrozenValue* executable = allocation.identifier()->cellOperand();
             
-            NodeType nodeType =
-                allocation.kind() == Allocation::Kind::ArrowFunction ? NewArrowFunction :
-                allocation.kind() == Allocation::Kind::GeneratorFunction ? NewGeneratorFunction : NewFunction;
+            NodeType nodeType = allocation.kind() == Allocation::Kind::NewArrowFunction ? NewArrowFunction : NewFunction;
             
             return m_graph.addNode(
                 allocation.identifier()->prediction(), nodeType,
@@ -1790,7 +1782,6 @@
 
                     case NewArrowFunction:
                     case NewFunction:
-                    case NewGeneratorFunction:
                         node->convertToPhantomNewFunction();
                         break;
 
@@ -2042,8 +2033,7 @@
         }
         
         case NewFunction:
-        case NewArrowFunction:
-        case NewGeneratorFunction: {
+        case NewArrowFunction: {
             Vector<PromotedHeapLocation> locations = m_locationsForAllocation.get(escapee);
             ASSERT(locations.size() == 2);
                 

Modified: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -209,8 +209,7 @@
         case GetSetter:
         case GetCallee:
         case NewArrowFunction:
-        case NewFunction:
-        case NewGeneratorFunction: {
+        case NewFunction: {
             changed |= setPrediction(SpecFunction);
             break;
         }

Modified: trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2015-12-16 12:47:55 UTC (rev 194141)
@@ -268,7 +268,6 @@
     case PutToArguments:
     case NewArrowFunction:
     case NewFunction:
-    case NewGeneratorFunction:
     case Jump:
     case Branch:
     case Switch:

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -50,7 +50,6 @@
 #include "JSArrowFunction.h"
 #include "JSCInlines.h"
 #include "JSEnvironmentRecord.h"
-#include "JSGeneratorFunction.h"
 #include "JSLexicalEnvironment.h"
 #include "LinkBuffer.h"
 #include "ScopedArguments.h"
@@ -5373,7 +5372,7 @@
 void SpeculativeJIT::compileNewFunction(Node* node)
 {
     NodeType nodeType = node->op();
-    ASSERT(nodeType == NewFunction || nodeType == NewArrowFunction || nodeType == NewGeneratorFunction);
+    ASSERT(nodeType == NewFunction || nodeType == NewArrowFunction);
     
     SpeculateCellOperand scope(this, node->child1());
 #if USE(JSVALUE64)
@@ -5411,8 +5410,6 @@
 #else
             callOperation(operationNewArrowFunction, resultGPR, scopeGPR, executable, thisValueTagGPR, thisValuePayloadGPR);
 #endif
-        else if (nodeType == NewGeneratorFunction)
-            callOperation(operationNewGeneratorFunction, resultGPR, scopeGPR, executable);
         else
             callOperation(operationNewFunction, resultGPR, scopeGPR, executable);
         m_jit.exceptionCheck();
@@ -5420,10 +5417,9 @@
         return;
     }
 
-    Structure* structure =
-        nodeType == NewArrowFunction ? m_jit.graph().globalObjectFor(node->origin.semantic)->arrowFunctionStructure() :
-        nodeType == NewGeneratorFunction ? m_jit.graph().globalObjectFor(node->origin.semantic)->generatorFunctionStructure() :
-        m_jit.graph().globalObjectFor(node->origin.semantic)->functionStructure();
+    Structure* structure = nodeType == NewArrowFunction
+        ? m_jit.graph().globalObjectFor(node->origin.semantic)->arrowFunctionStructure()
+        : m_jit.graph().globalObjectFor(node->origin.semantic)->functionStructure();
     
     GPRTemporary result(this);
     GPRTemporary scratch1(this);
@@ -5440,12 +5436,6 @@
             
         addSlowPathGenerator(slowPathCall(slowPath, this, operationNewFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable));
     }
-
-    if (nodeType == NewGeneratorFunction) {
-        compileNewFunctionCommon<JSGeneratorFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSGeneratorFunction::allocationSize(0), executable, JSGeneratorFunction::offsetOfScopeChain(), JSGeneratorFunction::offsetOfExecutable(), JSGeneratorFunction::offsetOfRareData());
-
-        addSlowPathGenerator(slowPathCall(slowPath, this, operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint, resultGPR, scopeGPR, executable));
-    }
     
     if (nodeType == NewArrowFunction) {
         compileNewFunctionCommon<JSArrowFunction>(resultGPR, structure, scratch1GPR, scratch2GPR, scopeGPR, slowPath, JSArrowFunction::allocationSize(0), executable, JSArrowFunction::offsetOfScopeChain(), JSArrowFunction::offsetOfExecutable(), JSArrowFunction::offsetOfRareData());

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -4408,7 +4408,6 @@
 
     case NewFunction:
     case NewArrowFunction:
-    case NewGeneratorFunction:
         compileNewFunction(node);
         break;
 

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -4397,7 +4397,6 @@
 
     case NewFunction:
     case NewArrowFunction:
-    case NewGeneratorFunction:
         compileNewFunction(node);
         break;
 

Modified: trunk/Source/_javascript_Core/dfg/DFGStoreBarrierInsertionPhase.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGStoreBarrierInsertionPhase.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGStoreBarrierInsertionPhase.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -306,7 +306,6 @@
             case CreateClonedArguments:
             case NewArrowFunction:
             case NewFunction:
-            case NewGeneratorFunction:
                 // Nodes that allocate get to set their epoch because for those nodes we know
                 // that they will be the newest object in the heap.
                 m_node->setEpoch(m_currentEpoch);

Modified: trunk/Source/_javascript_Core/dfg/DFGStructureRegistrationPhase.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/dfg/DFGStructureRegistrationPhase.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/dfg/DFGStructureRegistrationPhase.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -146,9 +146,6 @@
                 case NewFunction:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->functionStructure());
                     break;
-                case NewGeneratorFunction:
-                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->generatorFunctionStructure());
-                    break;
                     
                 default:
                     break;

Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -111,7 +111,6 @@
     case CreateActivation:
     case NewArrowFunction:
     case NewFunction:
-    case NewGeneratorFunction:
     case GetClosureVar:
     case PutClosureVar:
     case CreateDirectArguments:

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (194140 => 194141)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2015-12-16 12:47:55 UTC (rev 194141)
@@ -52,7 +52,6 @@
 #include "FTLWeightedTarget.h"
 #include "JSArrowFunction.h"
 #include "JSCInlines.h"
-#include "JSGeneratorFunction.h"
 #include "JSLexicalEnvironment.h"
 #include "OperandsInlines.h"
 #include "ScopedArguments.h"
@@ -755,7 +754,6 @@
             break;
         case NewFunction:
         case NewArrowFunction:
-        case NewGeneratorFunction:
             compileNewFunction();
             break;
         case CreateDirectArguments:
@@ -3562,37 +3560,34 @@
     
     void compileNewFunction()
     {
-        ASSERT(m_node->op() == NewFunction || m_node->op() == NewArrowFunction || m_node->op() == NewGeneratorFunction);
+        ASSERT(m_node->op() == NewFunction || m_node->op() == NewArrowFunction);
+        
         bool isArrowFunction = m_node->op() == NewArrowFunction;
-        bool isGeneratorFunction = m_node->op() == NewGeneratorFunction;
         
         LValue scope = lowCell(m_node->child1());
         LValue thisValue = isArrowFunction ? lowCell(m_node->child2()) : nullptr;
         
         FunctionExecutable* executable = m_node->castOperand<FunctionExecutable*>();
         if (executable->singletonFunction()->isStillValid()) {
-            LValue callResult =
-                isArrowFunction ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue) :
-                isGeneratorFunction ? vmCall(m_out.int64, m_out.operation(operationNewGeneratorFunction), m_callFrame, scope, weakPointer(executable)) :
-                vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable));
+            LValue callResult = isArrowFunction
+                ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue)
+                : vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable));
             setJSValue(callResult);
             return;
         }
         
-        Structure* structure =
-            isArrowFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->arrowFunctionStructure() :
-            isGeneratorFunction ? m_graph.globalObjectFor(m_node->origin.semantic)->generatorFunctionStructure() :
-            m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
+        Structure* structure = isArrowFunction
+            ? m_graph.globalObjectFor(m_node->origin.semantic)->arrowFunctionStructure()
+            : m_graph.globalObjectFor(m_node->origin.semantic)->functionStructure();
         
         LBasicBlock slowPath = FTL_NEW_BLOCK(m_out, ("NewFunction slow path"));
         LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("NewFunction continuation"));
         
         LBasicBlock lastNext = m_out.insertNewBlocksBefore(slowPath);
         
-        LValue fastObject =
-            isArrowFunction ? allocateObject<JSArrowFunction>(structure, m_out.intPtrZero, slowPath) :
-            isGeneratorFunction ? allocateObject<JSGeneratorFunction>(structure, m_out.intPtrZero, slowPath) :
-            allocateObject<JSFunction>(structure, m_out.intPtrZero, slowPath);
+        LValue fastObject = isArrowFunction
+            ? allocateObject<JSArrowFunction>(structure, m_out.intPtrZero, slowPath)
+            : allocateObject<JSFunction>(structure, m_out.intPtrZero, slowPath);
         
         
         // We don't need memory barriers since we just fast-created the function, so it
@@ -3622,12 +3617,6 @@
                         locations[0].directGPR(), locations[1].directGPR(),
                         CCallHelpers::TrustedImmPtr(executable), locations[2].directGPR());
                 }
-                if (isGeneratorFunction) {
-                    return createLazyCallGenerator(
-                        operationNewGeneratorFunctionWithInvalidatedReallocationWatchpoint,
-                        locations[0].directGPR(), locations[1].directGPR(),
-                        CCallHelpers::TrustedImmPtr(executable));
-                }
                 return createLazyCallGenerator(
                     operationNewFunctionWithInvalidatedReallocationWatchpoint,
                     locations[0].directGPR(), locations[1].directGPR(),

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-create-optimized.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-create-optimized.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-create-optimized.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,33 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-
-
-function *g() { }
-var GeneratorFunctionPrototype = g.__proto__;
-
-function test()
-{
-    return function *gen()
-    {
-        yield 42;
-    };
-}
-noInline(test);
-
-function test2()
-{
-    function *gen()
-    {
-        yield 42;
-    }
-
-    return gen;
-}
-noInline(test2);
-
-for (var i = 0; i < 1e4; ++i) {
-    shouldBe(test().__proto__, GeneratorFunctionPrototype);
-    shouldBe(test2().__proto__, GeneratorFunctionPrototype);
-}

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-no-double-allocate.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-no-double-allocate.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-no-double-allocate.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,36 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function call(o) { o.x = 3; }
-noInline(call);
-
-function sink (p, q) {
-    function *f() { };
-    if (p) {
-        call(f); // Force allocation of f
-        if (q) {
-            OSRExit();
-        }
-        return f;
-    }
-    return { 'x': 2 };
-}
-noInline(sink);
-
-for (var i = 0; i < 100000; ++i) {
-    var o = sink(true, false);
-    shouldBe(o.__proto__, GeneratorFunctionPrototype);
-    if (o.x != 3)
-        throw "Error: expected o.x to be 2 but is " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Check that the function is properly allocated on OSR exit
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-if (f.x != 3)
-    throw "Error: expected o.x to be 3 but is " + result;

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-osrexit.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-osrexit.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-osrexit.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,30 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function sink (p, q) {
-    function *g(x) { return x; };
-    if (p) { if (q) OSRExit(); return g; }
-    function *f(x) { return x; };
-    return f;
-}
-noInline(sink);
-
-for (var i = 0; i < 10000; ++i) {
-    var f = sink(true, false);
-    shouldBe(f.__proto__, GeneratorFunctionPrototype);
-    var result = f(42);
-    if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Check that the function is properly allocated on OSR exit
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f(42);
-if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-put.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-put.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-declaration-sinking-put.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,38 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function sink (p, q) {
-    function *g(x) { return x; };
-    if (p) { if (q) g.inner = 42; return g; }
-    function *f(x) { return x; };
-    return f;
-}
-noInline(sink);
-
-for (var i = 0; i < 10000; ++i) {
-    var f = sink(true, true);
-    shouldBe(f.__proto__, GeneratorFunctionPrototype);
-    var result = f(42);
-    if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Test the allocation on the implicit inner else branch
-var f = sink(true, false);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f(12);
-if (result.next().value != 12)
-    // This shouldn't matter as it should be either correct or completely crash
-    throw "Error: expected 12 but got " + result;
-
-// Check that the allocation did not sink beyond the property assignment
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f.inner;
-if (result != 42)
-    throw "Error: inner should be 42 but is " + result;

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-no-double-allocate.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-no-double-allocate.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-no-double-allocate.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,36 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function call(o) { o.x = 3; }
-noInline(call);
-
-function sink (p, q) {
-    var f = function *() { };
-    if (p) {
-        call(f); // Force allocation of f
-        if (q) {
-            OSRExit();
-        }
-        return f;
-    }
-    return { 'x': 2 };
-}
-noInline(sink);
-
-for (var i = 0; i < 100000; ++i) {
-    var o = sink(true, false);
-    shouldBe(o.__proto__, GeneratorFunctionPrototype);
-    if (o.x != 3)
-        throw "Error: expected o.x to be 2 but is " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Check that the function is properly allocated on OSR exit
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-if (f.x != 3)
-    throw "Error: expected o.x to be 3 but is " + result;

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-osrexit.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-osrexit.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-osrexit.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,29 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function sink (p, q) {
-    var g = function *(x) { return x; };
-    if (p) { if (q) OSRExit(); return g; }
-    return function *(x) { return x; };
-}
-noInline(sink);
-
-for (var i = 0; i < 10000; ++i) {
-    var f = sink(true, false);
-    shouldBe(f.__proto__, GeneratorFunctionPrototype);
-    var result = f(42);
-    if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Check that the function is properly allocated on OSR exit
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f(42);
-if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;

Deleted: trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-put.js (194140 => 194141)


--- trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-put.js	2015-12-16 11:13:07 UTC (rev 194140)
+++ trunk/Source/_javascript_Core/tests/stress/generator-function-_expression_-sinking-put.js	2015-12-16 12:47:55 UTC (rev 194141)
@@ -1,37 +0,0 @@
-function shouldBe(actual, expected) {
-    if (actual !== expected)
-        throw new Error('bad value: ' + actual);
-}
-var GeneratorFunctionPrototype = (function*(){}).__proto__;
-
-function sink (p, q) {
-    var g = function *(x) { return x; };
-    if (p) { if (q) g.inner = 42; return g; }
-    return function *(x) { return x; };
-}
-noInline(sink);
-
-for (var i = 0; i < 10000; ++i) {
-    var f = sink(true, true);
-    shouldBe(f.__proto__, GeneratorFunctionPrototype);
-    var result = f(42);
-    if (result.next().value != 42)
-    throw "Error: expected 42 but got " + result;
-}
-
-// At this point, the function should be compiled down to the FTL
-
-// Test the allocation on the implicit inner else branch
-var f = sink(true, false);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f(12);
-if (result.next().value != 12)
-    // This shouldn't matter as it should be either correct or completely crash
-    throw "Error: expected 12 but got " + result;
-
-// Check that the allocation did not sink beyond the property assignment
-var f = sink(true, true);
-shouldBe(f.__proto__, GeneratorFunctionPrototype);
-var result = f.inner;
-if (result != 42)
-    throw "Error: inner should be 42 but is " + result;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to