[JSC] Handle new_async_func / new_async_func_exp in DFG / FTL
[WebKit-https.git] / Source / JavaScriptCore / dfg / DFGStructureRegistrationPhase.cpp
index e39372b..0b0be44 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -62,7 +62,6 @@ public:
         registerStructure(m_graph.m_vm.structureStructure.get());
         registerStructure(m_graph.m_vm.stringStructure.get());
         registerStructure(m_graph.m_vm.symbolStructure.get());
-        registerStructure(m_graph.m_vm.getterSetterStructure.get());
         
         for (FrozenValue* value : m_graph.m_frozenValues)
             assertIsRegistered(value->structure());
@@ -92,7 +91,11 @@ public:
                     registerStructure(node->transition()->previous);
                     registerStructure(node->transition()->next);
                     break;
-                    
+
+                case GetGetterSetterByOffset:
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->getterSetterStructure());
+                    break;
+
                 case MultiGetByOffset:
                     for (const MultiGetByOffsetCase& getCase : node->multiGetByOffsetData().cases)
                         registerStructures(getCase.set());
@@ -115,9 +118,33 @@ 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)->typedArrayStructure(node->typedArrayType()));
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->typedArrayStructureConcurrently(node->typedArrayType()));
                     break;
                     
                 case ToString:
@@ -136,17 +163,24 @@ public:
                 case CreateScopedArguments:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->scopedArgumentsStructure());
                     break;
-                    
+
+                case CreateClonedArguments:
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->clonedArgumentsStructure());
+                    break;
+
                 case NewRegexp:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->regExpStructure());
                     break;
-                case NewArrowFunction:
-                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->arrowFunctionStructure());
-                    break;
                 case NewFunction:
                     registerStructure(m_graph.globalObjectFor(node->origin.semantic)->functionStructure());
                     break;
-                    
+                case NewGeneratorFunction:
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->generatorFunctionStructure());
+                    break;
+                case NewAsyncFunction:
+                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->asyncFunctionStructure());
+                    break;
+
                 default:
                     break;
                 }
@@ -184,7 +218,6 @@ private:
 
 bool performStructureRegistration(Graph& graph)
 {
-    SamplingRegion samplingRegion("DFG Structure Registration Phase");
     return runPhase<StructureRegistrationPhase>(graph);
 }