| 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/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 } | 1164 } |
| 1165 } | 1165 } |
| 1166 } else if (space == LO_SPACE) { | 1166 } else if (space == LO_SPACE) { |
| 1167 // Just check that we can allocate during deserialization. | 1167 // Just check that we can allocate during deserialization. |
| 1168 DCHECK_EQ(1, reservation->length()); | 1168 DCHECK_EQ(1, reservation->length()); |
| 1169 perform_gc = !CanExpandOldGeneration(reservation->at(0).size); | 1169 perform_gc = !CanExpandOldGeneration(reservation->at(0).size); |
| 1170 } else { | 1170 } else { |
| 1171 for (auto& chunk : *reservation) { | 1171 for (auto& chunk : *reservation) { |
| 1172 AllocationResult allocation; | 1172 AllocationResult allocation; |
| 1173 int size = chunk.size; | 1173 int size = chunk.size; |
| 1174 DCHECK_LE(size, MemoryAllocator::PageAreaSize( | 1174 DCHECK_LE(static_cast<size_t>(size), |
| 1175 static_cast<AllocationSpace>(space))); | 1175 MemoryAllocator::PageAreaSize( |
| 1176 static_cast<AllocationSpace>(space))); |
| 1176 if (space == NEW_SPACE) { | 1177 if (space == NEW_SPACE) { |
| 1177 allocation = new_space()->AllocateRawUnaligned(size); | 1178 allocation = new_space()->AllocateRawUnaligned(size); |
| 1178 } else { | 1179 } else { |
| 1179 // The deserializer will update the skip list. | 1180 // The deserializer will update the skip list. |
| 1180 allocation = paged_space(space)->AllocateRawUnaligned( | 1181 allocation = paged_space(space)->AllocateRawUnaligned( |
| 1181 size, PagedSpace::IGNORE_SKIP_LIST); | 1182 size, PagedSpace::IGNORE_SKIP_LIST); |
| 1182 } | 1183 } |
| 1183 HeapObject* free_space = nullptr; | 1184 HeapObject* free_space = nullptr; |
| 1184 if (allocation.To(&free_space)) { | 1185 if (allocation.To(&free_space)) { |
| 1185 // Mark with a free list node, in case we have a GC before | 1186 // Mark with a free list node, in case we have a GC before |
| (...skipping 5317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6503 } | 6504 } |
| 6504 | 6505 |
| 6505 | 6506 |
| 6506 // static | 6507 // static |
| 6507 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6508 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6508 return StaticVisitorBase::GetVisitorId(map); | 6509 return StaticVisitorBase::GetVisitorId(map); |
| 6509 } | 6510 } |
| 6510 | 6511 |
| 6511 } // namespace internal | 6512 } // namespace internal |
| 6512 } // namespace v8 | 6513 } // namespace v8 |
| OLD | NEW |