summaryrefslogtreecommitdiff
path: root/deps/v8/src/log.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/log.h')
-rw-r--r--deps/v8/src/log.h57
1 files changed, 52 insertions, 5 deletions
diff --git a/deps/v8/src/log.h b/deps/v8/src/log.h
index 2f8f81c95..08e957a12 100644
--- a/deps/v8/src/log.h
+++ b/deps/v8/src/log.h
@@ -71,6 +71,7 @@ class Profiler;
class Semaphore;
class SlidingStateWindow;
class LogMessageBuilder;
+class CompressionHelper;
#undef LOG
#ifdef ENABLE_LOGGING_AND_PROFILING
@@ -102,8 +103,41 @@ class VMState BASE_EMBEDDED {
};
+#define LOG_EVENTS_AND_TAGS_LIST(V) \
+ V(CODE_CREATION_EVENT, "code-creation", "cc") \
+ V(CODE_MOVE_EVENT, "code-move", "cm") \
+ V(CODE_DELETE_EVENT, "code-delete", "cd") \
+ V(TICK_EVENT, "tick", "t") \
+ V(REPEAT_META_EVENT, "repeat", "r") \
+ V(BUILTIN_TAG, "Builtin", "bi") \
+ V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak", "cdb") \
+ V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn", "cdbsi") \
+ V(CALL_IC_TAG, "CallIC", "cic") \
+ V(CALL_INITIALIZE_TAG, "CallInitialize", "ci") \
+ V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic", "cmm") \
+ V(CALL_MISS_TAG, "CallMiss", "cm") \
+ V(CALL_NORMAL_TAG, "CallNormal", "cn") \
+ V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic", "cpm") \
+ V(EVAL_TAG, "Eval", "e") \
+ V(FUNCTION_TAG, "Function", "f") \
+ V(KEYED_LOAD_IC_TAG, "KeyedLoadIC", "klic") \
+ V(KEYED_STORE_IC_TAG, "KeyedStoreIC", "ksic") \
+ V(LAZY_COMPILE_TAG, "LazyCompile", "lc") \
+ V(LOAD_IC_TAG, "LoadIC", "lic") \
+ V(REG_EXP_TAG, "RegExp", "re") \
+ V(SCRIPT_TAG, "Script", "sc") \
+ V(STORE_IC_TAG, "StoreIC", "sic") \
+ V(STUB_TAG, "Stub", "s")
+
class Logger {
public:
+#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
+ enum LogEventsAndTags {
+ LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM)
+ NUMBER_OF_LOG_EVENTS
+ };
+#undef DECLARE_ENUM
+
// Acquires resources for logging if the right flags are set.
static bool Setup();
@@ -163,14 +197,14 @@ class Logger {
// ==== Events logged by --log-code. ====
// Emits a code create event.
- static void CodeCreateEvent(const char* tag, Code* code, const char* source);
- static void CodeCreateEvent(const char* tag, Code* code, String* name);
- static void CodeCreateEvent(const char* tag, Code* code, String* name,
+ static void CodeCreateEvent(LogEventsAndTags tag,
+ Code* code, const char* source);
+ static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name);
+ static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name,
String* source, int line);
- static void CodeCreateEvent(const char* tag, Code* code, int args_count);
+ static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count);
// Emits a code create event for a RegExp.
static void RegExpCodeCreateEvent(Code* code, String* source);
- static void CodeAllocateEvent(Code* code, Assembler* assem);
// Emits a code move event.
static void CodeMoveEvent(Address from, Address to);
// Emits a code delete event.
@@ -223,9 +257,15 @@ class Logger {
// Profiler's sampling interval (in milliseconds).
static const int kSamplingIntervalMs = 1;
+ // Size of window used for log records compression.
+ static const int kCompressionWindowSize = 4;
+
// Emits the profiler's first message.
static void ProfilerBeginEvent();
+ // Emits aliases for compressed messages.
+ static void LogAliases();
+
// Emits the source code of a regexp. Used by regexp events.
static void LogRegExpSource(Handle<JSRegExp> regexp);
@@ -261,8 +301,15 @@ class Logger {
// recent VM states.
static SlidingStateWindow* sliding_state_window_;
+ // An array of log events names.
+ static const char** log_events_;
+
+ // An instance of helper created if log compression is enabled.
+ static CompressionHelper* compression_helper_;
+
// Internal implementation classes with access to
// private members.
+ friend class CompressionHelper;
friend class EventLog;
friend class TimeLog;
friend class Profiler;