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

Side by Side Diff: src/log.cc

Issue 11411144: Also time other API functions calling into javascript. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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/log.h ('k') | src/log-utils.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 LogMessageBuilder msg(this); 699 LogMessageBuilder msg(this);
700 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n", 700 msg.Append("shared-library,\"%ls\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR "\n",
701 library_path, 701 library_path,
702 start, 702 start,
703 end); 703 end);
704 msg.WriteToLogFile(); 704 msg.WriteToLogFile();
705 } 705 }
706 706
707 707
708 void Logger::TimerEvent(const char* name, int64_t start, int64_t end) { 708 void Logger::TimerEvent(const char* name, int64_t start, int64_t end) {
709 if (!log_->IsEnabled()) return;
709 ASSERT(FLAG_log_timer_events); 710 ASSERT(FLAG_log_timer_events);
710 LogMessageBuilder msg(this); 711 LogMessageBuilder msg(this);
711 int since_epoch = static_cast<int>(start - epoch_); 712 int since_epoch = static_cast<int>(start - epoch_);
712 int pause_time = static_cast<int>(end - start); 713 int pause_time = static_cast<int>(end - start);
713 msg.Append("timer-event,\"%s\",%ld,%ld\n", name, since_epoch, pause_time); 714 msg.Append("timer-event,\"%s\",%ld,%ld\n", name, since_epoch, pause_time);
714 msg.WriteToLogFile(); 715 msg.WriteToLogFile();
715 } 716 }
716 717
717 718
719 void Logger::TimerEventScope::LogTimerEvent() {
720 Logger* logger = isolate_->logger();
721 if (logger->is_logging()) {
722 logger->TimerEvent(name_, start_, OS::Ticks());
723 }
724 }
725
726
718 const char* Logger::TimerEventScope::v8_recompile_synchronous = 727 const char* Logger::TimerEventScope::v8_recompile_synchronous =
719 "V8.RecompileSynchronous"; 728 "V8.RecompileSynchronous";
720 const char* Logger::TimerEventScope::v8_recompile_parallel = 729 const char* Logger::TimerEventScope::v8_recompile_parallel =
721 "V8.RecompileParallel"; 730 "V8.RecompileParallel";
722 const char* Logger::TimerEventScope::v8_compile_full_code = 731 const char* Logger::TimerEventScope::v8_compile_full_code =
723 "V8.CompileFullCode"; 732 "V8.CompileFullCode";
724 const char* Logger::TimerEventScope::v8_execute = "V8.Execute"; 733 const char* Logger::TimerEventScope::v8_execute = "V8.Execute";
725 734
726 735
727 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) { 736 void Logger::LogRegExpSource(Handle<JSRegExp> regexp) {
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { 1900 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) {
1892 ASSERT(sampler->IsActive()); 1901 ASSERT(sampler->IsActive());
1893 ScopedLock lock(active_samplers_mutex); 1902 ScopedLock lock(active_samplers_mutex);
1894 ASSERT(active_samplers_ != NULL); 1903 ASSERT(active_samplers_ != NULL);
1895 bool removed = active_samplers_->RemoveElement(sampler); 1904 bool removed = active_samplers_->RemoveElement(sampler);
1896 ASSERT(removed); 1905 ASSERT(removed);
1897 USE(removed); 1906 USE(removed);
1898 } 1907 }
1899 1908
1900 } } // namespace v8::internal 1909 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.h ('k') | src/log-utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698