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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 845 } |
846 } | 846 } |
847 | 847 |
848 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) | 848 AlwaysAllocateScope::AlwaysAllocateScope(Isolate* isolate) |
849 : heap_(isolate->heap()) { | 849 : heap_(isolate->heap()) { |
850 heap_->always_allocate_scope_count_.Increment(1); | 850 heap_->always_allocate_scope_count_.Increment(1); |
851 } | 851 } |
852 | 852 |
853 | 853 |
854 AlwaysAllocateScope::~AlwaysAllocateScope() { | 854 AlwaysAllocateScope::~AlwaysAllocateScope() { |
855 heap_->always_allocate_scope_count_.Increment(-1); | 855 heap_->always_allocate_scope_count_.Decrement(1); |
856 } | 856 } |
857 | 857 |
858 | 858 |
859 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { | 859 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { |
860 for (Object** current = start; current < end; current++) { | 860 for (Object** current = start; current < end; current++) { |
861 if ((*current)->IsHeapObject()) { | 861 if ((*current)->IsHeapObject()) { |
862 HeapObject* object = HeapObject::cast(*current); | 862 HeapObject* object = HeapObject::cast(*current); |
863 CHECK(object->GetIsolate()->heap()->Contains(object)); | 863 CHECK(object->GetIsolate()->heap()->Contains(object)); |
864 CHECK(object->map()->IsMap()); | 864 CHECK(object->map()->IsMap()); |
865 } else { | 865 } else { |
866 CHECK((*current)->IsSmi()); | 866 CHECK((*current)->IsSmi()); |
867 } | 867 } |
868 } | 868 } |
869 } | 869 } |
870 | 870 |
871 | 871 |
872 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 872 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
873 for (Object** current = start; current < end; current++) { | 873 for (Object** current = start; current < end; current++) { |
874 CHECK((*current)->IsSmi()); | 874 CHECK((*current)->IsSmi()); |
875 } | 875 } |
876 } | 876 } |
877 } // namespace internal | 877 } // namespace internal |
878 } // namespace v8 | 878 } // namespace v8 |
879 | 879 |
880 #endif // V8_HEAP_HEAP_INL_H_ | 880 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |