| 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" |
| 11 #include "src/counters-inl.h" | 11 #include "src/counters-inl.h" |
| 12 #include "src/heap/heap.h" | 12 #include "src/heap/heap.h" |
| 13 #include "src/heap/incremental-marking-inl.h" | 13 #include "src/heap/incremental-marking-inl.h" |
| 14 #include "src/heap/mark-compact.h" | 14 #include "src/heap/mark-compact.h" |
| 15 #include "src/heap/object-stats.h" |
| 15 #include "src/heap/remembered-set.h" | 16 #include "src/heap/remembered-set.h" |
| 16 #include "src/heap/spaces-inl.h" | 17 #include "src/heap/spaces-inl.h" |
| 17 #include "src/heap/store-buffer.h" | 18 #include "src/heap/store-buffer.h" |
| 18 #include "src/isolate.h" | 19 #include "src/isolate.h" |
| 19 #include "src/list-inl.h" | 20 #include "src/list-inl.h" |
| 20 #include "src/log.h" | 21 #include "src/log.h" |
| 21 #include "src/msan.h" | 22 #include "src/msan.h" |
| 22 #include "src/objects-inl.h" | 23 #include "src/objects-inl.h" |
| 23 #include "src/type-feedback-vector-inl.h" | 24 #include "src/type-feedback-vector-inl.h" |
| 24 | 25 |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 int next_serial_number = next_template_serial_number()->value() + 1; | 803 int next_serial_number = next_template_serial_number()->value() + 1; |
| 803 set_next_template_serial_number(Smi::FromInt(next_serial_number)); | 804 set_next_template_serial_number(Smi::FromInt(next_serial_number)); |
| 804 return next_serial_number; | 805 return next_serial_number; |
| 805 } | 806 } |
| 806 | 807 |
| 807 void Heap::SetSerializedTemplates(FixedArray* templates) { | 808 void Heap::SetSerializedTemplates(FixedArray* templates) { |
| 808 DCHECK_EQ(empty_fixed_array(), serialized_templates()); | 809 DCHECK_EQ(empty_fixed_array(), serialized_templates()); |
| 809 set_serialized_templates(templates); | 810 set_serialized_templates(templates); |
| 810 } | 811 } |
| 811 | 812 |
| 813 void Heap::CreateObjectStats() { |
| 814 if (V8_LIKELY(FLAG_gc_stats == 0)) return; |
| 815 if (!live_object_stats_) { |
| 816 live_object_stats_ = new ObjectStats(this); |
| 817 } |
| 818 if (!dead_object_stats_) { |
| 819 dead_object_stats_ = new ObjectStats(this); |
| 820 } |
| 821 } |
| 822 |
| 812 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) | 823 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) |
| 813 : heap_(isolate->heap()) { | 824 : heap_(isolate->heap()) { |
| 814 heap_->always_allocate_scope_count_.Increment(1); | 825 heap_->always_allocate_scope_count_.Increment(1); |
| 815 } | 826 } |
| 816 | 827 |
| 817 | 828 |
| 818 AlwaysAllocateScope::~AlwaysAllocateScope() { | 829 AlwaysAllocateScope::~AlwaysAllocateScope() { |
| 819 heap_->always_allocate_scope_count_.Increment(-1); | 830 heap_->always_allocate_scope_count_.Increment(-1); |
| 820 } | 831 } |
| 821 | 832 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 833 | 844 |
| 834 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 845 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 835 for (Object** current = start; current < end; current++) { | 846 for (Object** current = start; current < end; current++) { |
| 836 CHECK((*current)->IsSmi()); | 847 CHECK((*current)->IsSmi()); |
| 837 } | 848 } |
| 838 } | 849 } |
| 839 } // namespace internal | 850 } // namespace internal |
| 840 } // namespace v8 | 851 } // namespace v8 |
| 841 | 852 |
| 842 #endif // V8_HEAP_HEAP_INL_H_ | 853 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |