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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 | 695 |
696 void Heap::ExternalStringTable::AddString(String* string) { | 696 void Heap::ExternalStringTable::AddString(String* string) { |
697 DCHECK(string->IsExternalString()); | 697 DCHECK(string->IsExternalString()); |
698 if (heap_->InNewSpace(string)) { | 698 if (heap_->InNewSpace(string)) { |
699 new_space_strings_.Add(string); | 699 new_space_strings_.Add(string); |
700 } else { | 700 } else { |
701 old_space_strings_.Add(string); | 701 old_space_strings_.Add(string); |
702 } | 702 } |
703 } | 703 } |
704 | 704 |
705 | 705 void Heap::ExternalStringTable::IterateNewSpaceStrings(ObjectVisitor* v) { |
706 void Heap::ExternalStringTable::Iterate(ObjectVisitor* v) { | |
707 if (!new_space_strings_.is_empty()) { | 706 if (!new_space_strings_.is_empty()) { |
708 Object** start = &new_space_strings_[0]; | 707 Object** start = &new_space_strings_[0]; |
709 v->VisitPointers(start, start + new_space_strings_.length()); | 708 v->VisitPointers(start, start + new_space_strings_.length()); |
710 } | 709 } |
| 710 } |
| 711 |
| 712 void Heap::ExternalStringTable::IterateAll(ObjectVisitor* v) { |
| 713 IterateNewSpaceStrings(v); |
711 if (!old_space_strings_.is_empty()) { | 714 if (!old_space_strings_.is_empty()) { |
712 Object** start = &old_space_strings_[0]; | 715 Object** start = &old_space_strings_[0]; |
713 v->VisitPointers(start, start + old_space_strings_.length()); | 716 v->VisitPointers(start, start + old_space_strings_.length()); |
714 } | 717 } |
715 } | 718 } |
716 | 719 |
717 | 720 |
718 // Verify() is inline to avoid ifdef-s around its calls in release | 721 // Verify() is inline to avoid ifdef-s around its calls in release |
719 // mode. | 722 // mode. |
720 void Heap::ExternalStringTable::Verify() { | 723 void Heap::ExternalStringTable::Verify() { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 | 853 |
851 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 854 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
852 for (Object** current = start; current < end; current++) { | 855 for (Object** current = start; current < end; current++) { |
853 CHECK((*current)->IsSmi()); | 856 CHECK((*current)->IsSmi()); |
854 } | 857 } |
855 } | 858 } |
856 } // namespace internal | 859 } // namespace internal |
857 } // namespace v8 | 860 } // namespace v8 |
858 | 861 |
859 #endif // V8_HEAP_HEAP_INL_H_ | 862 #endif // V8_HEAP_HEAP_INL_H_ |
OLD | NEW |