diff options
Diffstat (limited to 'chromium/v8/src/heap/off-thread-heap.h')
-rw-r--r-- | chromium/v8/src/heap/off-thread-heap.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chromium/v8/src/heap/off-thread-heap.h b/chromium/v8/src/heap/off-thread-heap.h index de902be52fb..3bb1777df11 100644 --- a/chromium/v8/src/heap/off-thread-heap.h +++ b/chromium/v8/src/heap/off-thread-heap.h @@ -6,28 +6,51 @@ #define V8_HEAP_OFF_THREAD_HEAP_H_ #include <vector> + #include "src/common/globals.h" #include "src/heap/large-spaces.h" +#include "src/heap/paged-spaces.h" #include "src/heap/spaces.h" +#include "src/objects/heap-object.h" namespace v8 { namespace internal { +class OffThreadTransferHandleStorage; + class V8_EXPORT_PRIVATE OffThreadHeap { public: explicit OffThreadHeap(Heap* heap); + ~OffThreadHeap(); HeapObject AllocateRaw(int size, AllocationType allocation, AllocationAlignment alignment = kWordAligned); void AddToScriptList(Handle<Script> shared); + void OnAllocationEvent(HeapObject obj, int size) { + // TODO(leszeks): Do something here. + } + + ReadOnlySpace* read_only_space() const { + // Access the main-thread heap via the spaces. + return space_.heap()->read_only_space(); + } + + bool Contains(HeapObject obj); + + bool ReserveSpace(Heap::Reservation* reservations); + HeapObject CreateFillerObjectAt(Address addr, int size, ClearFreedMemoryMode clear_memory_mode); + OffThreadTransferHandleStorage* AddTransferHandleStorage(HandleBase handle); + void FinishOffThread(); void Publish(Heap* heap); private: + friend class DeserializerAllocator; + class StringSlotCollectingVisitor; struct RelativeSlot { @@ -43,6 +66,8 @@ class V8_EXPORT_PRIVATE OffThreadHeap { OffThreadLargeObjectSpace lo_space_; std::vector<RelativeSlot> string_slots_; std::vector<Script> script_list_; + std::unique_ptr<OffThreadTransferHandleStorage> + off_thread_transfer_handles_head_; bool is_finished = false; }; |