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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 484 |
485 void JSValue::JSValueVerify() { | 485 void JSValue::JSValueVerify() { |
486 Object* v = value(); | 486 Object* v = value(); |
487 if (v->IsHeapObject()) { | 487 if (v->IsHeapObject()) { |
488 VerifyHeapPointer(v); | 488 VerifyHeapPointer(v); |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 | 492 |
493 void String::StringPrint() { | 493 void String::StringPrint() { |
494 StringShape shape(this); | 494 if (StringShape(this).IsSymbol()) { |
495 if (shape.IsSymbol()) { | |
496 PrintF("#"); | 495 PrintF("#"); |
497 } else if (shape.IsCons()) { | 496 } else if (StringShape(this).IsCons()) { |
498 PrintF("c\""); | 497 PrintF("c\""); |
499 } else { | 498 } else { |
500 PrintF("\""); | 499 PrintF("\""); |
501 } | 500 } |
502 | 501 |
503 for (int i = 0; i < length(); i++) { | 502 for (int i = 0; i < length(); i++) { |
504 PrintF("%c", Get(shape, i)); | 503 PrintF("%c", Get(i)); |
505 } | 504 } |
506 | 505 |
507 if (!shape.IsSymbol()) PrintF("\""); | 506 if (!StringShape(this).IsSymbol()) PrintF("\""); |
508 } | 507 } |
509 | 508 |
510 | 509 |
511 void String::StringVerify() { | 510 void String::StringVerify() { |
512 CHECK(IsString()); | 511 CHECK(IsString()); |
513 CHECK(length() >= 0 && length() <= Smi::kMaxValue); | 512 CHECK(length() >= 0 && length() <= Smi::kMaxValue); |
514 if (IsSymbol()) { | 513 if (IsSymbol()) { |
515 CHECK(!Heap::InNewSpace(this)); | 514 CHECK(!Heap::InNewSpace(this)); |
516 } | 515 } |
517 } | 516 } |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 } | 1085 } |
1087 current = hash; | 1086 current = hash; |
1088 } | 1087 } |
1089 return true; | 1088 return true; |
1090 } | 1089 } |
1091 | 1090 |
1092 | 1091 |
1093 #endif // DEBUG | 1092 #endif // DEBUG |
1094 | 1093 |
1095 } } // namespace v8::internal | 1094 } } // namespace v8::internal |
OLD | NEW |