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 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { | 2484 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { |
2485 int size = WeakCell::kSize; | 2485 int size = WeakCell::kSize; |
2486 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); | 2486 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); |
2487 HeapObject* result = nullptr; | 2487 HeapObject* result = nullptr; |
2488 { | 2488 { |
2489 AllocationResult allocation = AllocateRaw(size, OLD_SPACE); | 2489 AllocationResult allocation = AllocateRaw(size, OLD_SPACE); |
2490 if (!allocation.To(&result)) return allocation; | 2490 if (!allocation.To(&result)) return allocation; |
2491 } | 2491 } |
2492 result->set_map_no_write_barrier(weak_cell_map()); | 2492 result->set_map_no_write_barrier(weak_cell_map()); |
2493 WeakCell::cast(result)->initialize(value); | 2493 WeakCell::cast(result)->initialize(value); |
2494 WeakCell::cast(result)->clear_next(this); | 2494 WeakCell::cast(result)->clear_next(the_hole_value()); |
2495 return result; | 2495 return result; |
2496 } | 2496 } |
2497 | 2497 |
2498 | 2498 |
2499 AllocationResult Heap::AllocateTransitionArray(int capacity) { | 2499 AllocationResult Heap::AllocateTransitionArray(int capacity) { |
2500 DCHECK(capacity > 0); | 2500 DCHECK(capacity > 0); |
2501 HeapObject* raw_array = nullptr; | 2501 HeapObject* raw_array = nullptr; |
2502 { | 2502 { |
2503 AllocationResult allocation = AllocateRawFixedArray(capacity, TENURED); | 2503 AllocationResult allocation = AllocateRawFixedArray(capacity, TENURED); |
2504 if (!allocation.To(&raw_array)) return allocation; | 2504 if (!allocation.To(&raw_array)) return allocation; |
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6120 } | 6120 } |
6121 | 6121 |
6122 | 6122 |
6123 // static | 6123 // static |
6124 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6124 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6125 return StaticVisitorBase::GetVisitorId(map); | 6125 return StaticVisitorBase::GetVisitorId(map); |
6126 } | 6126 } |
6127 | 6127 |
6128 } // namespace internal | 6128 } // namespace internal |
6129 } // namespace v8 | 6129 } // namespace v8 |
OLD | NEW |