Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: src/objects-printer.cc

Issue 559913002: Rename ascii to one-byte where applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« src/jsregexp.cc ('K') | « src/objects-inl.h ('k') | src/regexp-macro-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698