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

Side by Side Diff: src/log.h

Issue 14139033: Clean up VMState a little bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed mistake Created 7 years, 8 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/isolate.cc ('k') | src/log.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 class Logger { 156 class Logger {
157 public: 157 public:
158 #define DECLARE_ENUM(enum_item, ignore) enum_item, 158 #define DECLARE_ENUM(enum_item, ignore) enum_item,
159 enum LogEventsAndTags { 159 enum LogEventsAndTags {
160 LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM) 160 LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM)
161 NUMBER_OF_LOG_EVENTS 161 NUMBER_OF_LOG_EVENTS
162 }; 162 };
163 #undef DECLARE_ENUM 163 #undef DECLARE_ENUM
164 164
165 // Acquires resources for logging if the right flags are set. 165 // Acquires resources for logging if the right flags are set.
166 bool SetUp(); 166 bool SetUp(Isolate* isolate);
167 167
168 // Sets the current code event handler. 168 // Sets the current code event handler.
169 void SetCodeEventHandler(uint32_t options, 169 void SetCodeEventHandler(uint32_t options,
170 JitCodeEventHandler event_handler); 170 JitCodeEventHandler event_handler);
171 171
172 Sampler* sampler(); 172 Sampler* sampler();
173 173
174 // Frees resources acquired in SetUp. 174 // Frees resources acquired in SetUp.
175 // When a temporary file is used for the log, returns its stream descriptor, 175 // When a temporary file is used for the log, returns its stream descriptor,
176 // leaving the file open. 176 // leaving the file open.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 uintptr_t end); 285 uintptr_t end);
286 void SharedLibraryEvent(const wchar_t* library_path, 286 void SharedLibraryEvent(const wchar_t* library_path,
287 uintptr_t start, 287 uintptr_t start,
288 uintptr_t end); 288 uintptr_t end);
289 289
290 // ==== Events logged by --log-timer-events. ==== 290 // ==== Events logged by --log-timer-events. ====
291 enum StartEnd { START, END }; 291 enum StartEnd { START, END };
292 292
293 void TimerEvent(StartEnd se, const char* name); 293 void TimerEvent(StartEnd se, const char* name);
294 294
295 static void EnterExternal(); 295 static void EnterExternal(Isolate* isolate);
296 static void LeaveExternal(); 296 static void LeaveExternal(Isolate* isolate);
297 297
298 class TimerEventScope { 298 class TimerEventScope {
299 public: 299 public:
300 TimerEventScope(Isolate* isolate, const char* name) 300 TimerEventScope(Isolate* isolate, const char* name)
301 : isolate_(isolate), name_(name) { 301 : isolate_(isolate), name_(name) {
302 if (FLAG_log_internal_timer_events) LogTimerEvent(START); 302 if (FLAG_log_internal_timer_events) LogTimerEvent(START);
303 } 303 }
304 304
305 ~TimerEventScope() { 305 ~TimerEventScope() {
306 if (FLAG_log_internal_timer_events) LogTimerEvent(END); 306 if (FLAG_log_internal_timer_events) LogTimerEvent(END);
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 // An array of log events names. 459 // An array of log events names.
460 const char* const* log_events_; 460 const char* const* log_events_;
461 461
462 // Internal implementation classes with access to 462 // Internal implementation classes with access to
463 // private members. 463 // private members.
464 friend class EventLog; 464 friend class EventLog;
465 friend class Isolate; 465 friend class Isolate;
466 friend class LogMessageBuilder; 466 friend class LogMessageBuilder;
467 friend class TimeLog; 467 friend class TimeLog;
468 friend class Profiler; 468 friend class Profiler;
469 friend class VMState; 469 template <StateTag Tag> friend class VMState;
470 470
471 friend class LoggerTestHelper; 471 friend class LoggerTestHelper;
472 472
473 473
474 int logging_nesting_; 474 int logging_nesting_;
475 int cpu_profiler_nesting_; 475 int cpu_profiler_nesting_;
476 476
477 Log* log_; 477 Log* log_;
478 478
479 NameBuffer* name_buffer_; 479 NameBuffer* name_buffer_;
(...skipping 21 matching lines...) Expand all
501 int64_t epoch_; 501 int64_t epoch_;
502 502
503 friend class CpuProfiler; 503 friend class CpuProfiler;
504 }; 504 };
505 505
506 506
507 } } // namespace v8::internal 507 } } // namespace v8::internal
508 508
509 509
510 #endif // V8_LOG_H_ 510 #endif // V8_LOG_H_
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698