OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 | 458 |
459 void JSValue::JSValueVerify() { | 459 void JSValue::JSValueVerify() { |
460 Object* v = value(); | 460 Object* v = value(); |
461 if (v->IsHeapObject()) { | 461 if (v->IsHeapObject()) { |
462 VerifyHeapPointer(v); | 462 VerifyHeapPointer(v); |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 | 466 |
467 void String::StringPrint() { | 467 void String::StringPrint() { |
468 if (IsSymbol()) { | 468 StringShape shape(this); |
| 469 if (shape.IsSymbol()) { |
469 PrintF("#"); | 470 PrintF("#"); |
470 } else if (IsConsString()) { | 471 } else if (shape.IsCons()) { |
471 PrintF("c\""); | 472 PrintF("c\""); |
472 } else { | 473 } else { |
473 PrintF("\""); | 474 PrintF("\""); |
474 } | 475 } |
475 | 476 |
476 for (int i = 0; i < length(); i++) { | 477 for (int i = 0; i < length(); i++) { |
477 PrintF("%c", Get(i)); | 478 PrintF("%c", Get(shape, i)); |
478 } | 479 } |
479 | 480 |
480 if (!IsSymbol()) PrintF("\""); | 481 if (!shape.IsSymbol()) PrintF("\""); |
481 } | 482 } |
482 | 483 |
483 | 484 |
484 void String::StringVerify() { | 485 void String::StringVerify() { |
485 CHECK(IsString()); | 486 CHECK(IsString()); |
486 CHECK(length() >= 0 && length() <= Smi::kMaxValue); | 487 CHECK(length() >= 0 && length() <= Smi::kMaxValue); |
487 if (IsSymbol()) { | 488 if (IsSymbol()) { |
488 CHECK(!Heap::InNewSpace(this)); | 489 CHECK(!Heap::InNewSpace(this)); |
489 } | 490 } |
490 } | 491 } |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 } | 1049 } |
1049 current = hash; | 1050 current = hash; |
1050 } | 1051 } |
1051 return true; | 1052 return true; |
1052 } | 1053 } |
1053 | 1054 |
1054 | 1055 |
1055 #endif // DEBUG | 1056 #endif // DEBUG |
1056 | 1057 |
1057 } } // namespace v8::internal | 1058 } } // namespace v8::internal |
OLD | NEW |