OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef V8_HEAP_SPACES_INL_H_ | 5 #ifndef V8_HEAP_SPACES_INL_H_ |
6 #define V8_HEAP_SPACES_INL_H_ | 6 #define V8_HEAP_SPACES_INL_H_ |
7 | 7 |
8 #include "src/heap/incremental-marking.h" | 8 #include "src/heap/incremental-marking.h" |
9 #include "src/heap/spaces.h" | 9 #include "src/heap/spaces.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return to_space_.ContainsSlow(a); | 158 return to_space_.ContainsSlow(a); |
159 } | 159 } |
160 | 160 |
161 bool NewSpace::FromSpaceContainsSlow(Address a) { | 161 bool NewSpace::FromSpaceContainsSlow(Address a) { |
162 return from_space_.ContainsSlow(a); | 162 return from_space_.ContainsSlow(a); |
163 } | 163 } |
164 | 164 |
165 bool NewSpace::ToSpaceContains(Object* o) { return to_space_.Contains(o); } | 165 bool NewSpace::ToSpaceContains(Object* o) { return to_space_.Contains(o); } |
166 bool NewSpace::FromSpaceContains(Object* o) { return from_space_.Contains(o); } | 166 bool NewSpace::FromSpaceContains(Object* o) { return from_space_.Contains(o); } |
167 | 167 |
168 // -------------------------------------------------------------------------- | |
169 // AllocationResult | |
170 | |
171 AllocationSpace AllocationResult::RetrySpace() { | |
172 DCHECK(IsRetry()); | |
173 return static_cast<AllocationSpace>(Smi::cast(object_)->value()); | |
174 } | |
175 | |
176 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, | 168 Page* Page::Initialize(Heap* heap, MemoryChunk* chunk, Executability executable, |
177 SemiSpace* owner) { | 169 SemiSpace* owner) { |
178 DCHECK_EQ(executable, Executability::NOT_EXECUTABLE); | 170 DCHECK_EQ(executable, Executability::NOT_EXECUTABLE); |
179 bool in_to_space = (owner->id() != kFromSpace); | 171 bool in_to_space = (owner->id() != kFromSpace); |
180 chunk->SetFlag(in_to_space ? MemoryChunk::IN_TO_SPACE | 172 chunk->SetFlag(in_to_space ? MemoryChunk::IN_TO_SPACE |
181 : MemoryChunk::IN_FROM_SPACE); | 173 : MemoryChunk::IN_FROM_SPACE); |
182 DCHECK(!chunk->IsFlagSet(in_to_space ? MemoryChunk::IN_FROM_SPACE | 174 DCHECK(!chunk->IsFlagSet(in_to_space ? MemoryChunk::IN_FROM_SPACE |
183 : MemoryChunk::IN_TO_SPACE)); | 175 : MemoryChunk::IN_TO_SPACE)); |
184 Page* page = static_cast<Page*>(chunk); | 176 Page* page = static_cast<Page*>(chunk); |
185 heap->incremental_marking()->SetNewSpacePageFlags(page); | 177 heap->incremental_marking()->SetNewSpacePageFlags(page); |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 other->allocation_info_.Reset(nullptr, nullptr); | 627 other->allocation_info_.Reset(nullptr, nullptr); |
636 return true; | 628 return true; |
637 } | 629 } |
638 return false; | 630 return false; |
639 } | 631 } |
640 | 632 |
641 } // namespace internal | 633 } // namespace internal |
642 } // namespace v8 | 634 } // namespace v8 |
643 | 635 |
644 #endif // V8_HEAP_SPACES_INL_H_ | 636 #endif // V8_HEAP_SPACES_INL_H_ |
OLD | NEW |