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

Side by Side Diff: src/string-stream.cc

Issue 10693: Merged bleeding_edge -r 685:746 into regexp2000. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month 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
« no previous file with comments | « src/string-stream.h ('k') | src/stub-cache-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 break; 151 break;
152 } 152 }
153 case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': case 'X': { 153 case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': case 'X': {
154 int value = current.data_.u_int_; 154 int value = current.data_.u_int_;
155 EmbeddedVector<char, 24> formatted; 155 EmbeddedVector<char, 24> formatted;
156 int length = OS::SNPrintF(formatted, temp.start(), value); 156 int length = OS::SNPrintF(formatted, temp.start(), value);
157 Add(Vector<const char>(formatted.start(), length)); 157 Add(Vector<const char>(formatted.start(), length));
158 break; 158 break;
159 } 159 }
160 case 'f': case 'g': case 'G': case 'e': case 'E': {
161 double value = current.data_.u_double_;
162 EmbeddedVector<char, 28> formatted;
163 OS::SNPrintF(formatted, temp.start(), value);
164 Add(formatted.start());
165 break;
166 }
160 default: 167 default:
161 UNREACHABLE(); 168 UNREACHABLE();
162 break; 169 break;
163 } 170 }
164 } 171 }
165 172
166 // Verify that the buffer is 0-terminated 173 // Verify that the buffer is 0-terminated
167 ASSERT(buffer_[length_] == '\0'); 174 ASSERT(buffer_[length_] == '\0');
168 } 175 }
169 176
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 226
220 227
221 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1, 228 void StringStream::Add(const char* format, FmtElm arg0, FmtElm arg1,
222 FmtElm arg2) { 229 FmtElm arg2) {
223 const char argc = 3; 230 const char argc = 3;
224 FmtElm argv[argc] = { arg0, arg1, arg2 }; 231 FmtElm argv[argc] = { arg0, arg1, arg2 };
225 Add(CStrVector(format), Vector<FmtElm>(argv, argc)); 232 Add(CStrVector(format), Vector<FmtElm>(argv, argc));
226 } 233 }
227 234
228 235
229 SmartPointer<char> StringStream::ToCString() { 236 SmartPointer<const char> StringStream::ToCString() {
230 char* str = NewArray<char>(length_ + 1); 237 char* str = NewArray<char>(length_ + 1);
231 memcpy(str, buffer_, length_); 238 memcpy(str, buffer_, length_);
232 str[length_] = '\0'; 239 str[length_] = '\0';
233 return SmartPointer<char>(str); 240 return SmartPointer<const char>(str);
234 } 241 }
235 242
236 243
237 void StringStream::Log() { 244 void StringStream::Log() {
238 LOG(StringEvent("StackDump", buffer_)); 245 LOG(StringEvent("StackDump", buffer_));
239 } 246 }
240 247
241 248
242 void StringStream::OutputToStdOut() { 249 void StringStream::OutputToStdOut() {
243 // Dump the output to stdout, but make sure to break it up into 250 // Dump the output to stdout, but make sure to break it up into
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 unsigned new_bytes = *bytes * 2; 558 unsigned new_bytes = *bytes * 2;
552 if (new_bytes > size_) { 559 if (new_bytes > size_) {
553 new_bytes = size_; 560 new_bytes = size_;
554 } 561 }
555 *bytes = new_bytes; 562 *bytes = new_bytes;
556 return space_; 563 return space_;
557 } 564 }
558 565
559 566
560 } } // namespace v8::internal 567 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/string-stream.h ('k') | src/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698