Structure::get should instantiate DeferGC only when materializing property map
[WebKit-https.git] / Source / JavaScriptCore / runtime / Structure.h
index 023d25a8853c6cbc4d53e348b7852add92ba1a0e..f1a2c2e4379a8d68d94a615cd5f29966bb417097 100644 (file)
@@ -434,6 +434,18 @@ private:
         if (!propertyTable() && previousID())
             materializePropertyMap(vm);
     }
+    void materializePropertyMapIfNecessary(VM& vm, PropertyTable*& table)
+    {
+        ASSERT(!isCompilationThread());
+        ASSERT(structure()->classInfo() == info());
+        ASSERT(checkOffsetConsistency());
+        table = propertyTable().get();
+        if (!table && previousID()) {
+            DeferGC deferGC(vm.heap);
+            materializePropertyMap(vm);
+            table = propertyTable().get();
+        }
+    }
     void materializePropertyMapIfNecessaryForPinning(VM& vm, DeferGC&)
     {
         ASSERT(structure()->classInfo() == info());