Concurrent GC should be able to run splay in debug mode and earley/raytrace in releas...
[WebKit-https.git] / Source / JavaScriptCore / runtime / StructureInlines.h
index 1dba9c7..2a01c3a 100644 (file)
@@ -304,11 +304,14 @@ inline PropertyOffset Structure::add(VM& vm, PropertyName propertyName, unsigned
 
     PropertyOffset newOffset = table->nextOffset(m_inlineCapacity);
     
-    table->add(PropertyMapEntry(rep, newOffset, attributes), m_offset, PropertyTable::PropertyOffsetMayChange);
+    PropertyOffset newLastOffset = m_offset;
+    table->add(PropertyMapEntry(rep, newOffset, attributes), newLastOffset, PropertyTable::PropertyOffsetMayChange);
     
-    checkConsistency();
+    func(locker, newOffset, outOfLineCapacity(newLastOffset));
+    vm.heap.mutatorFence();
+    m_offset = newLastOffset;
 
-    func(locker, newOffset);
+    checkConsistency();
     return newOffset;
 }