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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 VerifyObjectField(kEndPositionOffset); | 545 VerifyObjectField(kEndPositionOffset); |
546 VerifyObjectField(kArgumentsOffset); | 546 VerifyObjectField(kArgumentsOffset); |
547 VerifyObjectField(kScriptOffset); | 547 VerifyObjectField(kScriptOffset); |
548 VerifyObjectField(kStackFramesOffset); | 548 VerifyObjectField(kStackFramesOffset); |
549 } | 549 } |
550 | 550 |
551 | 551 |
552 void String::StringVerify() { | 552 void String::StringVerify() { |
553 CHECK(IsString()); | 553 CHECK(IsString()); |
554 CHECK(length() >= 0 && length() <= Smi::kMaxValue); | 554 CHECK(length() >= 0 && length() <= Smi::kMaxValue); |
| 555 CHECK_IMPLIES(length() == 0, this == GetHeap()->empty_string()); |
555 if (IsInternalizedString()) { | 556 if (IsInternalizedString()) { |
556 CHECK(!GetHeap()->InNewSpace(this)); | 557 CHECK(!GetHeap()->InNewSpace(this)); |
557 } | 558 } |
558 if (IsConsString()) { | 559 if (IsConsString()) { |
559 ConsString::cast(this)->ConsStringVerify(); | 560 ConsString::cast(this)->ConsStringVerify(); |
560 } else if (IsSlicedString()) { | 561 } else if (IsSlicedString()) { |
561 SlicedString::cast(this)->SlicedStringVerify(); | 562 SlicedString::cast(this)->SlicedStringVerify(); |
562 } else if (IsThinString()) { | 563 } else if (IsThinString()) { |
563 ThinString::cast(this)->ThinStringVerify(); | 564 ThinString::cast(this)->ThinStringVerify(); |
564 } | 565 } |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 | 1562 |
1562 // Both are done at the same time. | 1563 // Both are done at the same time. |
1563 CHECK_EQ(new_it.done(), old_it.done()); | 1564 CHECK_EQ(new_it.done(), old_it.done()); |
1564 } | 1565 } |
1565 | 1566 |
1566 | 1567 |
1567 #endif // DEBUG | 1568 #endif // DEBUG |
1568 | 1569 |
1569 } // namespace internal | 1570 } // namespace internal |
1570 } // namespace v8 | 1571 } // namespace v8 |
OLD | NEW |