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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 Visit(arguments->at(i)); | 496 Visit(arguments->at(i)); |
497 } | 497 } |
498 Print(")"); | 498 Print(")"); |
499 } | 499 } |
500 | 500 |
501 | 501 |
502 void PrettyPrinter::PrintLiteral(Handle<Object> value, bool quote) { | 502 void PrettyPrinter::PrintLiteral(Handle<Object> value, bool quote) { |
503 Object* object = *value; | 503 Object* object = *value; |
504 if (object->IsString()) { | 504 if (object->IsString()) { |
505 String* string = String::cast(object); | 505 String* string = String::cast(object); |
| 506 StringShape shape(string); |
506 if (quote) Print("\""); | 507 if (quote) Print("\""); |
507 for (int i = 0; i < string->length(); i++) { | 508 for (int i = 0; i < string->length(shape); i++) { |
508 Print("%c", string->Get(i)); | 509 Print("%c", string->Get(shape, i)); |
509 } | 510 } |
510 if (quote) Print("\""); | 511 if (quote) Print("\""); |
511 } else if (object == Heap::null_value()) { | 512 } else if (object == Heap::null_value()) { |
512 Print("null"); | 513 Print("null"); |
513 } else if (object == Heap::true_value()) { | 514 } else if (object == Heap::true_value()) { |
514 Print("true"); | 515 Print("true"); |
515 } else if (object == Heap::false_value()) { | 516 } else if (object == Heap::false_value()) { |
516 Print("false"); | 517 Print("false"); |
517 } else if (object == Heap::undefined_value()) { | 518 } else if (object == Heap::undefined_value()) { |
518 Print("undefined"); | 519 Print("undefined"); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 | 1066 |
1066 void AstPrinter::VisitThisFunction(ThisFunction* node) { | 1067 void AstPrinter::VisitThisFunction(ThisFunction* node) { |
1067 IndentedScope indent("THIS-FUNCTION"); | 1068 IndentedScope indent("THIS-FUNCTION"); |
1068 } | 1069 } |
1069 | 1070 |
1070 | 1071 |
1071 | 1072 |
1072 #endif // DEBUG | 1073 #endif // DEBUG |
1073 | 1074 |
1074 } } // namespace v8::internal | 1075 } } // namespace v8::internal |
OLD | NEW |