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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 if (src->length() == 0) return src; | 287 if (src->length() == 0) return src; |
288 return CopyFixedArrayWithMap(src, src->map()); | 288 return CopyFixedArrayWithMap(src, src->map()); |
289 } | 289 } |
290 | 290 |
291 | 291 |
292 AllocationResult Heap::CopyFixedDoubleArray(FixedDoubleArray* src) { | 292 AllocationResult Heap::CopyFixedDoubleArray(FixedDoubleArray* src) { |
293 if (src->length() == 0) return src; | 293 if (src->length() == 0) return src; |
294 return CopyFixedDoubleArrayWithMap(src, src->map()); | 294 return CopyFixedDoubleArrayWithMap(src, src->map()); |
295 } | 295 } |
296 | 296 |
| 297 AllocationResult Heap::AllocateFixedArray(int length, PretenureFlag pretenure) { |
| 298 return AllocateFixedArrayWithFiller(length, pretenure, undefined_value()); |
| 299 } |
297 | 300 |
298 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, | 301 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, |
299 AllocationAlignment alignment) { | 302 AllocationAlignment alignment) { |
300 DCHECK(AllowHandleAllocation::IsAllowed()); | 303 DCHECK(AllowHandleAllocation::IsAllowed()); |
301 DCHECK(AllowHeapAllocation::IsAllowed()); | 304 DCHECK(AllowHeapAllocation::IsAllowed()); |
302 DCHECK(gc_state_ == NOT_IN_GC); | 305 DCHECK(gc_state_ == NOT_IN_GC); |
303 #ifdef DEBUG | 306 #ifdef DEBUG |
304 if (FLAG_gc_interval >= 0 && !always_allocate() && | 307 if (FLAG_gc_interval >= 0 && !always_allocate() && |
305 Heap::allocation_timeout_-- <= 0) { | 308 Heap::allocation_timeout_-- <= 0) { |
306 return AllocationResult::Retry(space); | 309 return AllocationResult::Retry(space); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } | 808 } |
806 | 809 |
807 AlwaysAllocateScope::~AlwaysAllocateScope() { | 810 AlwaysAllocateScope::~AlwaysAllocateScope() { |
808 heap_->always_allocate_scope_count_.Decrement(1); | 811 heap_->always_allocate_scope_count_.Decrement(1); |
809 } | 812 } |
810 | 813 |
811 } // namespace internal | 814 } // namespace internal |
812 } // namespace v8 | 815 } // namespace v8 |
813 | 816 |
814 #endif // V8_HEAP_HEAP_INL_H_ | 817 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |