OLD | NEW |
---|---|
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 class Ticker; | 72 class Ticker; |
73 class Profiler; | 73 class Profiler; |
74 class Semaphore; | 74 class Semaphore; |
75 class SlidingStateWindow; | 75 class SlidingStateWindow; |
76 class LogMessageBuilder; | 76 class LogMessageBuilder; |
77 class CompressionHelper; | 77 class CompressionHelper; |
78 | 78 |
79 #undef LOG | 79 #undef LOG |
80 // TODO(isolates): pass isolate pointer here. | 80 // TODO(isolates): pass isolate pointer here. |
81 #ifdef ENABLE_LOGGING_AND_PROFILING | 81 #ifdef ENABLE_LOGGING_AND_PROFILING |
82 #define LOG(Call) \ | 82 #define LOG_FOR_ISOLATE(isolate, Call) \ |
83 do { \ | 83 do { \ |
84 v8::internal::Logger* logger = \ | 84 v8::internal::Logger* logger = isolate->logger(); \ |
85 v8::internal::Isolate::Current()->logger(); \ | 85 if (logger->is_logging()) \ |
86 if (logger->is_logging()) \ | 86 logger->Call; \ |
87 logger->Call; \ | |
88 } while (false) | 87 } while (false) |
88 | |
89 #define LOG(Call) LOG_FOR_ISOLATE(v8::internal::Isolate::Current(), Call) | |
89 #else | 90 #else |
91 #define LOG_FOR_ISOLATE(isolate, Call) ((void) 0) | |
Vitaly Repeshko
2010/12/06 18:18:45
Doing this in two steps will most likely cause too
| |
90 #define LOG(Call) ((void) 0) | 92 #define LOG(Call) ((void) 0) |
91 #endif | 93 #endif |
92 | 94 |
93 #define LOG_EVENTS_AND_TAGS_LIST(V) \ | 95 #define LOG_EVENTS_AND_TAGS_LIST(V) \ |
94 V(CODE_CREATION_EVENT, "code-creation", "cc") \ | 96 V(CODE_CREATION_EVENT, "code-creation", "cc") \ |
95 V(CODE_MOVE_EVENT, "code-move", "cm") \ | 97 V(CODE_MOVE_EVENT, "code-move", "cm") \ |
96 V(CODE_DELETE_EVENT, "code-delete", "cd") \ | 98 V(CODE_DELETE_EVENT, "code-delete", "cd") \ |
97 V(CODE_MOVING_GC, "code-moving-gc", "cg") \ | 99 V(CODE_MOVING_GC, "code-moving-gc", "cg") \ |
98 V(FUNCTION_CREATION_EVENT, "function-creation", "fc") \ | 100 V(FUNCTION_CREATION_EVENT, "function-creation", "fc") \ |
99 V(FUNCTION_MOVE_EVENT, "function-move", "fm") \ | 101 V(FUNCTION_MOVE_EVENT, "function-move", "fm") \ |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 // Class that extracts stack trace, used for profiling. | 411 // Class that extracts stack trace, used for profiling. |
410 class StackTracer : public AllStatic { | 412 class StackTracer : public AllStatic { |
411 public: | 413 public: |
412 static void Trace(TickSample* sample); | 414 static void Trace(TickSample* sample); |
413 }; | 415 }; |
414 | 416 |
415 } } // namespace v8::internal | 417 } } // namespace v8::internal |
416 | 418 |
417 | 419 |
418 #endif // V8_LOG_H_ | 420 #endif // V8_LOG_H_ |
OLD | NEW |