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

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

Issue 2200103002: Merged: [heap] Do not allow left trimming on new space pages that need to be swept. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.3
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | 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 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after
3115 bool Heap::CanMoveObjectStart(HeapObject* object) { 3115 bool Heap::CanMoveObjectStart(HeapObject* object) {
3116 if (!FLAG_move_object_start) return false; 3116 if (!FLAG_move_object_start) return false;
3117 3117
3118 // Sampling heap profiler may have a reference to the object. 3118 // Sampling heap profiler may have a reference to the object.
3119 if (isolate()->heap_profiler()->is_sampling_allocations()) return false; 3119 if (isolate()->heap_profiler()->is_sampling_allocations()) return false;
3120 3120
3121 Address address = object->address(); 3121 Address address = object->address();
3122 3122
3123 if (lo_space()->Contains(object)) return false; 3123 if (lo_space()->Contains(object)) return false;
3124 3124
3125 Page* page = Page::FromAddress(address); 3125 // We can move the object start if the page was already swept.
3126 // We can move the object start if: 3126 return Page::FromAddress(address)->SweepingDone();
3127 // (1) the object is not in old space,
3128 // (2) the page of the object was already swept,
3129 // (3) the page was already concurrently swept. This case is an optimization
3130 // for concurrent sweeping. The WasSwept predicate for concurrently swept
3131 // pages is set after sweeping all pages.
3132 return !InOldSpace(object) || page->SweepingDone();
3133 } 3127 }
3134 3128
3135 3129
3136 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { 3130 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) {
3137 // As long as the inspected object is black and we are currently not iterating 3131 // As long as the inspected object is black and we are currently not iterating
3138 // the heap using HeapIterator, we can update the live byte count. We cannot 3132 // the heap using HeapIterator, we can update the live byte count. We cannot
3139 // update while using HeapIterator because the iterator is temporarily 3133 // update while using HeapIterator because the iterator is temporarily
3140 // marking the whole object graph, without updating live bytes. 3134 // marking the whole object graph, without updating live bytes.
3141 if (lo_space()->Contains(object)) { 3135 if (lo_space()->Contains(object)) {
3142 lo_space()->AdjustLiveBytes(by); 3136 lo_space()->AdjustLiveBytes(by);
(...skipping 3238 matching lines...) Expand 10 before | Expand all | Expand 10 after
6381 } 6375 }
6382 6376
6383 6377
6384 // static 6378 // static
6385 int Heap::GetStaticVisitorIdForMap(Map* map) { 6379 int Heap::GetStaticVisitorIdForMap(Map* map) {
6386 return StaticVisitorBase::GetVisitorId(map); 6380 return StaticVisitorBase::GetVisitorId(map);
6387 } 6381 }
6388 6382
6389 } // namespace internal 6383 } // namespace internal
6390 } // namespace v8 6384 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698