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 | |
158 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, | 152 AllocationResult Heap::AllocateRaw(int size_in_bytes, AllocationSpace space, |
159 AllocationSpace retry_space) { | 153 AllocationSpace retry_space) { |
160 DCHECK(AllowHandleAllocation::IsAllowed()); | 154 DCHECK(AllowHandleAllocation::IsAllowed()); |
161 DCHECK(AllowHeapAllocation::IsAllowed()); | 155 DCHECK(AllowHeapAllocation::IsAllowed()); |
162 DCHECK(gc_state_ == NOT_IN_GC); | 156 DCHECK(gc_state_ == NOT_IN_GC); |
163 #ifdef DEBUG | 157 #ifdef DEBUG |
164 if (FLAG_gc_interval >= 0 && AllowAllocationFailure::IsAllowed(isolate_) && | 158 if (FLAG_gc_interval >= 0 && AllowAllocationFailure::IsAllowed(isolate_) && |
165 Heap::allocation_timeout_-- <= 0) { | 159 Heap::allocation_timeout_-- <= 0) { |
166 return AllocationResult::Retry(space); | 160 return AllocationResult::Retry(space); |
167 } | 161 } |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 | 681 |
688 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 682 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
689 for (Object** current = start; current < end; current++) { | 683 for (Object** current = start; current < end; current++) { |
690 CHECK((*current)->IsSmi()); | 684 CHECK((*current)->IsSmi()); |
691 } | 685 } |
692 } | 686 } |
693 } | 687 } |
694 } // namespace v8::internal | 688 } // namespace v8::internal |
695 | 689 |
696 #endif // V8_HEAP_HEAP_INL_H_ | 690 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |