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

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

Issue 2375983002: Revert of [heap] New heuristics for starting of incremental marking. (Closed)
Patch Set: 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 static inline void CopyBlock(Address dst, Address src, int byte_size); 701 static inline void CopyBlock(Address dst, Address src, int byte_size);
702 702
703 // Determines a static visitor id based on the given {map} that can then be 703 // Determines a static visitor id based on the given {map} that can then be
704 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. 704 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}.
705 static int GetStaticVisitorIdForMap(Map* map); 705 static int GetStaticVisitorIdForMap(Map* map);
706 706
707 // Notifies the heap that is ok to start marking or other activities that 707 // Notifies the heap that is ok to start marking or other activities that
708 // should not happen during deserialization. 708 // should not happen during deserialization.
709 void NotifyDeserializationComplete(); 709 void NotifyDeserializationComplete();
710 710
711 intptr_t old_generation_allocation_limit() const {
712 return old_generation_allocation_limit_;
713 }
714
715 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; }
716
711 inline Address* NewSpaceAllocationTopAddress(); 717 inline Address* NewSpaceAllocationTopAddress();
712 inline Address* NewSpaceAllocationLimitAddress(); 718 inline Address* NewSpaceAllocationLimitAddress();
713 inline Address* OldSpaceAllocationTopAddress(); 719 inline Address* OldSpaceAllocationTopAddress();
714 inline Address* OldSpaceAllocationLimitAddress(); 720 inline Address* OldSpaceAllocationLimitAddress();
715 721
722 bool CanExpandOldGeneration(int size) {
723 if (force_oom_) return false;
724 return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
725 }
726
716 // Clear the Instanceof cache (used when a prototype changes). 727 // Clear the Instanceof cache (used when a prototype changes).
717 inline void ClearInstanceofCache(); 728 inline void ClearInstanceofCache();
718 729
719 // FreeSpace objects have a null map after deserialization. Update the map. 730 // FreeSpace objects have a null map after deserialization. Update the map.
720 void RepairFreeListsAfterDeserialization(); 731 void RepairFreeListsAfterDeserialization();
721 732
722 // Move len elements within a given array from src_index index to dst_index 733 // Move len elements within a given array from src_index index to dst_index
723 // index. 734 // index.
724 void MoveElements(FixedArray* array, int dst_index, int src_index, int len); 735 void MoveElements(FixedArray* array, int dst_index, int src_index, int len);
725 736
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 bool is_isolate_locked); 839 bool is_isolate_locked);
829 void CheckMemoryPressure(); 840 void CheckMemoryPressure();
830 841
831 double MonotonicallyIncreasingTimeInMs(); 842 double MonotonicallyIncreasingTimeInMs();
832 843
833 void RecordStats(HeapStats* stats, bool take_snapshot = false); 844 void RecordStats(HeapStats* stats, bool take_snapshot = false);
834 845
835 // Check new space expansion criteria and expand semispaces if it was hit. 846 // Check new space expansion criteria and expand semispaces if it was hit.
836 void CheckNewSpaceExpansionCriteria(); 847 void CheckNewSpaceExpansionCriteria();
837 848
849 inline bool HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit);
850
838 void VisitExternalResources(v8::ExternalResourceVisitor* visitor); 851 void VisitExternalResources(v8::ExternalResourceVisitor* visitor);
839 852
840 // An object should be promoted if the object has survived a 853 // An object should be promoted if the object has survived a
841 // scavenge operation. 854 // scavenge operation.
842 template <PromotionMode promotion_mode> 855 template <PromotionMode promotion_mode>
843 inline bool ShouldBePromoted(Address old_address, int object_size); 856 inline bool ShouldBePromoted(Address old_address, int object_size);
844 857
845 inline PromotionMode CurrentPromotionMode(); 858 inline PromotionMode CurrentPromotionMode();
846 859
847 void ClearNormalizedMapCaches(); 860 void ClearNormalizedMapCaches();
848 861
849 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); 862 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature);
850 863
864 inline bool OldGenerationAllocationLimitReached();
865
851 // Completely clear the Instanceof cache (to stop it keeping objects alive 866 // Completely clear the Instanceof cache (to stop it keeping objects alive
852 // around a GC). 867 // around a GC).
853 inline void CompletelyClearInstanceofCache(); 868 inline void CompletelyClearInstanceofCache();
854 869
855 inline uint32_t HashSeed(); 870 inline uint32_t HashSeed();
856 871
857 inline int NextScriptId(); 872 inline int NextScriptId();
858 873
859 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset); 874 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset);
860 inline void SetConstructStubDeoptPCOffset(int pc_offset); 875 inline void SetConstructStubDeoptPCOffset(int pc_offset);
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 // given old generation size. 1824 // given old generation size.
1810 intptr_t CalculateOldGenerationAllocationLimit(double factor, 1825 intptr_t CalculateOldGenerationAllocationLimit(double factor,
1811 intptr_t old_gen_size); 1826 intptr_t old_gen_size);
1812 1827
1813 // Sets the allocation limit to trigger the next full garbage collection. 1828 // Sets the allocation limit to trigger the next full garbage collection.
1814 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed, 1829 void SetOldGenerationAllocationLimit(intptr_t old_gen_size, double gc_speed,
1815 double mutator_speed); 1830 double mutator_speed);
1816 1831
1817 intptr_t MinimumAllocationLimitGrowingStep(); 1832 intptr_t MinimumAllocationLimitGrowingStep();
1818 1833
1819 intptr_t old_generation_allocation_limit() const {
1820 return old_generation_allocation_limit_;
1821 }
1822
1823 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; }
1824
1825 bool CanExpandOldGeneration(int size) {
1826 if (force_oom_) return false;
1827 return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
1828 }
1829
1830 bool ShouldExpandOldGenerationOnAllocationFailure();
1831
1832 enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit };
1833 IncrementalMarkingLimit IncrementalMarkingLimitReached();
1834
1835 // =========================================================================== 1834 // ===========================================================================
1836 // Idle notification. ======================================================== 1835 // Idle notification. ========================================================
1837 // =========================================================================== 1836 // ===========================================================================
1838 1837
1839 bool RecentIdleNotificationHappened(); 1838 bool RecentIdleNotificationHappened();
1840 void ScheduleIdleScavengeIfNeeded(int bytes_allocated); 1839 void ScheduleIdleScavengeIfNeeded(int bytes_allocated);
1841 1840
1842 // =========================================================================== 1841 // ===========================================================================
1843 // HeapIterator helpers. ===================================================== 1842 // HeapIterator helpers. =====================================================
1844 // =========================================================================== 1843 // ===========================================================================
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 // Used for testing purposes. 2296 // Used for testing purposes.
2298 bool force_oom_; 2297 bool force_oom_;
2299 2298
2300 // Classes in "heap" can be friends. 2299 // Classes in "heap" can be friends.
2301 friend class AlwaysAllocateScope; 2300 friend class AlwaysAllocateScope;
2302 friend class GCCallbacksScope; 2301 friend class GCCallbacksScope;
2303 friend class GCTracer; 2302 friend class GCTracer;
2304 friend class HeapIterator; 2303 friend class HeapIterator;
2305 friend class IdleScavengeObserver; 2304 friend class IdleScavengeObserver;
2306 friend class IncrementalMarking; 2305 friend class IncrementalMarking;
2307 friend class IncrementalMarkingJob;
2308 friend class IteratePromotedObjectsVisitor; 2306 friend class IteratePromotedObjectsVisitor;
2309 friend class LargeObjectSpace;
2310 friend class MarkCompactCollector; 2307 friend class MarkCompactCollector;
2311 friend class MarkCompactMarkingVisitor; 2308 friend class MarkCompactMarkingVisitor;
2312 friend class NewSpace; 2309 friend class NewSpace;
2313 friend class ObjectStatsCollector; 2310 friend class ObjectStatsCollector;
2314 friend class Page; 2311 friend class Page;
2315 friend class PagedSpace;
2316 friend class Scavenger; 2312 friend class Scavenger;
2317 friend class StoreBuffer; 2313 friend class StoreBuffer;
2318 friend class TestMemoryAllocatorScope; 2314 friend class TestMemoryAllocatorScope;
2319 2315
2320 // The allocator interface. 2316 // The allocator interface.
2321 friend class Factory; 2317 friend class Factory;
2322 2318
2323 // The Isolate constructs us. 2319 // The Isolate constructs us.
2324 friend class Isolate; 2320 friend class Isolate;
2325 2321
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
2611 friend class LargeObjectSpace; 2607 friend class LargeObjectSpace;
2612 friend class NewSpace; 2608 friend class NewSpace;
2613 friend class PagedSpace; 2609 friend class PagedSpace;
2614 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2610 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2615 }; 2611 };
2616 2612
2617 } // namespace internal 2613 } // namespace internal
2618 } // namespace v8 2614 } // namespace v8
2619 2615
2620 #endif // V8_HEAP_HEAP_H_ 2616 #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