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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 DCHECK(large_object); | 358 DCHECK(large_object); |
359 allocation = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE); | 359 allocation = lo_space_->AllocateRaw(size_in_bytes, NOT_EXECUTABLE); |
360 } else if (MAP_SPACE == space) { | 360 } else if (MAP_SPACE == space) { |
361 allocation = map_space_->AllocateRawUnaligned(size_in_bytes); | 361 allocation = map_space_->AllocateRawUnaligned(size_in_bytes); |
362 } else { | 362 } else { |
363 // NEW_SPACE is not allowed here. | 363 // NEW_SPACE is not allowed here. |
364 UNREACHABLE(); | 364 UNREACHABLE(); |
365 } | 365 } |
366 if (allocation.To(&object)) { | 366 if (allocation.To(&object)) { |
367 OnAllocationEvent(object, size_in_bytes); | 367 OnAllocationEvent(object, size_in_bytes); |
368 } else { | |
369 old_gen_exhausted_ = true; | |
370 } | 368 } |
371 | 369 |
372 return allocation; | 370 return allocation; |
373 } | 371 } |
374 | 372 |
375 | 373 |
376 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { | 374 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { |
377 HeapProfiler* profiler = isolate_->heap_profiler(); | 375 HeapProfiler* profiler = isolate_->heap_profiler(); |
378 if (profiler->is_tracking_allocations()) { | 376 if (profiler->is_tracking_allocations()) { |
379 profiler->AllocationEvent(object->address(), size_in_bytes); | 377 profiler->AllocationEvent(object->address(), size_in_bytes); |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 | 879 |
882 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 880 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
883 for (Object** current = start; current < end; current++) { | 881 for (Object** current = start; current < end; current++) { |
884 CHECK((*current)->IsSmi()); | 882 CHECK((*current)->IsSmi()); |
885 } | 883 } |
886 } | 884 } |
887 } // namespace internal | 885 } // namespace internal |
888 } // namespace v8 | 886 } // namespace v8 |
889 | 887 |
890 #endif // V8_HEAP_HEAP_INL_H_ | 888 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |