Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 PrintF(out, "%c", Get(i)); | 553 PrintF(out, "%c", Get(i)); |
| 554 } | 554 } |
| 555 if (len != length()) { | 555 if (len != length()) { |
| 556 PrintF(out, "%s", truncated_epilogue); | 556 PrintF(out, "%s", truncated_epilogue); |
| 557 } | 557 } |
| 558 | 558 |
| 559 if (!StringShape(this).IsSymbol()) PrintF(out, "\""); | 559 if (!StringShape(this).IsSymbol()) PrintF(out, "\""); |
| 560 } | 560 } |
| 561 | 561 |
| 562 | 562 |
| 563 char* String::ToAsciiArray() { | |
| 564 static char* buffer = NULL; | |
|
Sven Panne
2011/07/29 09:31:46
Drive-by commment: This looks scary... The real pr
| |
| 565 if (buffer != NULL) | |
|
Rico
2011/07/29 09:18:07
{ } around if body unless moved to same line
| |
| 566 free(buffer); | |
| 567 buffer = new char[length()+1]; | |
| 568 WriteToFlat(this, buffer, 0, length()); | |
| 569 buffer[length()] = 0; | |
| 570 return buffer; | |
| 571 } | |
| 572 | |
| 573 | |
| 563 void JSProxy::JSProxyPrint(FILE* out) { | 574 void JSProxy::JSProxyPrint(FILE* out) { |
| 564 HeapObject::PrintHeader(out, "JSProxy"); | 575 HeapObject::PrintHeader(out, "JSProxy"); |
| 565 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); | 576 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); |
| 566 PrintF(out, " - handler = "); | 577 PrintF(out, " - handler = "); |
| 567 handler()->Print(out); | 578 handler()->Print(out); |
| 568 PrintF(out, "\n"); | 579 PrintF(out, "\n"); |
| 569 } | 580 } |
| 570 | 581 |
| 571 | 582 |
| 572 void JSFunction::JSFunctionPrint(FILE* out) { | 583 void JSFunction::JSFunctionPrint(FILE* out) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 desc.Print(out); | 857 desc.Print(out); |
| 847 } | 858 } |
| 848 PrintF(out, "\n"); | 859 PrintF(out, "\n"); |
| 849 } | 860 } |
| 850 | 861 |
| 851 | 862 |
| 852 #endif // OBJECT_PRINT | 863 #endif // OBJECT_PRINT |
| 853 | 864 |
| 854 | 865 |
| 855 } } // namespace v8::internal | 866 } } // namespace v8::internal |
| OLD | NEW |