Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 13c874a0499fd921d7e26d7c092af367c561f51e..b9e1a2b323a36664d1e53e84e7c7e899f2f9817e 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -1938,12 +1938,7 @@ void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer, |
void Heap::VisitExternalResources(v8::ExternalResourceVisitor* visitor) { |
DisallowHeapAllocation no_allocation; |
- |
- // Both the external string table and the string table may contain |
- // external strings, but neither lists them exhaustively, nor is the |
- // intersection set empty. Therefore we iterate over the external string |
- // table first, ignoring internalized strings, and then over the |
- // internalized string table. |
+ // All external strings are listed in the external string table. |
class ExternalStringTableVisitorAdapter : public ObjectVisitor { |
public: |
@@ -1951,13 +1946,9 @@ void Heap::VisitExternalResources(v8::ExternalResourceVisitor* visitor) { |
v8::ExternalResourceVisitor* visitor) : visitor_(visitor) {} |
virtual void VisitPointers(Object** start, Object** end) { |
for (Object** p = start; p < end; p++) { |
- // Visit non-internalized external strings, |
- // since internalized strings are listed in the string table. |
- if (!(*p)->IsInternalizedString()) { |
- ASSERT((*p)->IsExternalString()); |
- visitor_->VisitExternalString(Utils::ToLocal( |
- Handle<String>(String::cast(*p)))); |
- } |
+ ASSERT((*p)->IsExternalString()); |
+ visitor_->VisitExternalString(Utils::ToLocal( |
+ Handle<String>(String::cast(*p)))); |
} |
} |
private: |
@@ -1965,25 +1956,6 @@ void Heap::VisitExternalResources(v8::ExternalResourceVisitor* visitor) { |
} external_string_table_visitor(visitor); |
external_string_table_.Iterate(&external_string_table_visitor); |
- |
- class StringTableVisitorAdapter : public ObjectVisitor { |
- public: |
- explicit StringTableVisitorAdapter( |
- v8::ExternalResourceVisitor* visitor) : visitor_(visitor) {} |
- virtual void VisitPointers(Object** start, Object** end) { |
- for (Object** p = start; p < end; p++) { |
- if ((*p)->IsExternalString()) { |
- ASSERT((*p)->IsInternalizedString()); |
- visitor_->VisitExternalString(Utils::ToLocal( |
- Handle<String>(String::cast(*p)))); |
- } |
- } |
- } |
- private: |
- v8::ExternalResourceVisitor* visitor_; |
- } string_table_visitor(visitor); |
- |
- string_table()->IterateElements(&string_table_visitor); |
} |