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

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: 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
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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 elements()->IsFixedArray() || 700 elements()->IsFixedArray() ||
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());
adamk 2014/04/14 19:15:42 Seems like it would be nice to add some validation
arv (Not doing code reviews) 2014/04/14 19:51:49 Done.
705 } 711 }
706 712
707 713
708 void JSMap::JSMapVerify() { 714 void JSMap::JSMapVerify() {
709 CHECK(IsJSMap()); 715 CHECK(IsJSMap());
710 JSObjectVerify(); 716 JSObjectVerify();
711 VerifyHeapPointer(table()); 717 VerifyHeapPointer(table());
712 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); 718 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
713 } 719 }
714 720
715 721
722 void JSSetIterator::JSSetIteratorVerify() {
723 CHECK(IsJSSetIterator());
724 JSObjectVerify();
725 VerifyHeapPointer(table());
726 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
727 CHECK(index()->IsSmi());
728 CHECK(count()->IsSmi());
729 CHECK(kind()->IsSmi());
730 VerifyHeapPointer(next_iterator());
731 CHECK(next_iterator()->IsJSSetIterator() || next_iterator()->IsUndefined());
732 VerifyHeapPointer(table());
733 CHECK(previous_iterator()->IsJSSetIterator()
734 || previous_iterator()->IsUndefined());
735 }
736
737
738 void JSMapIterator::JSMapIteratorVerify() {
739 CHECK(IsJSMapIterator());
740 JSObjectVerify();
741 VerifyHeapPointer(table());
742 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined());
743 CHECK(index()->IsSmi());
744 CHECK(count()->IsSmi());
745 CHECK(kind()->IsSmi());
746 VerifyHeapPointer(next_iterator());
747 CHECK(next_iterator()->IsJSMapIterator() || next_iterator()->IsUndefined());
748 VerifyHeapPointer(table());
749 CHECK(previous_iterator()->IsJSMapIterator()
750 || previous_iterator()->IsUndefined());
751 }
752
753
716 void JSWeakMap::JSWeakMapVerify() { 754 void JSWeakMap::JSWeakMapVerify() {
717 CHECK(IsJSWeakMap()); 755 CHECK(IsJSWeakMap());
718 JSObjectVerify(); 756 JSObjectVerify();
719 VerifyHeapPointer(table()); 757 VerifyHeapPointer(table());
720 CHECK(table()->IsHashTable() || table()->IsUndefined()); 758 CHECK(table()->IsHashTable() || table()->IsUndefined());
721 } 759 }
722 760
723 761
724 void JSWeakSet::JSWeakSetVerify() { 762 void JSWeakSet::JSWeakSetVerify() {
725 CHECK(IsJSWeakSet()); 763 CHECK(IsJSWeakSet());
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 for (int i = 0; i < number_of_transitions(); ++i) { 1221 for (int i = 0; i < number_of_transitions(); ++i) {
1184 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1222 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1185 } 1223 }
1186 return true; 1224 return true;
1187 } 1225 }
1188 1226
1189 1227
1190 #endif // DEBUG 1228 #endif // DEBUG
1191 1229
1192 } } // namespace v8::internal 1230 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698