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

Side by Side Diff: src/log.cc

Issue 159504: Introduce first approximation of constructor heap profile for JS objects. (Closed)
Patch Set: Soeren's comments applied Created 11 years, 4 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
« no previous file with comments | « src/log.h ('k') | src/spaces.h » ('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 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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 void Logger::HeapSampleItemEvent(const char* type, int number, int bytes) { 877 void Logger::HeapSampleItemEvent(const char* type, int number, int bytes) {
878 #ifdef ENABLE_LOGGING_AND_PROFILING 878 #ifdef ENABLE_LOGGING_AND_PROFILING
879 if (!Log::IsEnabled() || !FLAG_log_gc) return; 879 if (!Log::IsEnabled() || !FLAG_log_gc) return;
880 LogMessageBuilder msg; 880 LogMessageBuilder msg;
881 msg.Append("heap-sample-item,%s,%d,%d\n", type, number, bytes); 881 msg.Append("heap-sample-item,%s,%d,%d\n", type, number, bytes);
882 msg.WriteToLogFile(); 882 msg.WriteToLogFile();
883 #endif 883 #endif
884 } 884 }
885 885
886 886
887 void Logger::HeapSampleJSConstructorEvent(const char* constructor,
888 int number, int bytes) {
889 #ifdef ENABLE_LOGGING_AND_PROFILING
890 if (!Log::IsEnabled() || !FLAG_log_gc) return;
891 LogMessageBuilder msg;
892 msg.Append("heap-js-cons-item,%s,%d,%d\n",
893 constructor != NULL ?
894 (constructor[0] != '\0' ? constructor : "(anonymous)") :
895 "(no_constructor)",
896 number, bytes);
897 msg.WriteToLogFile();
898 #endif
899 }
900
901
887 void Logger::DebugTag(const char* call_site_tag) { 902 void Logger::DebugTag(const char* call_site_tag) {
888 #ifdef ENABLE_LOGGING_AND_PROFILING 903 #ifdef ENABLE_LOGGING_AND_PROFILING
889 if (!Log::IsEnabled() || !FLAG_log) return; 904 if (!Log::IsEnabled() || !FLAG_log) return;
890 LogMessageBuilder msg; 905 LogMessageBuilder msg;
891 msg.Append("debug-tag,%s\n", call_site_tag); 906 msg.Append("debug-tag,%s\n", call_site_tag);
892 msg.WriteToLogFile(); 907 msg.WriteToLogFile();
893 #endif 908 #endif
894 } 909 }
895 910
896 911
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 // Otherwise, if the sliding state window computation has not been 1225 // Otherwise, if the sliding state window computation has not been
1211 // started we do it now. 1226 // started we do it now.
1212 if (sliding_state_window_ == NULL) { 1227 if (sliding_state_window_ == NULL) {
1213 sliding_state_window_ = new SlidingStateWindow(); 1228 sliding_state_window_ = new SlidingStateWindow();
1214 } 1229 }
1215 #endif 1230 #endif
1216 } 1231 }
1217 1232
1218 1233
1219 } } // namespace v8::internal 1234 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.h ('k') | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698