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

Side by Side Diff: src/log.cc

Issue 18096: Experimental: merge from bleeding_edge. Merge up to and including... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 11 years, 11 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
« no previous file with comments | « src/log.h ('k') | src/macros.py » ('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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 ScopedLock sl(mutex_); 425 ScopedLock sl(mutex_);
426 426
427 fprintf(logfile_, "regexp-compile,"); 427 fprintf(logfile_, "regexp-compile,");
428 LogRegExpSource(regexp); 428 LogRegExpSource(regexp);
429 fprintf(logfile_, in_cache ? ",hit\n" : ",miss\n"); 429 fprintf(logfile_, in_cache ? ",hit\n" : ",miss\n");
430 #endif 430 #endif
431 } 431 }
432 432
433 433
434 void Logger::LogRuntime(Vector<const char> format, JSArray* args) { 434 void Logger::LogRuntime(Vector<const char> format, JSArray* args) {
435 #ifdef ENABLE_LOGGING_AND_PROFILING
435 ScopedLock sl(mutex_); 436 ScopedLock sl(mutex_);
436 HandleScope scope; 437 HandleScope scope;
437 for (int i = 0; i < format.length(); i++) { 438 for (int i = 0; i < format.length(); i++) {
438 char c = format[i]; 439 char c = format[i];
439 if (c == '%' && i <= format.length() - 2) { 440 if (c == '%' && i <= format.length() - 2) {
440 i++; 441 i++;
441 ASSERT('0' <= format[i] && format[i] <= '9'); 442 ASSERT('0' <= format[i] && format[i] <= '9');
442 Object* obj = args->GetElement(format[i] - '0'); 443 Object* obj = args->GetElement(format[i] - '0');
443 i++; 444 i++;
444 switch (format[i]) { 445 switch (format[i]) {
(...skipping 13 matching lines...) Expand all
458 fprintf(logfile_, "%i", Smi::cast(obj)->value()); 459 fprintf(logfile_, "%i", Smi::cast(obj)->value());
459 break; 460 break;
460 default: 461 default:
461 UNREACHABLE(); 462 UNREACHABLE();
462 } 463 }
463 } else { 464 } else {
464 fputc(c, logfile_); 465 fputc(c, logfile_);
465 } 466 }
466 } 467 }
467 fputc('\n', logfile_); 468 fputc('\n', logfile_);
469 #endif
468 } 470 }
469 471
470 472
471 void Logger::ApiIndexedSecurityCheck(uint32_t index) { 473 void Logger::ApiIndexedSecurityCheck(uint32_t index) {
472 #ifdef ENABLE_LOGGING_AND_PROFILING 474 #ifdef ENABLE_LOGGING_AND_PROFILING
473 if (logfile_ == NULL || !FLAG_log_api) return; 475 if (logfile_ == NULL || !FLAG_log_api) return;
474 ApiEvent("api,check-security,%u\n", index); 476 ApiEvent("api,check-security,%u\n", index);
475 #endif 477 #endif
476 } 478 }
477 479
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 if (FLAG_log_state_changes) { 917 if (FLAG_log_state_changes) {
916 LOG(StringEvent("Leaving", StateToString(state_))); 918 LOG(StringEvent("Leaving", StateToString(state_)));
917 if (previous_) { 919 if (previous_) {
918 LOG(StringEvent("To", StateToString(previous_->state_))); 920 LOG(StringEvent("To", StateToString(previous_->state_)));
919 } 921 }
920 } 922 }
921 } 923 }
922 #endif 924 #endif
923 925
924 } } // namespace v8::internal 926 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.h ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698