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

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

Issue 2005173003: Immediatelly promote marked objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do not compute current promotion mode on every iteration Created 4 years, 6 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') | src/heap/heap-inl.h » ('J')
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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 class HeapObjectsFilter; 294 class HeapObjectsFilter;
295 class HeapStats; 295 class HeapStats;
296 class HistogramTimer; 296 class HistogramTimer;
297 class Isolate; 297 class Isolate;
298 class MemoryReducer; 298 class MemoryReducer;
299 class ObjectStats; 299 class ObjectStats;
300 class Scavenger; 300 class Scavenger;
301 class ScavengeJob; 301 class ScavengeJob;
302 class WeakObjectRetainer; 302 class WeakObjectRetainer;
303 303
304 enum PromotionMode { FORCE_PROMOTION, DEFAULT_PROMOTION }; 304 enum PromotionMode { FORCE_PROMOTION, PROMOTE_MARKED, DEFAULT_PROMOTION };
305 305
306 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to, 306 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to,
307 PromotionMode mode); 307 PromotionMode mode);
308 308
309 // A queue of objects promoted during scavenge. Each object is accompanied 309 // A queue of objects promoted during scavenge. Each object is accompanied
310 // by it's size to avoid dereferencing a map pointer for scanning. 310 // by it's size to avoid dereferencing a map pointer for scanning.
311 // The last page in to-space is used for the promotion queue. On conflict 311 // The last page in to-space is used for the promotion queue. On conflict
312 // during scavenge, the promotion queue is allocated externally and all 312 // during scavenge, the promotion queue is allocated externally and all
313 // entries are copied to the external queue. 313 // entries are copied to the external queue.
314 class PromotionQueue { 314 class PromotionQueue {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 768
769 if (PromotedTotalSize() >= adjusted_allocation_limit) return true; 769 if (PromotedTotalSize() >= adjusted_allocation_limit) return true;
770 770
771 if (HighMemoryPressure()) return true; 771 if (HighMemoryPressure()) return true;
772 772
773 return false; 773 return false;
774 } 774 }
775 775
776 void VisitExternalResources(v8::ExternalResourceVisitor* visitor); 776 void VisitExternalResources(v8::ExternalResourceVisitor* visitor);
777 777
778 inline PromotionMode CurrentPromotionMode();
779
778 // An object should be promoted if the object has survived a 780 // An object should be promoted if the object has survived a
779 // scavenge operation. 781 // scavenge operation.
780 inline bool ShouldBePromoted(Address old_address, int object_size); 782 inline bool ShouldBePromoted(Address old_address, int object_size,
783 PromotionMode promotion_mode);
781 784
782 void ClearNormalizedMapCaches(); 785 void ClearNormalizedMapCaches();
783 786
784 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); 787 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature);
785 788
786 inline bool OldGenerationAllocationLimitReached(); 789 inline bool OldGenerationAllocationLimitReached();
787 790
788 // Completely clear the Instanceof cache (to stop it keeping objects alive 791 // Completely clear the Instanceof cache (to stop it keeping objects alive
789 // around a GC). 792 // around a GC).
790 inline void CompletelyClearInstanceofCache(); 793 inline void CompletelyClearInstanceofCache();
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 friend class LargeObjectSpace; 2665 friend class LargeObjectSpace;
2663 friend class NewSpace; 2666 friend class NewSpace;
2664 friend class PagedSpace; 2667 friend class PagedSpace;
2665 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2668 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2666 }; 2669 };
2667 2670
2668 } // namespace internal 2671 } // namespace internal
2669 } // namespace v8 2672 } // namespace v8
2670 2673
2671 #endif // V8_HEAP_HEAP_H_ 2674 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/heap-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698