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 3083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3094 // (1) the object is not in old space, | 3094 // (1) the object is not in old space, |
3095 // (2) the page of the object was already swept, | 3095 // (2) the page of the object was already swept, |
3096 // (3) the page was already concurrently swept. This case is an optimization | 3096 // (3) the page was already concurrently swept. This case is an optimization |
3097 // for concurrent sweeping. The WasSwept predicate for concurrently swept | 3097 // for concurrent sweeping. The WasSwept predicate for concurrently swept |
3098 // pages is set after sweeping all pages. | 3098 // pages is set after sweeping all pages. |
3099 return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted(); | 3099 return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted(); |
3100 } | 3100 } |
3101 | 3101 |
3102 | 3102 |
3103 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { | 3103 void Heap::AdjustLiveBytes(HeapObject* object, int by, InvocationMode mode) { |
3104 if (incremental_marking()->IsMarking() && | 3104 if (Marking::IsBlack(Marking::MarkBitFrom(object->address()))) { |
3105 Marking::IsBlack(Marking::MarkBitFrom(object->address()))) { | |
3106 if (mode == SEQUENTIAL_TO_SWEEPER) { | 3105 if (mode == SEQUENTIAL_TO_SWEEPER) { |
3107 MemoryChunk::IncrementLiveBytesFromGC(object, by); | 3106 MemoryChunk::IncrementLiveBytesFromGC(object, by); |
3108 } else { | 3107 } else { |
3109 MemoryChunk::IncrementLiveBytesFromMutator(object, by); | 3108 MemoryChunk::IncrementLiveBytesFromMutator(object, by); |
3110 } | 3109 } |
3111 } | 3110 } |
3112 } | 3111 } |
3113 | 3112 |
3114 | 3113 |
3115 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, | 3114 FixedArrayBase* Heap::LeftTrimFixedArray(FixedArrayBase* object, |
(...skipping 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6221 } | 6220 } |
6222 | 6221 |
6223 | 6222 |
6224 // static | 6223 // static |
6225 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6224 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6226 return StaticVisitorBase::GetVisitorId(map); | 6225 return StaticVisitorBase::GetVisitorId(map); |
6227 } | 6226 } |
6228 | 6227 |
6229 } // namespace internal | 6228 } // namespace internal |
6230 } // namespace v8 | 6229 } // namespace v8 |
OLD | NEW |