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 } | |
300 | 297 |
301 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, | 298 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, |
302 AllocationAlignment alignment) { | 299 AllocationAlignment alignment) { |
303 DCHECK(AllowHandleAllocation::IsAllowed()); | 300 DCHECK(AllowHandleAllocation::IsAllowed()); |
304 DCHECK(AllowHeapAllocation::IsAllowed()); | 301 DCHECK(AllowHeapAllocation::IsAllowed()); |
305 DCHECK(gc_state_ == NOT_IN_GC); | 302 DCHECK(gc_state_ == NOT_IN_GC); |
306 #ifdef DEBUG | 303 #ifdef DEBUG |
307 if (FLAG_gc_interval >= 0 && !always_allocate() && | 304 if (FLAG_gc_interval >= 0 && !always_allocate() && |
308 Heap::allocation_timeout_-- <= 0) { | 305 Heap::allocation_timeout_-- <= 0) { |
309 return AllocationResult::Retry(space); | 306 return AllocationResult::Retry(space); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 805 } |
809 | 806 |
810 AlwaysAllocateScope::~AlwaysAllocateScope() { | 807 AlwaysAllocateScope::~AlwaysAllocateScope() { |
811 heap_->always_allocate_scope_count_.Decrement(1); | 808 heap_->always_allocate_scope_count_.Decrement(1); |
812 } | 809 } |
813 | 810 |
814 } // namespace internal | 811 } // namespace internal |
815 } // namespace v8 | 812 } // namespace v8 |
816 | 813 |
817 #endif // V8_HEAP_HEAP_INL_H_ | 814 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |