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

Unified Diff: src/objects.cc

Issue 203523009: Access old space marking bits from runtime only when incremental marking is in MARKING state. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « no previous file | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index cb8489f6d29f47dcb9ac75b6d985e9bd6a538da0..d4612e7de8abf572401714ce221922e441df137a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -1301,7 +1301,8 @@ bool String::MakeExternal(v8::String::ExternalStringResource* resource) {
// Fill the remainder of the string with dead wood.
int new_size = this->Size(); // Byte size of the external String object.
heap->CreateFillerObjectAt(this->address() + new_size, size - new_size);
- if (Marking::IsBlack(Marking::MarkBitFrom(this))) {
+ if (heap->incremental_marking()->IsMarking() &&
+ Marking::IsBlack(Marking::MarkBitFrom(this))) {
MemoryChunk::IncrementLiveBytesFromMutator(this->address(),
new_size - size);
}
@@ -1360,7 +1361,8 @@ bool String::MakeExternal(v8::String::ExternalAsciiStringResource* resource) {
// Fill the remainder of the string with dead wood.
int new_size = this->Size(); // Byte size of the external String object.
heap->CreateFillerObjectAt(this->address() + new_size, size - new_size);
- if (Marking::IsBlack(Marking::MarkBitFrom(this))) {
+ if (heap->incremental_marking()->IsMarking() &&
+ Marking::IsBlack(Marking::MarkBitFrom(this))) {
MemoryChunk::IncrementLiveBytesFromMutator(this->address(),
new_size - size);
}
@@ -2301,7 +2303,8 @@ static void RightTrimFixedArray(Heap* heap, FixedArray* elms, int to_trim) {
elms->set_length(len - to_trim);
// Maintain marking consistency for IncrementalMarking.
- if (Marking::IsBlack(Marking::MarkBitFrom(elms))) {
+ if (heap->incremental_marking()->IsMarking() &&
+ Marking::IsBlack(Marking::MarkBitFrom(elms))) {
Michael Starzinger 2014/03/19 09:30:35 As discussed offline: I am not sure distinguishing
Hannes Payer (out of office) 2014/03/19 11:27:51 Done.
if (trim_mode == FROM_GC) {
MemoryChunk::IncrementLiveBytesFromGC(elms->address(), -size_delta);
} else {
@@ -4643,9 +4646,11 @@ void JSObject::NormalizeProperties(Handle<JSObject> object,
int new_instance_size = new_map->instance_size();
int instance_size_delta = map->instance_size() - new_instance_size;
ASSERT(instance_size_delta >= 0);
- isolate->heap()->CreateFillerObjectAt(object->address() + new_instance_size,
- instance_size_delta);
- if (Marking::IsBlack(Marking::MarkBitFrom(*object))) {
+ Heap* heap = isolate->heap();
+ heap->CreateFillerObjectAt(object->address() + new_instance_size,
+ instance_size_delta);
+ if (heap->incremental_marking()->IsMarking() &&
+ Marking::IsBlack(Marking::MarkBitFrom(*object))) {
MemoryChunk::IncrementLiveBytesFromMutator(object->address(),
-instance_size_delta);
}
@@ -9217,7 +9222,8 @@ Handle<String> SeqString::Truncate(Handle<SeqString> string, int new_length) {
// that are a multiple of pointer size.
heap->CreateFillerObjectAt(start_of_string + new_size, delta);
}
- if (Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) {
+ if (heap->incremental_marking()->IsMarking() &&
+ Marking::IsBlack(Marking::MarkBitFrom(start_of_string))) {
MemoryChunk::IncrementLiveBytesFromMutator(start_of_string, -delta);
}
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698