diff options
Diffstat (limited to 'deps/v8/src/heap/heap.h')
-rw-r--r-- | deps/v8/src/heap/heap.h | 69 |
1 files changed, 43 insertions, 26 deletions
diff --git a/deps/v8/src/heap/heap.h b/deps/v8/src/heap/heap.h index 0f3c9ea3899..2e750d56fad 100644 --- a/deps/v8/src/heap/heap.h +++ b/deps/v8/src/heap/heap.h @@ -47,7 +47,7 @@ class DeoptimizationData; class HandlerTable; class IncrementalMarking; class JSArrayBuffer; - +class ExternalString; using v8::MemoryPressureLevel; // Heap roots that are known to be immortal immovable, for which we can safely @@ -88,7 +88,6 @@ using v8::MemoryPressureLevel; V(EmptyScript) \ V(EmptySloppyArgumentsElements) \ V(EmptySlowElementDictionary) \ - V(EmptyWeakCell) \ V(EvalContextMap) \ V(Exception) \ V(FalseValue) \ @@ -159,19 +158,12 @@ using v8::MemoryPressureLevel; V(UninitializedValue) \ V(UncompiledDataWithoutPreParsedScopeMap) \ V(UncompiledDataWithPreParsedScopeMap) \ - V(WeakCellMap) \ V(WeakFixedArrayMap) \ V(WeakArrayListMap) \ V(WithContextMap) \ V(empty_string) \ PRIVATE_SYMBOL_LIST(V) -#define FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(heap, array, start, length) \ - do { \ - heap->RecordFixedArrayElements(array, start, length); \ - heap->incremental_marking()->RecordWrites(array); \ - } while (false) - class AllocationObserver; class ArrayBufferCollector; class ArrayBufferTracker; @@ -492,6 +484,24 @@ class Heap { // by pointer size. static inline void CopyBlock(Address dst, Address src, int byte_size); + V8_EXPORT_PRIVATE static void WriteBarrierForCodeSlow(Code* host); + V8_EXPORT_PRIVATE static void GenerationalBarrierSlow(HeapObject* object, + Address slot, + HeapObject* value); + V8_EXPORT_PRIVATE static void GenerationalBarrierForElementsSlow( + Heap* heap, FixedArray* array, int offset, int length); + V8_EXPORT_PRIVATE static void GenerationalBarrierForCodeSlow( + Code* host, RelocInfo* rinfo, HeapObject* value); + V8_EXPORT_PRIVATE static void MarkingBarrierSlow(HeapObject* object, + Address slot, + HeapObject* value); + V8_EXPORT_PRIVATE static void MarkingBarrierForElementsSlow( + Heap* heap, HeapObject* object); + V8_EXPORT_PRIVATE static void MarkingBarrierForCodeSlow(Code* host, + RelocInfo* rinfo, + HeapObject* value); + V8_EXPORT_PRIVATE static bool PageFlagsAreConsistent(HeapObject* object); + // Notifies the heap that is ok to start marking or other activities that // should not happen during deserialization. void NotifyDeserializationComplete(); @@ -678,7 +688,10 @@ class Heap { external_memory_concurrently_freed_ = 0; } - void CompactFixedArraysOfWeakCells(); + void ProcessMovedExternalString(Page* old_page, Page* new_page, + ExternalString* string); + + void CompactWeakArrayLists(PretenureFlag pretenure); void AddRetainedMap(Handle<Map> map); @@ -842,6 +855,10 @@ class Heap { return kRootsBuiltinsOffset; } + static constexpr int root_register_addressable_end_offset() { + return kRootRegisterAddressableEndOffset; + } + Address root_register_addressable_end() { return reinterpret_cast<Address>(roots_array_start()) + kRootRegisterAddressableEndOffset; @@ -971,16 +988,6 @@ class Heap { // Store buffer API. ========================================================= // =========================================================================== - // Write barrier support for object[offset] = o; - inline void RecordWrite(Object* object, MaybeObject** slot, - MaybeObject* value); - inline void RecordWrite(Object* object, Object** slot, Object* value); - inline void RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* target); - void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* target); - void RecordWritesIntoCode(Code* code); - inline void RecordFixedArrayElements(FixedArray* array, int offset, - int length); - // Used for query incremental marking status in generated code. Address* IsMarkingFlagAddress() { return reinterpret_cast<Address*>(&is_marking_flag_); @@ -988,7 +995,9 @@ class Heap { void SetIsMarkingFlag(uint8_t flag) { is_marking_flag_ = flag; } - inline Address* store_buffer_top_address(); + Address* store_buffer_top_address(); + static intptr_t store_buffer_mask_constant(); + static Address store_buffer_overflow_function_address(); void ClearRecordedSlot(HeapObject* object, Object** slot); void ClearRecordedSlotRange(Address start, Address end); @@ -1081,6 +1090,8 @@ class Heap { void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); void TracePossibleWrapper(JSObject* js_object); void RegisterExternallyReferencedObject(Object** object); + void SetEmbedderStackStateForNextFinalizaton( + EmbedderHeapTracer::EmbedderStackState stack_state); // =========================================================================== // External string table API. ================================================ @@ -1089,6 +1100,11 @@ class Heap { // Registers an external string. inline void RegisterExternalString(String* string); + // Called when a string's resource is changed. The size of the payload is sent + // as argument of the method. + inline void UpdateExternalString(String* string, size_t old_payload, + size_t new_payload); + // Finalizes an external string by deleting the associated external // data and clearing the resource pointer. inline void FinalizeExternalString(String* string); @@ -1466,6 +1482,9 @@ class Heap { static const char* GarbageCollectionReasonToString( GarbageCollectionReason gc_reason); + // Calculates the nof entries for the full sized number to string cache. + inline int MaxNumberToStringCacheSize() const; + private: class SkipStoreBufferScope; @@ -1481,6 +1500,7 @@ class Heap { // Registers an external string. inline void AddString(String* string); + bool Contains(HeapObject* obj); void IterateAll(RootVisitor* v); void IterateNewSpaceStrings(RootVisitor* v); @@ -1501,6 +1521,7 @@ class Heap { private: void Verify(); + void VerifyNewSpace(); Heap* const heap_; @@ -1615,8 +1636,6 @@ class Heap { int NumberOfScavengeTasks(); - void PreprocessStackTraces(); - // Checks whether a global GC is necessary GarbageCollector SelectGarbageCollector(AllocationSpace space, const char** reason); @@ -1675,8 +1694,6 @@ class Heap { // Record statistics after garbage collection. void ReportStatisticsAfterGC(); - // Creates and installs the full-sized number string cache. - int FullSizeNumberStringCacheLength(); // Flush the number to string cache. void FlushNumberStringCache(); @@ -2249,7 +2266,7 @@ class Heap { friend class EphemeronHashTableMarkingTask; friend class GCCallbacksScope; friend class GCTracer; - friend class HeapController; + friend class MemoryController; friend class HeapIterator; friend class IdleScavengeObserver; friend class IncrementalMarking; |