Chromium Code Reviews

Unified Diff: src/objects-printer.cc

Issue 236143002: ES6: Add support for Map.prototype.forEach and Set.prototype.forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle-ify and UsedCapacity Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index a59b1e9ae8094a9c171192674ba0c48b27cd9b56..f137e1aaebfb33ddfd6333283e9b01e72802880b 100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -174,6 +174,12 @@ void HeapObject::HeapObjectPrint(FILE* out) {
case JS_MAP_TYPE:
JSMap::cast(this)->JSMapPrint(out);
break;
+ case JS_SET_ITERATOR_TYPE:
+ JSSetIterator::cast(this)->JSSetIteratorPrint(out);
+ break;
+ case JS_MAP_ITERATOR_TYPE:
+ JSMapIterator::cast(this)->JSMapIteratorPrint(out);
+ break;
case JS_WEAK_MAP_TYPE:
JSWeakMap::cast(this)->JSWeakMapPrint(out);
break;
@@ -759,6 +765,37 @@ void JSMap::JSMapPrint(FILE* out) {
}
+template<class Derived, class TableType>
+void OrderedHashTableIterator<Derived, TableType>::
+ OrderedHashTableIteratorPrint(FILE* out) {
+ PrintF(out, " - table = ");
+ table()->ShortPrint(out);
+ PrintF(out, " - index = ");
+ index()->ShortPrint(out);
+ PrintF(out, " - count = ");
+ count()->ShortPrint(out);
+ PrintF(out, " - kind = ");
+ kind()->ShortPrint(out);
+ PrintF(out, " - next_iterator = ");
+ next_iterator()->ShortPrint(out);
+ PrintF(out, " - previous_iterator = ");
+ previous_iterator()->ShortPrint(out);
+ PrintF(out, "\n");
+}
+
+
+void JSSetIterator::JSSetIteratorPrint(FILE* out) {
+ HeapObject::PrintHeader(out, "JSSetIterator");
+ OrderedHashTableIteratorPrint(out);
+}
+
+
+void JSMapIterator::JSMapIteratorPrint(FILE* out) {
+ HeapObject::PrintHeader(out, "JSMapIterator");
+ OrderedHashTableIteratorPrint(out);
+}
+
+
void JSWeakMap::JSWeakMapPrint(FILE* out) {
HeapObject::PrintHeader(out, "JSWeakMap");
PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine