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

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: Rewrite using PromotionMode Created 4 years, 7 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-inl.h » ('j') | src/heap/scavenger-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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // An object should be promoted if the object has survived a 778 // An object should be promoted if the object has survived a
779 // scavenge operation. 779 // scavenge operation.
780 inline bool ShouldBePromoted(Address old_address, int object_size); 780 inline bool ShouldBePromoted(Address old_address, int object_size,
781 PromotionMode promotion_mode);
781 782
782 void ClearNormalizedMapCaches(); 783 void ClearNormalizedMapCaches();
783 784
784 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); 785 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature);
785 786
786 inline bool OldGenerationAllocationLimitReached(); 787 inline bool OldGenerationAllocationLimitReached();
787 788
788 // Completely clear the Instanceof cache (to stop it keeping objects alive 789 // Completely clear the Instanceof cache (to stop it keeping objects alive
789 // around a GC). 790 // around a GC).
790 inline void CompletelyClearInstanceofCache(); 791 inline void CompletelyClearInstanceofCache();
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
2662 friend class LargeObjectSpace; 2663 friend class LargeObjectSpace;
2663 friend class NewSpace; 2664 friend class NewSpace;
2664 friend class PagedSpace; 2665 friend class PagedSpace;
2665 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2666 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2666 }; 2667 };
2667 2668
2668 } // namespace internal 2669 } // namespace internal
2669 } // namespace v8 2670 } // namespace v8
2670 2671
2671 #endif // V8_HEAP_HEAP_H_ 2672 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | src/heap/scavenger-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698