| 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/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 3919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3930 | 3930 |
| 3931 | 3931 |
| 3932 AllocationResult Heap::AllocateRawFixedArray(int length, | 3932 AllocationResult Heap::AllocateRawFixedArray(int length, |
| 3933 PretenureFlag pretenure) { | 3933 PretenureFlag pretenure) { |
| 3934 if (length < 0 || length > FixedArray::kMaxLength) { | 3934 if (length < 0 || length > FixedArray::kMaxLength) { |
| 3935 v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); | 3935 v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); |
| 3936 } | 3936 } |
| 3937 int size = FixedArray::SizeFor(length); | 3937 int size = FixedArray::SizeFor(length); |
| 3938 AllocationSpace space = SelectSpace(pretenure); | 3938 AllocationSpace space = SelectSpace(pretenure); |
| 3939 | 3939 |
| 3940 return AllocateRaw(size, space); | 3940 AllocationResult result = AllocateRaw(size, space); |
| 3941 if (!result.IsRetry() && size > kMaxRegularHeapObjectSize && |
| 3942 FLAG_use_marking_progress_bar) { |
| 3943 MemoryChunk* chunk = |
| 3944 MemoryChunk::FromAddress(result.ToObjectChecked()->address()); |
| 3945 chunk->SetFlag(MemoryChunk::HAS_PROGRESS_BAR); |
| 3946 } |
| 3947 return result; |
| 3941 } | 3948 } |
| 3942 | 3949 |
| 3943 | 3950 |
| 3944 AllocationResult Heap::AllocateFixedArrayWithFiller(int length, | 3951 AllocationResult Heap::AllocateFixedArrayWithFiller(int length, |
| 3945 PretenureFlag pretenure, | 3952 PretenureFlag pretenure, |
| 3946 Object* filler) { | 3953 Object* filler) { |
| 3947 DCHECK(length >= 0); | 3954 DCHECK(length >= 0); |
| 3948 DCHECK(empty_fixed_array()->IsFixedArray()); | 3955 DCHECK(empty_fixed_array()->IsFixedArray()); |
| 3949 if (length == 0) return empty_fixed_array(); | 3956 if (length == 0) return empty_fixed_array(); |
| 3950 | 3957 |
| (...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6521 } | 6528 } |
| 6522 | 6529 |
| 6523 | 6530 |
| 6524 // static | 6531 // static |
| 6525 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6532 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6526 return StaticVisitorBase::GetVisitorId(map); | 6533 return StaticVisitorBase::GetVisitorId(map); |
| 6527 } | 6534 } |
| 6528 | 6535 |
| 6529 } // namespace internal | 6536 } // namespace internal |
| 6530 } // namespace v8 | 6537 } // namespace v8 |
| OLD | NEW |