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

Unified Diff: src/heap/mark-compact.h

Issue 1295713004: Untangle slots buffer part 1: Make invalid slots filtering part of MarkCompactCollector. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index 99a50487f9c457465c8879f9efd20bd08d569eb7..8ab877ef555e82aebfdb12668acc22c4dc1cd418 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -306,12 +306,15 @@ class SlotsBuffer {
slots_[idx_++] = slot;
}
- // Should be used for testing only.
+ void Set(intptr_t i, ObjectSlot slot) { slots_[i] = slot; }
+
ObjectSlot Get(intptr_t i) {
- DCHECK(i >= 0 && i < kNumberOfElements);
+ DCHECK(i >= 0 && i < idx_);
return slots_[i];
}
+ size_t Size() const { return idx_; }
+
enum SlotType {
EMBEDDED_OBJECT_SLOT,
OBJECT_SLOT,
@@ -396,19 +399,10 @@ class SlotsBuffer {
SlotsBuffer** buffer_address, SlotType type, Address addr,
AdditionMode mode);
- // Eliminates all stale entries from the slots buffer, i.e., slots that
- // are not part of live objects anymore. This method must be called after
- // marking, when the whole transitive closure is known and must be called
- // before sweeping when mark bits are still intact.
- static void RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer);
-
// Eliminate all slots that are within the given address range.
static void RemoveObjectSlots(Heap* heap, SlotsBuffer* buffer,
Address start_slot, Address end_slot);
- // Ensures that there are no invalid slots in the chain of slots buffers.
- static void VerifySlots(Heap* heap, SlotsBuffer* buffer);
-
static const int kNumberOfElements = 1021;
private:
@@ -684,8 +678,16 @@ class MarkCompactCollector {
bool WillBeDeoptimized(Code* code);
void EvictPopularEvacuationCandidate(Page* page);
+
+ // Clears invald store buffer and slots buffer entries. This method must
+ // be called after marking, when the whole transitive closure is known and
+ // must be called before sweeping when mark bits are still intact.
void ClearInvalidStoreAndSlotsBufferEntries();
+ // Eliminates all stale entries from the slots buffer, i.e., slots that
+ // are not part of live objects anymore.
+ void ClearInvalidSlotsBufferEntries(SlotsBuffer* buffer);
+
void StartSweeperThreads();
#ifdef DEBUG
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698