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