Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1014)

Side by Side Diff: src/heap/heap-inl.h

Issue 2515643002: [heap] ExternalStringTable: Separate Iterate and CleanUp methods (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698