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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 213 } |
214 if (allocation.To(&object)) { | 214 if (allocation.To(&object)) { |
215 OnAllocationEvent(object, size_in_bytes); | 215 OnAllocationEvent(object, size_in_bytes); |
216 } else { | 216 } else { |
217 old_gen_exhausted_ = true; | 217 old_gen_exhausted_ = true; |
218 } | 218 } |
219 return allocation; | 219 return allocation; |
220 } | 220 } |
221 | 221 |
222 | 222 |
| 223 HeapObject* Heap::ForceAllocateLargeObject(int size_in_bytes, |
| 224 Executability executable) { |
| 225 AlwaysAllocateScope scope(isolate()); |
| 226 AllocationResult result = lo_space_->AllocateRaw(size_in_bytes, executable); |
| 227 return HeapObject::cast(result.ToObjectChecked()); |
| 228 } |
| 229 |
| 230 |
223 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { | 231 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { |
224 HeapProfiler* profiler = isolate_->heap_profiler(); | 232 HeapProfiler* profiler = isolate_->heap_profiler(); |
225 if (profiler->is_tracking_allocations()) { | 233 if (profiler->is_tracking_allocations()) { |
226 profiler->AllocationEvent(object->address(), size_in_bytes); | 234 profiler->AllocationEvent(object->address(), size_in_bytes); |
227 } | 235 } |
228 | 236 |
229 if (FLAG_verify_predictable) { | 237 if (FLAG_verify_predictable) { |
230 ++allocations_count_; | 238 ++allocations_count_; |
231 | 239 |
232 UpdateAllocationsHash(object); | 240 UpdateAllocationsHash(object); |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 | 773 |
766 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 774 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
767 for (Object** current = start; current < end; current++) { | 775 for (Object** current = start; current < end; current++) { |
768 CHECK((*current)->IsSmi()); | 776 CHECK((*current)->IsSmi()); |
769 } | 777 } |
770 } | 778 } |
771 } | 779 } |
772 } // namespace v8::internal | 780 } // namespace v8::internal |
773 | 781 |
774 #endif // V8_HEAP_HEAP_INL_H_ | 782 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |