| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // tick profiler requires code events, so --prof implies --log-code. | 69 // tick profiler requires code events, so --prof implies --log-code. |
| 70 | 70 |
| 71 // Forward declarations. | 71 // Forward declarations. |
| 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 | 77 |
| 78 #undef LOG | 78 #undef LOG |
| 79 // TODO(isolates): pass isolate pointer here. | |
| 80 #ifdef ENABLE_LOGGING_AND_PROFILING | 79 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 81 #define LOG(Call) \ | 80 #define LOG(isolate, Call) \ |
| 82 do { \ | 81 do { \ |
| 83 v8::internal::Logger* logger = \ | 82 v8::internal::Logger* logger = \ |
| 84 v8::internal::Isolate::Current()->logger(); \ | 83 (isolate)->logger(); \ |
| 85 if (logger->is_logging()) \ | 84 if (logger->is_logging()) \ |
| 86 logger->Call; \ | 85 logger->Call; \ |
| 87 } while (false) | 86 } while (false) |
| 88 #else | 87 #else |
| 89 #define LOG(Call) ((void) 0) | 88 #define LOG(isolate, Call) ((void) 0) |
| 90 #endif | 89 #endif |
| 91 | 90 |
| 92 #define LOG_EVENTS_AND_TAGS_LIST(V) \ | 91 #define LOG_EVENTS_AND_TAGS_LIST(V) \ |
| 93 V(CODE_CREATION_EVENT, "code-creation") \ | 92 V(CODE_CREATION_EVENT, "code-creation") \ |
| 94 V(CODE_MOVE_EVENT, "code-move") \ | 93 V(CODE_MOVE_EVENT, "code-move") \ |
| 95 V(CODE_DELETE_EVENT, "code-delete") \ | 94 V(CODE_DELETE_EVENT, "code-delete") \ |
| 96 V(CODE_MOVING_GC, "code-moving-gc") \ | 95 V(CODE_MOVING_GC, "code-moving-gc") \ |
| 97 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ | 96 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ |
| 98 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ | 97 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ |
| 99 V(TICK_EVENT, "tick") \ | 98 V(TICK_EVENT, "tick") \ |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 // Class that extracts stack trace, used for profiling. | 437 // Class that extracts stack trace, used for profiling. |
| 439 class StackTracer : public AllStatic { | 438 class StackTracer : public AllStatic { |
| 440 public: | 439 public: |
| 441 static void Trace(Isolate* isolate, TickSample* sample); | 440 static void Trace(Isolate* isolate, TickSample* sample); |
| 442 }; | 441 }; |
| 443 | 442 |
| 444 } } // namespace v8::internal | 443 } } // namespace v8::internal |
| 445 | 444 |
| 446 | 445 |
| 447 #endif // V8_LOG_H_ | 446 #endif // V8_LOG_H_ |
| OLD | NEW |