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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 break; 163 break;
164 case JS_ARRAY_TYPE: 164 case JS_ARRAY_TYPE:
165 JSArray::cast(this)->JSArrayVerify(); 165 JSArray::cast(this)->JSArrayVerify();
166 break; 166 break;
167 case JS_SET_TYPE: 167 case JS_SET_TYPE:
168 JSSet::cast(this)->JSSetVerify(); 168 JSSet::cast(this)->JSSetVerify();
169 break; 169 break;
170 case JS_MAP_TYPE: 170 case JS_MAP_TYPE:
171 JSMap::cast(this)->JSMapVerify(); 171 JSMap::cast(this)->JSMapVerify();
172 break; 172 break;
173 case JS_SET_ITERATOR_TYPE:
174 JSSetIterator::cast(this)->JSSetIteratorVerify();
175 break;
176 case JS_MAP_ITERATOR_TYPE:
177 JSMapIterator::cast(this)->JSMapIteratorVerify();
178 break;
173 case JS_WEAK_MAP_TYPE: 179 case JS_WEAK_MAP_TYPE:
174 JSWeakMap::cast(this)->JSWeakMapVerify(); 180 JSWeakMap::cast(this)->JSWeakMapVerify();
175 break; 181 break;
176 case JS_WEAK_SET_TYPE: 182 case JS_WEAK_SET_TYPE:
177 JSWeakSet::cast(this)->JSWeakSetVerify(); 183 JSWeakSet::cast(this)->JSWeakSetVerify();
178 break; 184 break;
179 case JS_REGEXP_TYPE: 185 case JS_REGEXP_TYPE:
180 JSRegExp::cast(this)->JSRegExpVerify(); 186 JSRegExp::cast(this)->JSRegExpVerify();
181 break; 187 break;
182 case FILLER_TYPE: 188 case FILLER_TYPE:
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 elements()->IsFixedDoubleArray()); 701 elements()->IsFixedDoubleArray());
696 } 702 }
697 } 703 }
698 704
699 705
700 void JSSet::JSSetVerify() { 706 void JSSet::JSSetVerify() {
701 CHECK(IsJSSet()); 707 CHECK(IsJSSet());
702 JSObjectVerify(); 708 JSObjectVerify();
703 VerifyHeapPointer(table()); 709 VerifyHeapPointer(table());
704 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); 710 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
711 // TODO(arv): Verify OrderedHashTable too.
705 } 712 }
706 713
707 714
708 void JSMap::JSMapVerify() { 715 void JSMap::JSMapVerify() {
709 CHECK(IsJSMap()); 716 CHECK(IsJSMap());
710 JSObjectVerify(); 717 JSObjectVerify();
711 VerifyHeapPointer(table()); 718 VerifyHeapPointer(table());
712 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); 719 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
720 // TODO(arv): Verify OrderedHashTable too.
713 } 721 }
714 722
715 723
724 void JSSetIterator::JSSetIteratorVerify() {
725 CHECK(IsJSSetIterator());
726 JSObjectVerify();
727 VerifyHeapPointer(table());
728 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
729 CHECK(index()->IsSmi());
730 CHECK(count()->IsSmi());
731 CHECK(kind()->IsSmi());
732 VerifyHeapPointer(next_iterator());
733 CHECK(next_iterator()->IsJSSetIterator() || next_iterator()->IsUndefined());
734 VerifyHeapPointer(table());
735 CHECK(previous_iterator()->IsJSSetIterator()
736 || previous_iterator()->IsUndefined());
737 }
738
739
740 void JSMapIterator::JSMapIteratorVerify() {
741 CHECK(IsJSMapIterator());
742 JSObjectVerify();
743 VerifyHeapPointer(table());
744 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
745 CHECK(index()->IsSmi());
746 CHECK(count()->IsSmi());
747 CHECK(kind()->IsSmi());
748 VerifyHeapPointer(next_iterator());
749 CHECK(next_iterator()->IsJSMapIterator() || next_iterator()->IsUndefined());
750 VerifyHeapPointer(table());
751 CHECK(previous_iterator()->IsJSMapIterator()
752 || previous_iterator()->IsUndefined());
753 }
754
755
716 void JSWeakMap::JSWeakMapVerify() { 756 void JSWeakMap::JSWeakMapVerify() {
717 CHECK(IsJSWeakMap()); 757 CHECK(IsJSWeakMap());
718 JSObjectVerify(); 758 JSObjectVerify();
719 VerifyHeapPointer(table()); 759 VerifyHeapPointer(table());
720 CHECK(table()->IsHashTable() || table()->IsUndefined()); 760 CHECK(table()->IsHashTable() || table()->IsUndefined());
721 } 761 }
722 762
723 763
724 void JSWeakSet::JSWeakSetVerify() { 764 void JSWeakSet::JSWeakSetVerify() {
725 CHECK(IsJSWeakSet()); 765 CHECK(IsJSWeakSet());
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 for (int i = 0; i < number_of_transitions(); ++i) { 1223 for (int i = 0; i < number_of_transitions(); ++i) {
1184 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1224 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1185 } 1225 }
1186 return true; 1226 return true;
1187 } 1227 }
1188 1228
1189 1229
1190 #endif // DEBUG 1230 #endif // DEBUG
1191 1231
1192 } } // namespace v8::internal 1232 } } // namespace v8::internal
OLDNEW
« 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