| OLD | NEW |
| 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 Loading... |
| 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; | |
| 179 case JS_WEAK_MAP_TYPE: | 173 case JS_WEAK_MAP_TYPE: |
| 180 JSWeakMap::cast(this)->JSWeakMapVerify(); | 174 JSWeakMap::cast(this)->JSWeakMapVerify(); |
| 181 break; | 175 break; |
| 182 case JS_WEAK_SET_TYPE: | 176 case JS_WEAK_SET_TYPE: |
| 183 JSWeakSet::cast(this)->JSWeakSetVerify(); | 177 JSWeakSet::cast(this)->JSWeakSetVerify(); |
| 184 break; | 178 break; |
| 185 case JS_REGEXP_TYPE: | 179 case JS_REGEXP_TYPE: |
| 186 JSRegExp::cast(this)->JSRegExpVerify(); | 180 JSRegExp::cast(this)->JSRegExpVerify(); |
| 187 break; | 181 break; |
| 188 case FILLER_TYPE: | 182 case FILLER_TYPE: |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 elements()->IsFixedDoubleArray()); | 704 elements()->IsFixedDoubleArray()); |
| 711 } | 705 } |
| 712 } | 706 } |
| 713 | 707 |
| 714 | 708 |
| 715 void JSSet::JSSetVerify() { | 709 void JSSet::JSSetVerify() { |
| 716 CHECK(IsJSSet()); | 710 CHECK(IsJSSet()); |
| 717 JSObjectVerify(); | 711 JSObjectVerify(); |
| 718 VerifyHeapPointer(table()); | 712 VerifyHeapPointer(table()); |
| 719 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); | 713 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); |
| 720 // TODO(arv): Verify OrderedHashTable too. | |
| 721 } | 714 } |
| 722 | 715 |
| 723 | 716 |
| 724 void JSMap::JSMapVerify() { | 717 void JSMap::JSMapVerify() { |
| 725 CHECK(IsJSMap()); | 718 CHECK(IsJSMap()); |
| 726 JSObjectVerify(); | 719 JSObjectVerify(); |
| 727 VerifyHeapPointer(table()); | 720 VerifyHeapPointer(table()); |
| 728 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); | 721 CHECK(table()->IsOrderedHashTable() || table()->IsUndefined()); |
| 729 // TODO(arv): Verify OrderedHashTable too. | |
| 730 } | 722 } |
| 731 | 723 |
| 732 | 724 |
| 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 | |
| 765 void JSWeakMap::JSWeakMapVerify() { | 725 void JSWeakMap::JSWeakMapVerify() { |
| 766 CHECK(IsJSWeakMap()); | 726 CHECK(IsJSWeakMap()); |
| 767 JSObjectVerify(); | 727 JSObjectVerify(); |
| 768 VerifyHeapPointer(table()); | 728 VerifyHeapPointer(table()); |
| 769 CHECK(table()->IsHashTable() || table()->IsUndefined()); | 729 CHECK(table()->IsHashTable() || table()->IsUndefined()); |
| 770 } | 730 } |
| 771 | 731 |
| 772 | 732 |
| 773 void JSWeakSet::JSWeakSetVerify() { | 733 void JSWeakSet::JSWeakSetVerify() { |
| 774 CHECK(IsJSWeakSet()); | 734 CHECK(IsJSWeakSet()); |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 for (int i = 0; i < number_of_transitions(); ++i) { | 1192 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1233 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1193 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1234 } | 1194 } |
| 1235 return true; | 1195 return true; |
| 1236 } | 1196 } |
| 1237 | 1197 |
| 1238 | 1198 |
| 1239 #endif // DEBUG | 1199 #endif // DEBUG |
| 1240 | 1200 |
| 1241 } } // namespace v8::internal | 1201 } } // namespace v8::internal |
| OLD | NEW |