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 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 : heap_(isolate->heap()) { | 751 : heap_(isolate->heap()) { |
752 heap_->always_allocate_scope_count_.Increment(1); | 752 heap_->always_allocate_scope_count_.Increment(1); |
753 } | 753 } |
754 | 754 |
755 | 755 |
756 AlwaysAllocateScope::~AlwaysAllocateScope() { | 756 AlwaysAllocateScope::~AlwaysAllocateScope() { |
757 heap_->always_allocate_scope_count_.Increment(-1); | 757 heap_->always_allocate_scope_count_.Increment(-1); |
758 } | 758 } |
759 | 759 |
760 | 760 |
761 GCCallbacksScope::GCCallbacksScope(Heap* heap) : heap_(heap) { | |
762 heap_->gc_callbacks_depth_++; | |
763 } | |
764 | |
765 | |
766 GCCallbacksScope::~GCCallbacksScope() { heap_->gc_callbacks_depth_--; } | |
767 | |
768 | |
769 bool GCCallbacksScope::CheckReenter() { | |
770 return heap_->gc_callbacks_depth_ == 1; | |
771 } | |
772 | |
773 | |
774 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { | 761 void VerifyPointersVisitor::VisitPointers(Object** start, Object** end) { |
775 for (Object** current = start; current < end; current++) { | 762 for (Object** current = start; current < end; current++) { |
776 if ((*current)->IsHeapObject()) { | 763 if ((*current)->IsHeapObject()) { |
777 HeapObject* object = HeapObject::cast(*current); | 764 HeapObject* object = HeapObject::cast(*current); |
778 CHECK(object->GetIsolate()->heap()->Contains(object)); | 765 CHECK(object->GetIsolate()->heap()->Contains(object)); |
779 CHECK(object->map()->IsMap()); | 766 CHECK(object->map()->IsMap()); |
780 } | 767 } |
781 } | 768 } |
782 } | 769 } |
783 | 770 |
784 | 771 |
785 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 772 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
786 for (Object** current = start; current < end; current++) { | 773 for (Object** current = start; current < end; current++) { |
787 CHECK((*current)->IsSmi()); | 774 CHECK((*current)->IsSmi()); |
788 } | 775 } |
789 } | 776 } |
790 } | 777 } |
791 } // namespace v8::internal | 778 } // namespace v8::internal |
792 | 779 |
793 #endif // V8_HEAP_HEAP_INL_H_ | 780 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |