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

Unified Diff: src/objects-debug.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: Add test that calls gc() Created 6 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index bacf422dcddddd9f15abcfbaa795206860473ccd..b9e2b667a634f1c226ed23938b00dee2b45c4c05 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -170,6 +170,12 @@ void HeapObject::HeapObjectVerify() {
case JS_MAP_TYPE:
JSMap::cast(this)->JSMapVerify();
break;
+ case JS_SET_ITERATOR_TYPE:
+ JSSetIterator::cast(this)->JSSetIteratorVerify();
+ break;
+ case JS_MAP_ITERATOR_TYPE:
+ JSMapIterator::cast(this)->JSMapIteratorVerify();
+ break;
case JS_WEAK_MAP_TYPE:
JSWeakMap::cast(this)->JSWeakMapVerify();
break;
@@ -702,6 +708,7 @@ void JSSet::JSSetVerify() {
JSObjectVerify();
VerifyHeapPointer(table());
CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
+ // TODO(arv): Verify OrderedHashTable too.
}
@@ -710,6 +717,39 @@ void JSMap::JSMapVerify() {
JSObjectVerify();
VerifyHeapPointer(table());
CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
+ // TODO(arv): Verify OrderedHashTable too.
+}
+
+
+void JSSetIterator::JSSetIteratorVerify() {
+ CHECK(IsJSSetIterator());
+ JSObjectVerify();
+ VerifyHeapPointer(table());
+ CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
+ CHECK(index()->IsSmi());
+ CHECK(count()->IsSmi());
+ CHECK(kind()->IsSmi());
+ VerifyHeapPointer(next_iterator());
+ CHECK(next_iterator()->IsJSSetIterator() || next_iterator()->IsUndefined());
+ VerifyHeapPointer(table());
+ CHECK(previous_iterator()->IsJSSetIterator()
+ || previous_iterator()->IsUndefined());
+}
+
+
+void JSMapIterator::JSMapIteratorVerify() {
+ CHECK(IsJSMapIterator());
+ JSObjectVerify();
+ VerifyHeapPointer(table());
+ CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
+ CHECK(index()->IsSmi());
+ CHECK(count()->IsSmi());
+ CHECK(kind()->IsSmi());
+ VerifyHeapPointer(next_iterator());
+ CHECK(next_iterator()->IsJSMapIterator() || next_iterator()->IsUndefined());
+ VerifyHeapPointer(table());
+ CHECK(previous_iterator()->IsJSMapIterator()
+ || previous_iterator()->IsUndefined());
}
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698