Chromium Code Reviews| 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 if (IsConsString()) { | 485 if (IsConsString()) { |
| 486 ConsString::cast(this)->ConsStringVerify(); | 486 ConsString::cast(this)->ConsStringVerify(); |
| 487 } else if (IsSlicedString()) { | 487 } else if (IsSlicedString()) { |
| 488 SlicedString::cast(this)->SlicedStringVerify(); | 488 SlicedString::cast(this)->SlicedStringVerify(); |
| 489 } else if (IsSeqOneByteString()) { | 489 } else if (IsSeqOneByteString()) { |
| 490 SeqOneByteString::cast(this)->SeqOneByteStringVerify(); | 490 SeqOneByteString::cast(this)->SeqOneByteStringVerify(); |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 | 493 |
| 494 | 494 |
| 495 void SeqOneByteString::SeqOneByteStringVerify() { | 495 void SeqOneByteString::SeqOneByteStringVerify() { |
|
Yang
2013/03/13 17:14:50
We could remove this method entirely.
| |
| 496 #ifndef ENABLE_LATIN_1 | |
| 497 CHECK(String::IsAscii(GetChars(), length())); | |
| 498 #endif | |
| 499 } | 496 } |
| 500 | 497 |
| 501 | 498 |
| 502 void ConsString::ConsStringVerify() { | 499 void ConsString::ConsStringVerify() { |
| 503 CHECK(this->first()->IsString()); | 500 CHECK(this->first()->IsString()); |
| 504 CHECK(this->second() == GetHeap()->empty_string() || | 501 CHECK(this->second() == GetHeap()->empty_string() || |
| 505 this->second()->IsString()); | 502 this->second()->IsString()); |
| 506 CHECK(this->length() >= ConsString::kMinLength); | 503 CHECK(this->length() >= ConsString::kMinLength); |
| 507 if (this->IsFlat()) { | 504 if (this->IsFlat()) { |
| 508 // A flat cons can only be created by String::SlowTryFlatten. | 505 // A flat cons can only be created by String::SlowTryFlatten. |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 for (int i = 0; i < number_of_transitions(); ++i) { | 1065 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1069 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1066 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1070 } | 1067 } |
| 1071 return true; | 1068 return true; |
| 1072 } | 1069 } |
| 1073 | 1070 |
| 1074 | 1071 |
| 1075 #endif // DEBUG | 1072 #endif // DEBUG |
| 1076 | 1073 |
| 1077 } } // namespace v8::internal | 1074 } } // namespace v8::internal |
| OLD | NEW |