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 #ifndef V8_HEAP_HEAP_INL_H_ | 5 #ifndef V8_HEAP_HEAP_INL_H_ |
6 #define V8_HEAP_HEAP_INL_H_ | 6 #define V8_HEAP_HEAP_INL_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "src/base/platform/platform.h" | 10 #include "src/base/platform/platform.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return CopyFixedArrayWithMap(src, src->map()); | 142 return CopyFixedArrayWithMap(src, src->map()); |
143 } | 143 } |
144 | 144 |
145 | 145 |
146 AllocationResult Heap::CopyFixedDoubleArray(FixedDoubleArray* src) { | 146 AllocationResult Heap::CopyFixedDoubleArray(FixedDoubleArray* src) { |
147 if (src->length() == 0) return src; | 147 if (src->length() == 0) return src; |
148 return CopyFixedDoubleArrayWithMap(src, src->map()); | 148 return CopyFixedDoubleArrayWithMap(src, src->map()); |
149 } | 149 } |
150 | 150 |
151 | 151 |
| 152 AllocationResult Heap::CopyConstantPoolArray(ConstantPoolArray* src) { |
| 153 if (src->length() == 0) return src; |
| 154 return CopyConstantPoolArrayWithMap(src, src->map()); |
| 155 } |
| 156 |
| 157 |
152 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, | 158 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, |
153 AllocationSpace retry_space, | 159 AllocationSpace retry_space, |
154 AllocationAlignment alignment) { | 160 AllocationAlignment alignment) { |
155 DCHECK(AllowHandleAllocation::IsAllowed()); | 161 DCHECK(AllowHandleAllocation::IsAllowed()); |
156 DCHECK(AllowHeapAllocation::IsAllowed()); | 162 DCHECK(AllowHeapAllocation::IsAllowed()); |
157 DCHECK(gc_state_ == NOT_IN_GC); | 163 DCHECK(gc_state_ == NOT_IN_GC); |
158 #ifdef DEBUG | 164 #ifdef DEBUG |
159 if (FLAG_gc_interval >= 0 && AllowAllocationFailure::IsAllowed(isolate_) && | 165 if (FLAG_gc_interval >= 0 && AllowAllocationFailure::IsAllowed(isolate_) && |
160 Heap::allocation_timeout_-- <= 0) { | 166 Heap::allocation_timeout_-- <= 0) { |
161 return AllocationResult::Retry(space); | 167 return AllocationResult::Retry(space); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 | 688 |
683 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 689 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
684 for (Object** current = start; current < end; current++) { | 690 for (Object** current = start; current < end; current++) { |
685 CHECK((*current)->IsSmi()); | 691 CHECK((*current)->IsSmi()); |
686 } | 692 } |
687 } | 693 } |
688 } | 694 } |
689 } // namespace v8::internal | 695 } // namespace v8::internal |
690 | 696 |
691 #endif // V8_HEAP_HEAP_INL_H_ | 697 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |