summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap/Heap.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/heap/Heap.h')
-rw-r--r--Source/JavaScriptCore/heap/Heap.h31
1 files changed, 22 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index 1d0ac5407..bcacee6d5 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -40,7 +40,7 @@
namespace JSC {
- class BumpSpace;
+ class CopiedSpace;
class CodeBlock;
class GCActivityCallback;
class GlobalCodeBlock;
@@ -50,6 +50,7 @@ namespace JSC {
class JSGlobalData;
class JSValue;
class LiveObjectIterator;
+ class LLIntOffsetsExtractor;
class MarkedArgumentBuffer;
class RegisterFile;
class UString;
@@ -95,8 +96,9 @@ namespace JSC {
// true if an allocation or collection is in progress
inline bool isBusy();
- MarkedAllocator& allocatorForObject(size_t bytes) { return m_objectSpace.allocatorFor(bytes); }
- void* allocate(size_t);
+ MarkedAllocator& firstAllocatorWithoutDestructors() { return m_objectSpace.firstAllocator(); }
+ MarkedAllocator& allocatorForObjectWithoutDestructor(size_t bytes) { return m_objectSpace.allocatorFor(bytes); }
+ MarkedAllocator& allocatorForObjectWithDestructor(size_t bytes) { return m_objectSpace.destructorAllocatorFor(bytes); }
CheckedBoolean tryAllocateStorage(size_t, void**);
CheckedBoolean tryReallocateStorage(void**, size_t, size_t);
@@ -136,12 +138,17 @@ namespace JSC {
void getConservativeRegisterRoots(HashSet<JSCell*>& roots);
private:
+ friend class CodeBlock;
+ friend class LLIntOffsetsExtractor;
friend class MarkedSpace;
friend class MarkedAllocator;
friend class MarkedBlock;
- friend class BumpSpace;
+ friend class CopiedSpace;
friend class SlotVisitor;
- friend class CodeBlock;
+ template<typename T> friend void* allocateCell(Heap&);
+
+ void* allocateWithDestructor(size_t);
+ void* allocateWithoutDestructor(size_t);
size_t waterMark();
size_t highWaterMark();
@@ -183,7 +190,7 @@ namespace JSC {
void waitForRelativeTimeWhileHoldingLock(double relative);
void waitForRelativeTime(double relative);
void blockFreeingThreadMain();
- static void* blockFreeingThreadStartFunc(void* heap);
+ static void blockFreeingThreadStartFunc(void* heap);
const HeapSize m_heapSize;
const size_t m_minBytesPerCycle;
@@ -193,7 +200,7 @@ namespace JSC {
OperationInProgress m_operationInProgress;
MarkedSpace m_objectSpace;
- BumpSpace m_storageSpace;
+ CopiedSpace m_storageSpace;
DoublyLinkedList<HeapBlock> m_freeBlocks;
size_t m_numberOfFreeBlocks;
@@ -334,10 +341,16 @@ namespace JSC {
return forEachProtectedCell(functor);
}
- inline void* Heap::allocate(size_t bytes)
+ inline void* Heap::allocateWithDestructor(size_t bytes)
+ {
+ ASSERT(isValidAllocation(bytes));
+ return m_objectSpace.allocateWithDestructor(bytes);
+ }
+
+ inline void* Heap::allocateWithoutDestructor(size_t bytes)
{
ASSERT(isValidAllocation(bytes));
- return m_objectSpace.allocate(bytes);
+ return m_objectSpace.allocateWithoutDestructor(bytes);
}
inline CheckedBoolean Heap::tryAllocateStorage(size_t bytes, void** outPtr)