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