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

Side by Side Diff: src/heap/heap.cc

Issue 1576853002: [heap] Adjust condition for AdjustLiveBytes to avoid concurrent access w/ sweeper (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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/mark-compact.cc » ('j') | src/heap/mark-compact.cc » ('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 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after
3101 return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted(); 3101 return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted();
3102 } 3102 }
3103 3103
3104 3104
3105 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { 3105 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) {
3106 // As long as the inspected object is black and we are currently not iterating 3106 // As long as the inspected object is black and we are currently not iterating
3107 // the heap using HeapIterator, we can update the live byte count. We cannot 3107 // the heap using HeapIterator, we can update the live byte count. We cannot
3108 // update while using HeapIterator because the iterator is temporarily 3108 // update while using HeapIterator because the iterator is temporarily
3109 // marking the whole object graph, without updating live bytes. 3109 // marking the whole object graph, without updating live bytes.
3110 if (!in_heap_iterator() && 3110 if (!in_heap_iterator() &&
3111 !mark_compact_collector()->sweeping_in_progress() &&
3111 Marking::IsBlack(Marking::MarkBitFrom(object->address()))) { 3112 Marking::IsBlack(Marking::MarkBitFrom(object->address()))) {
3112 if (mode == SEQUENTIAL_TO_SWEEPER) { 3113 if (mode == SEQUENTIAL_TO_SWEEPER) {
3113 MemoryChunk::IncrementLiveBytesFromGC(object, by); 3114 MemoryChunk::IncrementLiveBytesFromGC(object, by);
3114 } else { 3115 } else {
3115 MemoryChunk::IncrementLiveBytesFromMutator(object, by); 3116 MemoryChunk::IncrementLiveBytesFromMutator(object, by);
3116 } 3117 }
3117 } 3118 }
3118 } 3119 }
3119 3120
3120 3121
(...skipping 3113 matching lines...) Expand 10 before | Expand all | Expand 10 after
6234 } 6235 }
6235 6236
6236 6237
6237 // static 6238 // static
6238 int Heap::GetStaticVisitorIdForMap(Map* map) { 6239 int Heap::GetStaticVisitorIdForMap(Map* map) {
6239 return StaticVisitorBase::GetVisitorId(map); 6240 return StaticVisitorBase::GetVisitorId(map);
6240 } 6241 }
6241 6242
6242 } // namespace internal 6243 } // namespace internal
6243 } // namespace v8 6244 } // namespace v8
OLDNEW
« 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