Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: src/heap/heap.h

Issue 2379663002: Reland "[heap] New heuristics for starting of incremental marking. (patchset #9 id:160001 of https:… (Closed)
Patch Set: fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 static inline void CopyBlock(Address dst, Address src, int byte_size); 702 static inline void CopyBlock(Address dst, Address src, int byte_size);
703 703
704 // Determines a static visitor id based on the given {map} that can then be 704 // Determines a static visitor id based on the given {map} that can then be
705 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. 705 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}.
706 static int GetStaticVisitorIdForMap(Map* map); 706 static int GetStaticVisitorIdForMap(Map* map);
707 707
708 // Notifies the heap that is ok to start marking or other activities that 708 // Notifies the heap that is ok to start marking or other activities that
709 // should not happen during deserialization. 709 // should not happen during deserialization.
710 void NotifyDeserializationComplete(); 710 void NotifyDeserializationComplete();
711 711
712 intptr_t old_generation_allocation_limit() const {
713 return old_generation_allocation_limit_;
714 }
715
716 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; }
717
718 inline Address* NewSpaceAllocationTopAddress(); 712 inline Address* NewSpaceAllocationTopAddress();
719 inline Address* NewSpaceAllocationLimitAddress(); 713 inline Address* NewSpaceAllocationLimitAddress();
720 inline Address* OldSpaceAllocationTopAddress(); 714 inline Address* OldSpaceAllocationTopAddress();
721 inline Address* OldSpaceAllocationLimitAddress(); 715 inline Address* OldSpaceAllocationLimitAddress();
722 716
723 bool CanExpandOldGeneration(int size) {
724 if (force_oom_) return false;
725 return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
726 }
727
728 // Clear the Instanceof cache (used when a prototype changes). 717 // Clear the Instanceof cache (used when a prototype changes).
729 inline void ClearInstanceofCache(); 718 inline void ClearInstanceofCache();
730 719
731 // FreeSpace objects have a null map after deserialization. Update the map. 720 // FreeSpace objects have a null map after deserialization. Update the map.
732 void RepairFreeListsAfterDeserialization(); 721 void RepairFreeListsAfterDeserialization();
733 722
734 // Move len elements within a given array from src_index index to dst_index 723 // Move len elements within a given array from src_index index to dst_index
735 // index. 724 // index.
736 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); 725 void MoveElements(FixedArray* array, int dst_index, int src_index, int len);
737 726
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 bool is_isolate_locked); 829 bool is_isolate_locked);
841 void CheckMemoryPressure(); 830 void CheckMemoryPressure();
842 831
843 double MonotonicallyIncreasingTimeInMs(); 832 double MonotonicallyIncreasingTimeInMs();
844 833
845 void RecordStats(HeapStats* stats, bool take_snapshot = false); 834 void RecordStats(HeapStats* stats, bool take_snapshot = false);
846 835
847 // Check new space expansion criteria and expand semispaces if it was hit. 836 // Check new space expansion criteria and expand semispaces if it was hit.
848 void CheckNewSpaceExpansionCriteria(); 837 void CheckNewSpaceExpansionCriteria();
849 838
850 inline bool HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit);
851
852 void VisitExternalResources(v8::ExternalResourceVisitor* visitor); 839 void VisitExternalResources(v8::ExternalResourceVisitor* visitor);
853 840
854 // An object should be promoted if the object has survived a 841 // An object should be promoted if the object has survived a
855 // scavenge operation. 842 // scavenge operation.
856 template <PromotionMode promotion_mode> 843 template <PromotionMode promotion_mode>
857 inline bool ShouldBePromoted(Address old_address, int object_size); 844 inline bool ShouldBePromoted(Address old_address, int object_size);
858 845
859 inline PromotionMode CurrentPromotionMode(); 846 inline PromotionMode CurrentPromotionMode();
860 847
861 void ClearNormalizedMapCaches(); 848 void ClearNormalizedMapCaches();
862 849
863 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); 850 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature);
864 851
865 inline bool OldGenerationAllocationLimitReached();
866
867 // Completely clear the Instanceof cache (to stop it keeping objects alive 852 // Completely clear the Instanceof cache (to stop it keeping objects alive
868 // around a GC). 853 // around a GC).
869 inline void CompletelyClearInstanceofCache(); 854 inline void CompletelyClearInstanceofCache();
870 855
871 inline uint32_t HashSeed(); 856 inline uint32_t HashSeed();
872 857
873 inline int NextScriptId(); 858 inline int NextScriptId();
874 859
875 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset); 860 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset);
876 inline void SetConstructStubDeoptPCOffset(int pc_offset); 861 inline void SetConstructStubDeoptPCOffset(int pc_offset);
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 // given old generation size. 1824 // given old generation size.
1840 intptr_t CalculateOldGenerationAllocationLimit(double factor, 1825 intptr_t CalculateOldGenerationAllocationLimit(double factor,
1841 intptr_t old_gen_size); 1826 intptr_t old_gen_size);
1842 1827
1843 // Sets the allocation limit to trigger the next full garbage collection. 1828 // Sets the allocation limit to trigger the next full garbage collection.
1844 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, 1829 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed,
1845 double mutator_speed); 1830 double mutator_speed);
1846 1831
1847 intptr_t MinimumAllocationLimitGrowingStep(); 1832 intptr_t MinimumAllocationLimitGrowingStep();
1848 1833
1834 intptr_t old_generation_allocation_limit() const {
1835 return old_generation_allocation_limit_;
1836 }
1837
1838 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; }
1839
1840 bool CanExpandOldGeneration(int size) {
1841 if (force_oom_) return false;
1842 return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
1843 }
1844
1845 bool ShouldExpandOldGenerationOnAllocationFailure();
1846
1847 enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit };
1848 IncrementalMarkingLimit IncrementalMarkingLimitReached();
1849
1849 // =========================================================================== 1850 // ===========================================================================
1850 // Idle notification. ======================================================== 1851 // Idle notification. ========================================================
1851 // =========================================================================== 1852 // ===========================================================================
1852 1853
1853 bool RecentIdleNotificationHappened(); 1854 bool RecentIdleNotificationHappened();
1854 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); 1855 void ScheduleIdleScavengeIfNeeded(int bytes_allocated);
1855 1856
1856 // =========================================================================== 1857 // ===========================================================================
1857 // HeapIterator helpers. ===================================================== 1858 // HeapIterator helpers. =====================================================
1858 // =========================================================================== 1859 // ===========================================================================
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 // Used for testing purposes. 2316 // Used for testing purposes.
2316 bool force_oom_; 2317 bool force_oom_;
2317 2318
2318 // Classes in "heap" can be friends. 2319 // Classes in "heap" can be friends.
2319 friend class AlwaysAllocateScope; 2320 friend class AlwaysAllocateScope;
2320 friend class GCCallbacksScope; 2321 friend class GCCallbacksScope;
2321 friend class GCTracer; 2322 friend class GCTracer;
2322 friend class HeapIterator; 2323 friend class HeapIterator;
2323 friend class IdleScavengeObserver; 2324 friend class IdleScavengeObserver;
2324 friend class IncrementalMarking; 2325 friend class IncrementalMarking;
2326 friend class IncrementalMarkingJob;
2325 friend class IteratePromotedObjectsVisitor; 2327 friend class IteratePromotedObjectsVisitor;
2328 friend class LargeObjectSpace;
2326 friend class MarkCompactCollector; 2329 friend class MarkCompactCollector;
2327 friend class MarkCompactMarkingVisitor; 2330 friend class MarkCompactMarkingVisitor;
2328 friend class NewSpace; 2331 friend class NewSpace;
2329 friend class ObjectStatsCollector; 2332 friend class ObjectStatsCollector;
2330 friend class Page; 2333 friend class Page;
2334 friend class PagedSpace;
2331 friend class Scavenger; 2335 friend class Scavenger;
2332 friend class StoreBuffer; 2336 friend class StoreBuffer;
2333 friend class TestMemoryAllocatorScope; 2337 friend class TestMemoryAllocatorScope;
2334 2338
2335 // The allocator interface. 2339 // The allocator interface.
2336 friend class Factory; 2340 friend class Factory;
2337 2341
2338 // The Isolate constructs us. 2342 // The Isolate constructs us.
2339 friend class Isolate; 2343 friend class Isolate;
2340 2344
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
2638 } 2642 }
2639 2643
2640 private: 2644 private:
2641 Heap* heap_; 2645 Heap* heap_;
2642 }; 2646 };
2643 2647
2644 } // namespace internal 2648 } // namespace internal
2645 } // namespace v8 2649 } // namespace v8
2646 2650
2647 #endif // V8_HEAP_HEAP_H_ 2651 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698