OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
9 #include "src/disassembler.h" | 9 #include "src/disassembler.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 CHECK(IsJSWeakMap()); | 779 CHECK(IsJSWeakMap()); |
780 JSObjectVerify(); | 780 JSObjectVerify(); |
781 VerifyHeapPointer(table()); | 781 VerifyHeapPointer(table()); |
782 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate())); | 782 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate())); |
783 } | 783 } |
784 | 784 |
785 void JSStringIterator::JSStringIteratorVerify() { | 785 void JSStringIterator::JSStringIteratorVerify() { |
786 CHECK(IsJSStringIterator()); | 786 CHECK(IsJSStringIterator()); |
787 JSObjectVerify(); | 787 JSObjectVerify(); |
788 CHECK(string()->IsString()); | 788 CHECK(string()->IsString()); |
| 789 |
| 790 InstanceType instance_type = map()->instance_type(); |
| 791 |
| 792 static_assert(kStringRepresentationMask == 3, "2-bit string rep mask"); |
| 793 static_assert((kSeqStringTag & 1) == 0, "SeqString rep low bit is 0"); |
| 794 static_assert((kExternalStringTag & 1) == 0, "SlicedString rep low bit is 0"); |
| 795 CHECK_EQ(instance_type & 1, 0); |
| 796 |
789 CHECK_GE(index(), 0); | 797 CHECK_GE(index(), 0); |
790 CHECK_LE(index(), String::kMaxLength); | 798 CHECK_LE(index(), String::kMaxLength); |
791 } | 799 } |
792 | 800 |
793 void JSWeakSet::JSWeakSetVerify() { | 801 void JSWeakSet::JSWeakSetVerify() { |
794 CHECK(IsJSWeakSet()); | 802 CHECK(IsJSWeakSet()); |
795 JSObjectVerify(); | 803 JSObjectVerify(); |
796 VerifyHeapPointer(table()); | 804 VerifyHeapPointer(table()); |
797 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate())); | 805 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate())); |
798 } | 806 } |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1369 |
1362 // Both are done at the same time. | 1370 // Both are done at the same time. |
1363 CHECK_EQ(new_it.done(), old_it.done()); | 1371 CHECK_EQ(new_it.done(), old_it.done()); |
1364 } | 1372 } |
1365 | 1373 |
1366 | 1374 |
1367 #endif // DEBUG | 1375 #endif // DEBUG |
1368 | 1376 |
1369 } // namespace internal | 1377 } // namespace internal |
1370 } // namespace v8 | 1378 } // namespace v8 |
OLD | NEW |