Unreviewed, rolling out r94445 and r94448.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2011 10:43:34 +0000 (10:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Sep 2011 10:43:34 +0000 (10:43 +0000)
http://trac.webkit.org/changeset/94445
http://trac.webkit.org/changeset/94448
https://bugs.webkit.org/show_bug.cgi?id=67595

It broke everything (Requested by ossy on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-09-05

* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* heap/Heap.cpp:
(JSC::Heap::collect):
* heap/Heap.h:
* heap/NewSpace.cpp:
(JSC::NewSpace::NewSpace):
* heap/NewSpace.h:
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/JSObject.cpp:
(JSC::JSObject::allocatePropertyStorage):
* runtime/JSObject.h:
(JSC::JSObject::~JSObject):
(JSC::JSObject::putDirectInternal):
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectFunctionWithoutTransition):
(JSC::JSObject::transitionTo):
(JSC::JSObject::visitChildrenDirect):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94522 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.exp
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/NewSpace.cpp
Source/JavaScriptCore/heap/NewSpace.h
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObject.h

index 94518d9..34310c4 100644 (file)
@@ -1,3 +1,32 @@
+2011-09-05  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r94445 and r94448.
+        http://trac.webkit.org/changeset/94445
+        http://trac.webkit.org/changeset/94448
+        https://bugs.webkit.org/show_bug.cgi?id=67595
+
+        It broke everything (Requested by ossy on #webkit).
+
+        * JavaScriptCore.exp:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+        * heap/Heap.cpp:
+        (JSC::Heap::collect):
+        * heap/Heap.h:
+        * heap/NewSpace.cpp:
+        (JSC::NewSpace::NewSpace):
+        * heap/NewSpace.h:
+        * jit/JITStubs.cpp:
+        (JSC::DEFINE_STUB_FUNCTION):
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::allocatePropertyStorage):
+        * runtime/JSObject.h:
+        (JSC::JSObject::~JSObject):
+        (JSC::JSObject::putDirectInternal):
+        (JSC::JSObject::putDirectWithoutTransition):
+        (JSC::JSObject::putDirectFunctionWithoutTransition):
+        (JSC::JSObject::transitionTo):
+        (JSC::JSObject::visitChildrenDirect):
+
 2011-09-05  Patrick Gansterer  <paroga@webkit.org>
 
         Unreviewed build fix for r94452.
index 6e489bb..9f98de5 100644 (file)
@@ -215,7 +215,6 @@ __ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE
 __ZN3JSC22globalMemoryStatisticsEv
 __ZN3JSC22objectConstructorTableE
 __ZN3JSC23AbstractSamplingCounter4dumpEv
-__ZN3JSC23AbstractSamplingCounter30s_abstractSamplingCounterChainE
 __ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
 __ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
 __ZN3JSC24DynamicGlobalObjectScopeC1ERNS_12JSGlobalDataEPNS_14JSGlobalObjectE
@@ -323,7 +322,7 @@ __ZN3JSC8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE
 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE
 __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_16WriteBarrierBaseINS_7UnknownEEE
-__ZN3JSC8JSObject23allocatePropertyStorageERNS_12JSGlobalDataEmm
+__ZN3JSC8JSObject23allocatePropertyStorageEmm
 __ZN3JSC8JSObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE
 __ZN3JSC8JSObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
 __ZN3JSC8JSObject3putEPNS_9ExecStateEjNS_7JSValueE
index 080af99..f20d7ad 100644 (file)
@@ -59,7 +59,7 @@ EXPORTS
     ?addSlowCase@Identifier@JSC@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@WTF@@PAVExecState@2@PAVStringImpl@4@@Z
     ?addStaticGlobals@JSGlobalObject@JSC@@IAEXPAUGlobalPropertyInfo@12@H@Z
     ?allocate@Heap@JSC@@QAEPAXAAUSizeClass@NewSpace@2@@Z
-    ?allocatePropertyStorage@JSObject@JSC@@QAEXAAVJSGlobalData@2@II@Z
+    ?allocatePropertyStorage@JSObject@JSC@@QAEXII@Z
     ?allocateSlowCase@Heap@JSC@@AAEPAXAAUSizeClass@NewSpace@2@@Z
     ?append@StringBuilder@WTF@@QAEXPBDI@Z
     ?append@StringBuilder@WTF@@QAEXPB_WI@Z
index f56cc0a..1990bf5 100644 (file)
@@ -690,7 +690,7 @@ void Heap::collect(SweepToggle sweepToggle)
     // new bytes allocated) proportion, and seems to work well in benchmarks.
     size_t proportionalBytes = 2 * size();
     m_newSpace.setHighWaterMark(max(proportionalBytes, m_minBytesPerCycle));
-    m_newSpace.resetPropertyStorageNursery();
+
     JAVASCRIPTCORE_GC_END();
 
     (*m_activityCallback)();
index 961c184..c87b2f3 100644 (file)
@@ -91,9 +91,6 @@ namespace JSC {
         void notifyIsSafeToCollect() { m_isSafeToCollect = true; }
         void collectAllGarbage();
 
-        inline void* allocatePropertyStorage(size_t);
-        inline bool inPropertyStorageNursery(void*);
-
         void reportExtraMemoryCost(size_t cost);
 
         void protect(JSValue);
@@ -362,22 +359,6 @@ namespace JSC {
         return allocate(sizeClass);
     }
 
-    inline void* Heap::allocatePropertyStorage(size_t bytes)
-    {
-        ASSERT(!(bytes % sizeof(JSValue)));
-        if (bytes >= NewSpace::PropertyStorageNurserySize)
-            return fastMalloc(bytes);
-        if (void* result = m_newSpace.allocatePropertyStorage(bytes))
-            return result;
-        collect(DoNotSweep);
-        return m_newSpace.allocatePropertyStorage(bytes);
-    }
-    
-    inline bool Heap::inPropertyStorageNursery(void* ptr)
-    {
-        return m_newSpace.inPropertyStorageNursery(ptr);
-    }
-
 } // namespace JSC
 
 #endif // Heap_h
index 866082d..2f16f99 100644 (file)
@@ -32,9 +32,7 @@ namespace JSC {
 class Structure;
 
 NewSpace::NewSpace(Heap* heap)
-    : m_propertyStorageNursery(static_cast<char*>(fastMalloc(PropertyStorageNurserySize)))
-    , m_propertyStorageAllocationPoint(m_propertyStorageNursery)
-    , m_waterMark(0)
+    : m_waterMark(0)
     , m_highWaterMark(0)
     , m_heap(heap)
 {
index cf7ff31..b0e9431 100644 (file)
@@ -46,7 +46,6 @@ namespace JSC {
         WTF_MAKE_NONCOPYABLE(NewSpace);
     public:
         static const size_t maxCellSize = 1024;
-        static const size_t PropertyStorageNurserySize = 1024 * 1024 * 4;
 
         struct SizeClass {
             SizeClass();
@@ -64,10 +63,6 @@ namespace JSC {
 
         SizeClass& sizeClassFor(size_t);
         void* allocate(SizeClass&);
-        inline void* allocatePropertyStorage(size_t);
-        inline bool inPropertyStorageNursery(void* ptr);
-        inline void resetPropertyStorageNursery();
-        
         void resetAllocator();
 
         void addBlock(SizeClass&, MarkedBlock*);
@@ -96,8 +91,6 @@ namespace JSC {
 
         SizeClass m_preciseSizeClasses[preciseCount];
         SizeClass m_impreciseSizeClasses[impreciseCount];
-        char* m_propertyStorageNursery;
-        char* m_propertyStorageAllocationPoint;
         size_t m_waterMark;
         size_t m_highWaterMark;
         Heap* m_heap;
@@ -167,30 +160,6 @@ namespace JSC {
         return firstFreeCell;
     }
 
-    inline void NewSpace::resetPropertyStorageNursery()
-    {
-        m_propertyStorageAllocationPoint = m_propertyStorageNursery;
-    }
-    
-    inline void* NewSpace::allocatePropertyStorage(size_t size)
-    {
-        char* result = m_propertyStorageAllocationPoint;
-        if (size > PropertyStorageNurserySize)
-            CRASH();
-        m_propertyStorageAllocationPoint += size;
-        if (static_cast<size_t>(m_propertyStorageAllocationPoint - m_propertyStorageNursery) > PropertyStorageNurserySize) {
-            m_propertyStorageAllocationPoint = result;
-            return 0;
-        }
-        return result;
-    }
-
-    inline bool NewSpace::inPropertyStorageNursery(void* ptr)
-    {
-        char* addr = static_cast<char*>(ptr);
-        return static_cast<size_t>(addr - m_propertyStorageNursery) < PropertyStorageNurserySize;
-    }
-    
     template <typename Functor> inline typename Functor::ReturnType NewSpace::forEachBlock(Functor& functor)
     {
         for (size_t i = 0; i < preciseCount; ++i) {
index 9b55ecd..16e6987 100644 (file)
@@ -1481,7 +1481,7 @@ DEFINE_STUB_FUNCTION(JSObject*, op_put_by_id_transition_realloc)
 
     ASSERT(baseValue.isObject());
     JSObject* base = asObject(baseValue);
-    base->allocatePropertyStorage(*stackFrame.globalData, oldSize, newSize);
+    base->allocatePropertyStorage(oldSize, newSize);
 
     return base;
 }
index aaaacae..a0913a4 100644 (file)
@@ -594,20 +594,21 @@ Structure* JSObject::createInheritorID(JSGlobalData& globalData)
     return m_inheritorID.get();
 }
 
-void JSObject::allocatePropertyStorage(JSGlobalData& globalData, size_t oldSize, size_t newSize)
+void JSObject::allocatePropertyStorage(size_t oldSize, size_t newSize)
 {
     ASSERT(newSize > oldSize);
 
     // It's important that this function not rely on m_structure, since
     // we might be in the middle of a transition.
+    bool wasInline = (oldSize < JSObject::baseExternalStorageCapacity);
+
     PropertyStorage oldPropertyStorage = m_propertyStorage;
-    PropertyStorage newPropertyStorage = static_cast<PropertyStorage>(globalData.heap.allocatePropertyStorage(newSize * sizeof(WriteBarrierBase<Unknown>)));
-    ASSERT(newPropertyStorage);
+    PropertyStorage newPropertyStorage = new WriteBarrierBase<Unknown>[newSize];
 
     for (unsigned i = 0; i < oldSize; ++i)
        newPropertyStorage[i] = oldPropertyStorage[i];
 
-    if (!isUsingInlineStorage() && !globalData.heap.inPropertyStorageNursery(oldPropertyStorage))
+    if (!wasInline)
         delete [] oldPropertyStorage;
 
     m_propertyStorage = newPropertyStorage;
index 8fa58d9..14d1203 100644 (file)
@@ -221,7 +221,7 @@ namespace JSC {
 
         virtual ComplType exceptionType() const { return Throw; }
 
-        void allocatePropertyStorage(JSGlobalData&, size_t oldSize, size_t newSize);
+        void allocatePropertyStorage(size_t oldSize, size_t newSize);
         bool isUsingInlineStorage() const { return static_cast<const void*>(m_propertyStorage) == static_cast<const void*>(this + 1); }
 
         void* addressOfPropertyAtOffset(size_t offset)
@@ -463,7 +463,7 @@ inline JSObject::JSObject(JSGlobalData& globalData, Structure* structure, Proper
 
 inline JSObject::~JSObject()
 {
-    if (!isUsingInlineStorage() && !Heap::heap(this)->inPropertyStorageNursery(m_propertyStorage))
+    if (!isUsingInlineStorage())
         delete [] m_propertyStorage;
 }
 
@@ -657,7 +657,7 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
         size_t currentCapacity = m_structure->propertyStorageCapacity();
         offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, specificFunction);
         if (currentCapacity != m_structure->propertyStorageCapacity())
-            allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
+            allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
 
         ASSERT(offset < m_structure->propertyStorageCapacity());
         putDirectOffset(globalData, offset, value);
@@ -671,7 +671,7 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
     size_t currentCapacity = m_structure->propertyStorageCapacity();
     if (Structure* structure = Structure::addPropertyTransitionToExistingStructure(m_structure.get(), propertyName, attributes, specificFunction, offset)) {    
         if (currentCapacity != structure->propertyStorageCapacity())
-            allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
+            allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity());
 
         ASSERT(offset < structure->propertyStorageCapacity());
         setStructure(globalData, structure);
@@ -721,7 +721,7 @@ inline bool JSObject::putDirectInternal(JSGlobalData& globalData, const Identifi
     Structure* structure = Structure::addPropertyTransition(globalData, m_structure.get(), propertyName, attributes, specificFunction, offset);
 
     if (currentCapacity != structure->propertyStorageCapacity())
-        allocatePropertyStorage(globalData, currentCapacity, structure->propertyStorageCapacity());
+        allocatePropertyStorage(currentCapacity, structure->propertyStorageCapacity());
 
     ASSERT(offset < structure->propertyStorageCapacity());
     setStructure(globalData, structure);
@@ -782,7 +782,7 @@ inline void JSObject::putDirectWithoutTransition(JSGlobalData& globalData, const
     size_t currentCapacity = m_structure->propertyStorageCapacity();
     size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, 0);
     if (currentCapacity != m_structure->propertyStorageCapacity())
-        allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
+        allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
     putDirectOffset(globalData, offset, value);
 }
 
@@ -791,14 +791,14 @@ inline void JSObject::putDirectFunctionWithoutTransition(JSGlobalData& globalDat
     size_t currentCapacity = m_structure->propertyStorageCapacity();
     size_t offset = m_structure->addPropertyWithoutTransition(globalData, propertyName, attributes, value);
     if (currentCapacity != m_structure->propertyStorageCapacity())
-        allocatePropertyStorage(globalData, currentCapacity, m_structure->propertyStorageCapacity());
+        allocatePropertyStorage(currentCapacity, m_structure->propertyStorageCapacity());
     putDirectOffset(globalData, offset, value);
 }
 
 inline void JSObject::transitionTo(JSGlobalData& globalData, Structure* newStructure)
 {
     if (m_structure->propertyStorageCapacity() != newStructure->propertyStorageCapacity())
-        allocatePropertyStorage(globalData, m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
+        allocatePropertyStorage(m_structure->propertyStorageCapacity(), newStructure->propertyStorageCapacity());
     setStructure(globalData, newStructure);
 }
 
@@ -889,10 +889,6 @@ ALWAYS_INLINE void JSObject::visitChildrenDirect(SlotVisitor& visitor)
     JSCell::visitChildren(visitor);
 
     PropertyStorage storage = propertyStorage();
-    if (Heap::heap(this)->inPropertyStorageNursery(storage)) {
-        m_propertyStorage = new WriteBarrierBase<Unknown>[structure()->propertyStorageCapacity()];
-        memcpy(m_propertyStorage, storage, m_structure->propertyStorageSize() * sizeof(WriteBarrierBase<Unknown>));
-    }
     size_t storageSize = m_structure->propertyStorageSize();
     visitor.appendValues(storage, storageSize);
     if (m_inheritorID)