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

Unified Diff: src/log.h

Issue 125141: Attempt to reduce performance penalty for logging and profiling (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.h
===================================================================
--- src/log.h (revision 2260)
+++ src/log.h (working copy)
@@ -28,6 +28,9 @@
#ifndef V8_LOG_H_
#define V8_LOG_H_
+#include "platform.h"
+#include "log-utils.h"
+
namespace v8 {
namespace internal {
@@ -77,7 +80,7 @@
#ifdef ENABLE_LOGGING_AND_PROFILING
#define LOG(Call) \
do { \
- if (v8::internal::Logger::IsEnabled()) \
+ if (v8::internal::Logger::is_logging()) \
v8::internal::Logger::Call; \
} while (false)
#else
@@ -88,12 +91,13 @@
class VMState BASE_EMBEDDED {
#ifdef ENABLE_LOGGING_AND_PROFILING
public:
- explicit VMState(StateTag state);
- ~VMState();
+ inline explicit VMState(StateTag state);
+ inline ~VMState();
StateTag state() { return state_; }
private:
+ bool disabled_;
StateTag state_;
VMState* previous_;
#else
@@ -236,7 +240,9 @@
return current_state_ ? current_state_->state() : OTHER;
}
- static bool IsEnabled();
+ static bool is_logging() {
+ return is_logging_;
+ }
// Pause/Resume collection of profiling data.
// When data collection is paused, Tick events are discarded until
@@ -317,8 +323,10 @@
friend class VMState;
friend class LoggerTestHelper;
+
+ static bool is_logging_;
#else
- static bool is_enabled() { return false; }
+ static bool is_logging() { return false; }
#endif
};
« no previous file with comments | « src/compiler.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698