OLD | NEW |
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 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3093 | 3093 |
3094 if (lo_space()->Contains(object)) return false; | 3094 if (lo_space()->Contains(object)) return false; |
3095 | 3095 |
3096 Page* page = Page::FromAddress(address); | 3096 Page* page = Page::FromAddress(address); |
3097 // We can move the object start if: | 3097 // We can move the object start if: |
3098 // (1) the object is not in old space, | 3098 // (1) the object is not in old space, |
3099 // (2) the page of the object was already swept, | 3099 // (2) the page of the object was already swept, |
3100 // (3) the page was already concurrently swept. This case is an optimization | 3100 // (3) the page was already concurrently swept. This case is an optimization |
3101 // for concurrent sweeping. The WasSwept predicate for concurrently swept | 3101 // for concurrent sweeping. The WasSwept predicate for concurrently swept |
3102 // pages is set after sweeping all pages. | 3102 // pages is set after sweeping all pages. |
3103 return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted(); | 3103 return !InOldSpace(address) || page->SweepingDone(); |
3104 } | 3104 } |
3105 | 3105 |
3106 | 3106 |
3107 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { | 3107 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { |
3108 // As long as the inspected object is black and we are currently not iterating | 3108 // As long as the inspected object is black and we are currently not iterating |
3109 // the heap using HeapIterator, we can update the live byte count. We cannot | 3109 // the heap using HeapIterator, we can update the live byte count. We cannot |
3110 // update while using HeapIterator because the iterator is temporarily | 3110 // update while using HeapIterator because the iterator is temporarily |
3111 // marking the whole object graph, without updating live bytes. | 3111 // marking the whole object graph, without updating live bytes. |
3112 if (!in_heap_iterator() && | 3112 if (!in_heap_iterator() && |
3113 !mark_compact_collector()->sweeping_in_progress() && | 3113 !mark_compact_collector()->sweeping_in_progress() && |
(...skipping 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6244 } | 6244 } |
6245 | 6245 |
6246 | 6246 |
6247 // static | 6247 // static |
6248 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6248 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6249 return StaticVisitorBase::GetVisitorId(map); | 6249 return StaticVisitorBase::GetVisitorId(map); |
6250 } | 6250 } |
6251 | 6251 |
6252 } // namespace internal | 6252 } // namespace internal |
6253 } // namespace v8 | 6253 } // namespace v8 |
OLD | NEW |