OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 | 600 |
601 void Name::NamePrint(OStream& os) { // NOLINT | 601 void Name::NamePrint(OStream& os) { // NOLINT |
602 if (IsString()) | 602 if (IsString()) |
603 String::cast(this)->StringPrint(os); | 603 String::cast(this)->StringPrint(os); |
604 else | 604 else |
605 os << Brief(this); | 605 os << Brief(this); |
606 } | 606 } |
607 | 607 |
608 | 608 |
609 // This method is only meant to be called from gdb for debugging purposes. | 609 // This method is only meant to be called from gdb for debugging purposes. |
610 // Since the string can also be in two-byte encoding, non-ASCII characters | 610 // Since the string can also be in two-byte encoding, non-Latin1 characters |
611 // will be ignored in the output. | 611 // will be ignored in the output. |
612 char* String::ToAsciiArray() { | 612 char* String::ToAsciiArray() { |
613 // Static so that subsequent calls frees previously allocated space. | 613 // Static so that subsequent calls frees previously allocated space. |
614 // This also means that previous results will be overwritten. | 614 // This also means that previous results will be overwritten. |
615 static char* buffer = NULL; | 615 static char* buffer = NULL; |
616 if (buffer != NULL) free(buffer); | 616 if (buffer != NULL) free(buffer); |
617 buffer = new char[length()+1]; | 617 buffer = new char[length()+1]; |
618 WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length()); | 618 WriteToFlat(this, reinterpret_cast<uint8_t*>(buffer), 0, length()); |
619 buffer[length()] = 0; | 619 buffer[length()] = 0; |
620 return buffer; | 620 return buffer; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 } | 1103 } |
1104 } | 1104 } |
1105 os << "\n"; | 1105 os << "\n"; |
1106 } | 1106 } |
1107 | 1107 |
1108 | 1108 |
1109 #endif // OBJECT_PRINT | 1109 #endif // OBJECT_PRINT |
1110 | 1110 |
1111 | 1111 |
1112 } } // namespace v8::internal | 1112 } } // namespace v8::internal |
OLD | NEW |