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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 } | 710 } |
711 | 711 |
712 void Heap::ExternalStringTable::IterateAll(ObjectVisitor* v) { | 712 void Heap::ExternalStringTable::IterateAll(ObjectVisitor* v) { |
713 IterateNewSpaceStrings(v); | 713 IterateNewSpaceStrings(v); |
714 if (!old_space_strings_.is_empty()) { | 714 if (!old_space_strings_.is_empty()) { |
715 Object** start = &old_space_strings_[0]; | 715 Object** start = &old_space_strings_[0]; |
716 v->VisitPointers(start, start + old_space_strings_.length()); | 716 v->VisitPointers(start, start + old_space_strings_.length()); |
717 } | 717 } |
718 } | 718 } |
719 | 719 |
720 | |
721 // Verify() is inline to avoid ifdef-s around its calls in release | 720 // Verify() is inline to avoid ifdef-s around its calls in release |
722 // mode. | 721 // mode. |
723 void Heap::ExternalStringTable::Verify() { | 722 void Heap::ExternalStringTable::Verify() { |
724 #ifdef DEBUG | 723 #ifdef DEBUG |
725 for (int i = 0; i < new_space_strings_.length(); ++i) { | 724 for (int i = 0; i < new_space_strings_.length(); ++i) { |
726 Object* obj = Object::cast(new_space_strings_[i]); | 725 Object* obj = Object::cast(new_space_strings_[i]); |
727 DCHECK(heap_->InNewSpace(obj)); | 726 DCHECK(heap_->InNewSpace(obj)); |
728 DCHECK(!obj->IsTheHole(heap_->isolate())); | 727 DCHECK(!obj->IsTheHole(heap_->isolate())); |
729 } | 728 } |
730 for (int i = 0; i < old_space_strings_.length(); ++i) { | 729 for (int i = 0; i < old_space_strings_.length(); ++i) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 | 852 |
854 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 853 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
855 for (Object** current = start; current < end; current++) { | 854 for (Object** current = start; current < end; current++) { |
856 CHECK((*current)->IsSmi()); | 855 CHECK((*current)->IsSmi()); |
857 } | 856 } |
858 } | 857 } |
859 } // namespace internal | 858 } // namespace internal |
860 } // namespace v8 | 859 } // namespace v8 |
861 | 860 |
862 #endif // V8_HEAP_HEAP_INL_H_ | 861 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |