| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 allocation = map_space_->AllocateRawUnaligned(size_in_bytes); | 244 allocation = map_space_->AllocateRawUnaligned(size_in_bytes); |
| 245 } else { | 245 } else { |
| 246 // NEW_SPACE is not allowed here. | 246 // NEW_SPACE is not allowed here. |
| 247 UNREACHABLE(); | 247 UNREACHABLE(); |
| 248 } | 248 } |
| 249 if (allocation.To(&object)) { | 249 if (allocation.To(&object)) { |
| 250 OnAllocationEvent(object, size_in_bytes); | 250 OnAllocationEvent(object, size_in_bytes); |
| 251 } else { | 251 } else { |
| 252 old_gen_exhausted_ = true; | 252 old_gen_exhausted_ = true; |
| 253 } | 253 } |
| 254 |
| 255 if (!old_gen_exhausted_ && incremental_marking()->black_allocation() && |
| 256 space != OLD_SPACE) { |
| 257 Marking::MarkBlack(Marking::MarkBitFrom(object)); |
| 258 MemoryChunk::IncrementLiveBytesFromGC(object, size_in_bytes); |
| 259 } |
| 254 return allocation; | 260 return allocation; |
| 255 } | 261 } |
| 256 | 262 |
| 257 | 263 |
| 258 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { | 264 void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { |
| 259 HeapProfiler* profiler = isolate_->heap_profiler(); | 265 HeapProfiler* profiler = isolate_->heap_profiler(); |
| 260 if (profiler->is_tracking_allocations()) { | 266 if (profiler->is_tracking_allocations()) { |
| 261 profiler->AllocationEvent(object->address(), size_in_bytes); | 267 profiler->AllocationEvent(object->address(), size_in_bytes); |
| 262 } | 268 } |
| 263 | 269 |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 | 723 |
| 718 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 724 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 719 for (Object** current = start; current < end; current++) { | 725 for (Object** current = start; current < end; current++) { |
| 720 CHECK((*current)->IsSmi()); | 726 CHECK((*current)->IsSmi()); |
| 721 } | 727 } |
| 722 } | 728 } |
| 723 } // namespace internal | 729 } // namespace internal |
| 724 } // namespace v8 | 730 } // namespace v8 |
| 725 | 731 |
| 726 #endif // V8_HEAP_HEAP_INL_H_ | 732 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |