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

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

Issue 1964143004: Fix live bytes counter in large object space after right trimming. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/spaces.h » ('j') | no next file with comments »
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 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 // pages is set after sweeping all pages. 3071 // pages is set after sweeping all pages.
3072 return !InOldSpace(object) || page->SweepingDone(); 3072 return !InOldSpace(object) || page->SweepingDone();
3073 } 3073 }
3074 3074
3075 3075
3076 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { 3076 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) {
3077 // As long as the inspected object is black and we are currently not iterating 3077 // As long as the inspected object is black and we are currently not iterating
3078 // the heap using HeapIterator, we can update the live byte count. We cannot 3078 // the heap using HeapIterator, we can update the live byte count. We cannot
3079 // update while using HeapIterator because the iterator is temporarily 3079 // update while using HeapIterator because the iterator is temporarily
3080 // marking the whole object graph, without updating live bytes. 3080 // marking the whole object graph, without updating live bytes.
3081 if (!in_heap_iterator() && 3081 if (lo_space()->Contains(object)) {
3082 !mark_compact_collector()->sweeping_in_progress() && 3082 lo_space()->AdjustLiveBytes(by);
3083 Marking::IsBlack(Marking::MarkBitFrom(object->address()))) { 3083 } else if (!in_heap_iterator() &&
3084 !mark_compact_collector()->sweeping_in_progress() &&
3085 Marking::IsBlack(Marking::MarkBitFrom(object->address()))) {
3084 if (mode == SEQUENTIAL_TO_SWEEPER) { 3086 if (mode == SEQUENTIAL_TO_SWEEPER) {
3085 MemoryChunk::IncrementLiveBytesFromGC(object, by); 3087 MemoryChunk::IncrementLiveBytesFromGC(object, by);
3086 } else { 3088 } else {
3087 MemoryChunk::IncrementLiveBytesFromMutator(object, by); 3089 MemoryChunk::IncrementLiveBytesFromMutator(object, by);
3088 } 3090 }
3089 } 3091 }
3090 } 3092 }
3091 3093
3092 3094
3093 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, 3095 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object,
(...skipping 3253 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 } 6349 }
6348 6350
6349 6351
6350 // static 6352 // static
6351 int Heap::GetStaticVisitorIdForMap(Map* map) { 6353 int Heap::GetStaticVisitorIdForMap(Map* map) {
6352 return StaticVisitorBase::GetVisitorId(map); 6354 return StaticVisitorBase::GetVisitorId(map);
6353 } 6355 }
6354 6356
6355 } // namespace internal 6357 } // namespace internal
6356 } // namespace v8 6358 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698