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

Side by Side Diff: src/objects-debug.cc

Issue 240323003: ES6: Add support for Map/Set forEach (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Explicit instantiate the functions instead 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 elements()->IsFixedDoubleArray()); 710 elements()->IsFixedDoubleArray());
705 } 711 }
706 } 712 }
707 713
708 714
709 void JSSet::JSSetVerify() { 715 void JSSet::JSSetVerify() {
710 CHECK(IsJSSet()); 716 CHECK(IsJSSet());
711 JSObjectVerify(); 717 JSObjectVerify();
712 VerifyHeapPointer(table()); 718 VerifyHeapPointer(table());
713 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); 719 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
720 // TODO(arv): Verify OrderedHashTable too.
714 } 721 }
715 722
716 723
717 void JSMap::JSMapVerify() { 724 void JSMap::JSMapVerify() {
718 CHECK(IsJSMap()); 725 CHECK(IsJSMap());
719 JSObjectVerify(); 726 JSObjectVerify();
720 VerifyHeapPointer(table()); 727 VerifyHeapPointer(table());
721 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); 728 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
729 // TODO(arv): Verify OrderedHashTable too.
722 } 730 }
723 731
724 732
733 void JSSetIterator::JSSetIteratorVerify() {
734 CHECK(IsJSSetIterator());
735 JSObjectVerify();
736 VerifyHeapPointer(table());
737 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
738 CHECK(index()->IsSmi());
739 CHECK(count()->IsSmi());
740 CHECK(kind()->IsSmi());
741 VerifyHeapPointer(next_iterator());
742 CHECK(next_iterator()->IsJSSetIterator() || next_iterator()->IsUndefined());
743 VerifyHeapPointer(table());
744 CHECK(previous_iterator()->IsJSSetIterator()
745 || previous_iterator()->IsUndefined());
746 }
747
748
749 void JSMapIterator::JSMapIteratorVerify() {
750 CHECK(IsJSMapIterator());
751 JSObjectVerify();
752 VerifyHeapPointer(table());
753 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
754 CHECK(index()->IsSmi());
755 CHECK(count()->IsSmi());
756 CHECK(kind()->IsSmi());
757 VerifyHeapPointer(next_iterator());
758 CHECK(next_iterator()->IsJSMapIterator() || next_iterator()->IsUndefined());
759 VerifyHeapPointer(table());
760 CHECK(previous_iterator()->IsJSMapIterator()
761 || previous_iterator()->IsUndefined());
762 }
763
764
725 void JSWeakMap::JSWeakMapVerify() { 765 void JSWeakMap::JSWeakMapVerify() {
726 CHECK(IsJSWeakMap()); 766 CHECK(IsJSWeakMap());
727 JSObjectVerify(); 767 JSObjectVerify();
728 VerifyHeapPointer(table()); 768 VerifyHeapPointer(table());
729 CHECK(table()->IsHashTable() || table()->IsUndefined()); 769 CHECK(table()->IsHashTable() || table()->IsUndefined());
730 } 770 }
731 771
732 772
733 void JSWeakSet::JSWeakSetVerify() { 773 void JSWeakSet::JSWeakSetVerify() {
734 CHECK(IsJSWeakSet()); 774 CHECK(IsJSWeakSet());
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 for (int i = 0; i < number_of_transitions(); ++i) { 1232 for (int i = 0; i < number_of_transitions(); ++i) {
1193 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1233 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1194 } 1234 }
1195 return true; 1235 return true;
1196 } 1236 }
1197 1237
1198 1238
1199 #endif // DEBUG 1239 #endif // DEBUG
1200 1240
1201 } } // namespace v8::internal 1241 } } // 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