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

Unified Diff: src/heap/heap.h

Issue 1420423009: [heap] Black allocation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index e049573139e59901ee8cc19a95675cfd5a4f9af2..db6b86d6e953ee877751ae1a24ecca3cd230ff8e 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -356,20 +356,22 @@ class PromotionQueue {
(emergency_stack_ == NULL || emergency_stack_->length() == 0);
}
- inline void insert(HeapObject* target, intptr_t size);
+ inline void insert(HeapObject* target, int32_t size, bool was_marked_black);
- void remove(HeapObject** target, intptr_t* size) {
+ void remove(HeapObject** target, int32_t* size, bool* was_marked_black) {
DCHECK(!is_empty());
if (front_ == rear_) {
Entry e = emergency_stack_->RemoveLast();
*target = e.obj_;
*size = e.size_;
+ *was_marked_black = e.was_marked_black_;
return;
}
struct Entry* entry = reinterpret_cast<struct Entry*>(--front_);
*target = entry->obj_;
*size = entry->size_;
+ *was_marked_black = entry->was_marked_black_;
// Assert no underflow.
SemiSpace::AssertValidRange(reinterpret_cast<Address>(rear_),
@@ -377,15 +379,17 @@ class PromotionQueue {
}
private:
- static const int kEntrySizeInWords = 2;
-
struct Entry {
- Entry(HeapObject* obj, intptr_t size) : obj_(obj), size_(size) {}
+ Entry(HeapObject* obj, int32_t size, bool was_marked_black)
+ : obj_(obj), size_(size), was_marked_black_(was_marked_black) {}
HeapObject* obj_;
- intptr_t size_;
+ int32_t size_ : 31;
+ bool was_marked_black_ : 1;
};
+ void RelocateQueueHead();
+
// The front of the queue is higher in the memory page chain than the rear.
struct Entry* front_;
struct Entry* rear_;
@@ -395,10 +399,6 @@ class PromotionQueue {
Heap* heap_;
- void RelocateQueueHead();
-
- STATIC_ASSERT(sizeof(struct Entry) == kEntrySizeInWords * kPointerSize);
-
DISALLOW_COPY_AND_ASSIGN(PromotionQueue);
};
@@ -1047,14 +1047,14 @@ class Heap {
// Iterates over all the other roots in the heap.
void IterateWeakRoots(ObjectVisitor* v, VisitMode mode);
- // Iterate pointers to from semispace of new space found in memory interval
- // from start to end within |object|.
- void IteratePointersToFromSpace(HeapObject* target, int size,
- ObjectSlotCallback callback);
+ // Iterate pointers of promoted objects.
+ void IteratePromotedObject(HeapObject* target, int size,
+ bool was_marked_black,
+ ObjectSlotCallback callback);
- void IterateAndMarkPointersToFromSpace(HeapObject* object, Address start,
- Address end, bool record_slots,
- ObjectSlotCallback callback);
+ void IteratePromotedObjectPointers(HeapObject* object, Address start,
+ Address end, bool record_slots,
+ ObjectSlotCallback callback);
// ===========================================================================
// Store buffer API. =========================================================
@@ -1089,6 +1089,8 @@ class Heap {
bool TryFinalizeIdleIncrementalMarking(double idle_time_in_ms);
+ void RegisterReservationsForBlackAllocation(Reservation* reservations);
+
IncrementalMarking* incremental_marking() { return incremental_marking_; }
// ===========================================================================
@@ -2219,7 +2221,7 @@ class Heap {
friend class HeapIterator;
friend class IdleScavengeObserver;
friend class IncrementalMarking;
- friend class IteratePointersToFromSpaceVisitor;
+ friend class IteratePromotedObjectsVisitor;
friend class MarkCompactCollector;
friend class MarkCompactMarkingVisitor;
friend class NewSpace;
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698