[JSC] Handle new_async_func / new_async_func_exp in DFG / FTL
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGStructureRegistrationPhase.cpp
index 51cf489..0b0be44 100644 (file)
@@ -118,6 +118,30 @@ public:
                     registerStructure(globalObject->originalArrayStructureForIndexingType(ArrayWithSlowPutArrayStorage));
                     break;
                 }
+
+                case NewArrayWithSpread: {
+                    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
+                    if (m_graph.isWatchingHavingABadTimeWatchpoint(node)) {
+                        // We've compiled assuming we're not having a bad time, so to be consistent
+                        // with AI we must say we produce an original array allocation structure.
+                        registerStructure(globalObject->originalArrayStructureForIndexingType(ArrayWithContiguous));
+                    } else
+                        registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithContiguous));
+                    break;
+                }
+
+                case Spread: {
+                    registerStructure(m_graph.m_vm.fixedArrayStructure.get());
+                    break;
+                }
+
+                case CreateRest: {
+                    if (m_graph.isWatchingHavingABadTimeWatchpoint(node)) {
+                        JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
+                        registerStructure(globalObject->restParameterStructure());
+                    }
+                    break;
+                }
                     
                 case NewTypedArray:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->typedArrayStructureConcurrently(node->typedArrayType()));
@@ -153,6 +177,9 @@ public:
                 case NewGeneratorFunction:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->generatorFunctionStructure());
                     break;
+                case NewAsyncFunction:
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->asyncFunctionStructure());
+                    break;
 
                 default:
                     break;