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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 SlicedString::cast(this)->SlicedStringVerify(); | 515 SlicedString::cast(this)->SlicedStringVerify(); |
516 } | 516 } |
517 } | 517 } |
518 | 518 |
519 | 519 |
520 void ConsString::ConsStringVerify() { | 520 void ConsString::ConsStringVerify() { |
521 CHECK(this->first()->IsString()); | 521 CHECK(this->first()->IsString()); |
522 CHECK(this->second() == GetHeap()->empty_string() || | 522 CHECK(this->second() == GetHeap()->empty_string() || |
523 this->second()->IsString()); | 523 this->second()->IsString()); |
524 CHECK(this->length() >= ConsString::kMinLength); | 524 CHECK(this->length() >= ConsString::kMinLength); |
| 525 CHECK(this->length() == this->first()->length() + this->second()->length()); |
525 if (this->IsFlat()) { | 526 if (this->IsFlat()) { |
526 // A flat cons can only be created by String::SlowTryFlatten. | 527 // A flat cons can only be created by String::SlowTryFlatten. |
527 // Afterwards, the first part may be externalized. | 528 // Afterwards, the first part may be externalized. |
528 CHECK(this->first()->IsSeqString() || this->first()->IsExternalString()); | 529 CHECK(this->first()->IsSeqString() || this->first()->IsExternalString()); |
529 } | 530 } |
530 } | 531 } |
531 | 532 |
532 | 533 |
533 void SlicedString::SlicedStringVerify() { | 534 void SlicedString::SlicedStringVerify() { |
534 CHECK(!this->parent()->IsConsString()); | 535 CHECK(!this->parent()->IsConsString()); |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 for (int i = 0; i < number_of_transitions(); ++i) { | 1181 for (int i = 0; i < number_of_transitions(); ++i) { |
1181 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1182 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1182 } | 1183 } |
1183 return true; | 1184 return true; |
1184 } | 1185 } |
1185 | 1186 |
1186 | 1187 |
1187 #endif // DEBUG | 1188 #endif // DEBUG |
1188 | 1189 |
1189 } } // namespace v8::internal | 1190 } } // namespace v8::internal |
OLD | NEW |