Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (95438 => 95439)
--- trunk/Source/_javascript_Core/ChangeLog 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-09-19 17:41:51 UTC (rev 95439)
@@ -1,3 +1,30 @@
+2011-09-19 Oliver Hunt <[email protected]>
+
+ Remove bump allocator
+ https://bugs.webkit.org/show_bug.cgi?id=68370
+
+ Reviewed by Sam Weinig.
+
+ Can't do anything with this allocator currently, and it's
+ increasing the complexity of the GC code. Slight progression
+ on SunSpider, slight regression (undoing the original progression)
+ in V8.
+
+ * heap/Heap.cpp:
+ (JSC::Heap::collect):
+ * heap/Heap.h:
+ * heap/NewSpace.cpp:
+ (JSC::NewSpace::NewSpace):
+ * heap/NewSpace.h:
+ (JSC::NewSpace::allocate):
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::allocatePropertyStorage):
+ * runtime/JSObject.h:
+ (JSC::JSObject::~JSObject):
+ (JSC::JSObject::visitChildrenDirect):
+ * runtime/StorageBarrier.h:
+ (JSC::StorageBarrier::set):
+
2011-09-19 Carlos Garcia Campos <[email protected]>
[GTK] Fix distcheck build
Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (95438 => 95439)
--- trunk/Source/_javascript_Core/heap/Heap.cpp 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/heap/Heap.cpp 2011-09-19 17:41:51 UTC (rev 95439)
@@ -692,7 +692,6 @@
// 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();
_javascript_CORE_GC_END();
(*m_activityCallback)();
Modified: trunk/Source/_javascript_Core/heap/Heap.h (95438 => 95439)
--- trunk/Source/_javascript_Core/heap/Heap.h 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/heap/Heap.h 2011-09-19 17:41:51 UTC (rev 95439)
@@ -91,9 +91,6 @@
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 @@
return allocate(sizeClass);
}
- inline void* Heap::allocatePropertyStorage(size_t bytes)
- {
- ASSERT(!(bytes % sizeof(JSValue)));
- if (bytes >= NewSpace::PropertyStorageNurserySize)
- return 0;
- 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
Modified: trunk/Source/_javascript_Core/heap/NewSpace.cpp (95438 => 95439)
--- trunk/Source/_javascript_Core/heap/NewSpace.cpp 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/heap/NewSpace.cpp 2011-09-19 17:41:51 UTC (rev 95439)
@@ -32,9 +32,7 @@
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)
{
Modified: trunk/Source/_javascript_Core/heap/NewSpace.h (95438 => 95439)
--- trunk/Source/_javascript_Core/heap/NewSpace.h 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/heap/NewSpace.h 2011-09-19 17:41:51 UTC (rev 95439)
@@ -46,7 +46,6 @@
WTF_MAKE_NONCOPYABLE(NewSpace);
public:
static const size_t maxCellSize = 1024;
- static const size_t PropertyStorageNurserySize = 4 * MB;
struct SizeClass {
SizeClass();
@@ -64,9 +63,6 @@
SizeClass& sizeClassFor(size_t);
void* allocate(SizeClass&);
- inline void* allocatePropertyStorage(size_t);
- inline bool inPropertyStorageNursery(void* ptr);
- inline void resetPropertyStorageNursery();
void resetAllocator();
@@ -96,8 +92,6 @@
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;
@@ -166,31 +160,7 @@
sizeClass.firstFreeCell = firstFreeCell->next;
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) {
Modified: trunk/Source/_javascript_Core/runtime/JSObject.cpp (95438 => 95439)
--- trunk/Source/_javascript_Core/runtime/JSObject.cpp 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/runtime/JSObject.cpp 2011-09-19 17:41:51 UTC (rev 95439)
@@ -596,16 +596,7 @@
// It's important that this function not rely on m_structure, since
// we might be in the middle of a transition.
PropertyStorage newPropertyStorage = 0;
- if (globalData.heap.inPropertyStorageNursery(m_propertyStorage.get())) {
- newPropertyStorage = static_cast<PropertyStorage>(globalData.heap.allocatePropertyStorage(newSize * sizeof(WriteBarrierBase<Unknown>)));
- if (!newPropertyStorage || !globalData.heap.inPropertyStorageNursery(m_propertyStorage.get())) {
- // If allocation failed because it's too big, or it triggered a GC
- // that promoted us to old space, we need to allocate our property
- // storage in old space.
- newPropertyStorage = new WriteBarrierBase<Unknown>[newSize];
- }
- } else
- newPropertyStorage = new WriteBarrierBase<Unknown>[newSize];
+ newPropertyStorage = new WriteBarrierBase<Unknown>[newSize];
PropertyStorage oldPropertyStorage = m_propertyStorage.get();
ASSERT(newPropertyStorage);
@@ -613,7 +604,7 @@
for (unsigned i = 0; i < oldSize; ++i)
newPropertyStorage[i] = oldPropertyStorage[i];
- if (!isUsingInlineStorage() && !globalData.heap.inPropertyStorageNursery(m_propertyStorage.get()))
+ if (!isUsingInlineStorage())
delete [] oldPropertyStorage;
m_propertyStorage.set(globalData, this, newPropertyStorage);
Modified: trunk/Source/_javascript_Core/runtime/JSObject.h (95438 => 95439)
--- trunk/Source/_javascript_Core/runtime/JSObject.h 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/runtime/JSObject.h 2011-09-19 17:41:51 UTC (rev 95439)
@@ -438,7 +438,7 @@
inline JSObject::~JSObject()
{
- if (!isUsingInlineStorage() && !Heap::heap(this)->inPropertyStorageNursery(m_propertyStorage.get()))
+ if (!isUsingInlineStorage())
delete [] m_propertyStorage.get();
}
@@ -826,12 +826,6 @@
JSCell::visitChildren(visitor);
PropertyStorage storage = propertyStorage();
- if (Heap::heap(this)->inPropertyStorageNursery(storage)) {
- m_propertyStorage.set(new WriteBarrierBase<Unknown>[structure()->propertyStorageCapacity()], StorageBarrier::Unchecked);
- if (structure()->propertyStorageCapacity() > m_structure->propertyStorageSize())
- ASSERT(!storage[m_structure->propertyStorageSize()]);
- memcpy(m_propertyStorage.get(), storage, m_structure->propertyStorageSize() * sizeof(WriteBarrierBase<Unknown>));
- }
size_t storageSize = m_structure->propertyStorageSize();
visitor.appendValues(storage, storageSize);
if (m_inheritorID)
Modified: trunk/Source/_javascript_Core/runtime/StorageBarrier.h (95438 => 95439)
--- trunk/Source/_javascript_Core/runtime/StorageBarrier.h 2011-09-19 17:34:53 UTC (rev 95438)
+++ trunk/Source/_javascript_Core/runtime/StorageBarrier.h 2011-09-19 17:41:51 UTC (rev 95439)
@@ -47,10 +47,8 @@
set(storage, Unchecked);
}
- void set(JSGlobalData& globalData, JSCell* owner, PropertyStorage newStorage)
+ void set(JSGlobalData&, JSCell*, PropertyStorage newStorage)
{
- if (!globalData.heap.inPropertyStorageNursery(m_storage))
- globalData.heap.writeBarrier(owner, JSValue());
m_storage = newStorage;
}