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

Side by Side Diff: src/log-utils.cc

Issue 6551011: Fix CPU profiling for Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 for (int i = 0; i < len; i++) { 293 for (int i = 0; i < len; i++) {
294 uc32 c = str->Get(i); 294 uc32 c = str->Get(i);
295 if (c > 0xff) { 295 if (c > 0xff) {
296 Append("\\u%04x", c); 296 Append("\\u%04x", c);
297 } else if (c < 32 || c > 126) { 297 } else if (c < 32 || c > 126) {
298 Append("\\x%02x", c); 298 Append("\\x%02x", c);
299 } else if (c == ',') { 299 } else if (c == ',') {
300 Append("\\,"); 300 Append("\\,");
301 } else if (c == '\\') { 301 } else if (c == '\\') {
302 Append("\\\\"); 302 Append("\\\\");
303 } else if (c == '\"') {
304 Append("\"\"");
303 } else { 305 } else {
304 Append("%lc", c); 306 Append("%lc", c);
305 } 307 }
306 } 308 }
307 } 309 }
308 310
309 311
310 void LogMessageBuilder::AppendStringPart(const char* str, int len) { 312 void LogMessageBuilder::AppendStringPart(const char* str, int len) {
311 if (pos_ + len > Log::kMessageBufferSize) { 313 if (pos_ + len > Log::kMessageBufferSize) {
312 len = Log::kMessageBufferSize - pos_; 314 len = Log::kMessageBufferSize - pos_;
(...skipping 12 matching lines...) Expand all
325 ASSERT(pos_ <= Log::kMessageBufferSize); 327 ASSERT(pos_ <= Log::kMessageBufferSize);
326 const int written = Log::Write(Log::message_buffer_, pos_); 328 const int written = Log::Write(Log::message_buffer_, pos_);
327 if (written != pos_ && write_failure_handler != NULL) { 329 if (written != pos_ && write_failure_handler != NULL) {
328 write_failure_handler(); 330 write_failure_handler();
329 } 331 }
330 } 332 }
331 333
332 #endif // ENABLE_LOGGING_AND_PROFILING 334 #endif // ENABLE_LOGGING_AND_PROFILING
333 335
334 } } // namespace v8::internal 336 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698