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

Unified Diff: src/spaces.h

Issue 10959011: Allow partial scanning of large arrays in order to avoid (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 3 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
« src/mark-compact.cc ('K') | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
===================================================================
--- src/spaces.h (revision 12562)
+++ src/spaces.h (working copy)
@@ -393,6 +393,15 @@
WAS_SWEPT_PRECISELY,
WAS_SWEPT_CONSERVATIVELY,
+ // Used for large objects only. Indicates that the object has been
+ // partially scanned by the incremental mark-sweep GC. Objects that have
+ // been partially scanned are marked black so that the write barrier
+ // triggers for them, and they are counted as live bytes. If the mutator
+ // writes to them they may be turned grey and subtracted from the live byte
+ // list. They move back to the marking deque either by an iteration over
+ // the large object space or in the write barrier.
+ IS_PARTIALLY_SCANNED,
+
// Last flag, keep at bottom.
NUM_MEMORY_CHUNK_FLAGS
};
@@ -413,7 +422,26 @@
(1 << IN_FROM_SPACE) |
(1 << IN_TO_SPACE);
+ static const int kIsPartiallyScannedMask = 1 << IS_PARTIALLY_SCANNED;
+ void SetPartiallyScannedProgress(int progress) {
+ SetFlag(IS_PARTIALLY_SCANNED);
+ partially_scanned_progress_ = progress;
+ }
+
+ bool IsPartiallyScanned() {
+ return IsFlagSet(IS_PARTIALLY_SCANNED);
+ }
+
+ void SetCompletelyScanned() {
+ ClearFlag(IS_PARTIALLY_SCANNED);
+ }
+
+ int PartiallyScannedProgress() {
+ ASSERT(IsPartiallyScanned());
+ return partially_scanned_progress_;
+ }
+
void SetFlag(int flag) {
flags_ |= static_cast<uintptr_t>(1) << flag;
}
@@ -488,9 +516,11 @@
static const size_t kSlotsBufferOffset = kLiveBytesOffset + kIntSize;
- static const size_t kHeaderSize =
- kSlotsBufferOffset + kPointerSize + kPointerSize;
+ static const size_t kPartiallyScannedProgress =
+ kSlotsBufferOffset + kPointerSize + kPointerSize;
+ static const size_t kHeaderSize = kPartiallyScannedProgress + kIntSize;
+
static const int kBodyOffset =
CODE_POINTER_ALIGN(MAP_POINTER_ALIGN(kHeaderSize + Bitmap::kSize));
@@ -625,6 +655,7 @@
int live_byte_count_;
SlotsBuffer* slots_buffer_;
SkipList* skip_list_;
+ int partially_scanned_progress_;
static MemoryChunk* Initialize(Heap* heap,
Address base,
« src/mark-compact.cc ('K') | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698