summaryrefslogtreecommitdiff
path: root/deps/v8/src/logging/log-inl.h
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-08-01 08:38:30 +0200
committerMichaël Zasso <targos@protonmail.com>2019-08-01 12:53:56 +0200
commit2dcc3665abf57c3607cebffdeeca062f5894885d (patch)
tree4f560748132edcfb4c22d6f967a7e80d23d7ea2c /deps/v8/src/logging/log-inl.h
parent1ee47d550c6de132f06110aa13eceb7551d643b3 (diff)
downloadnode-new-2dcc3665abf57c3607cebffdeeca062f5894885d.tar.gz
deps: update V8 to 7.6.303.28
PR-URL: https://github.com/nodejs/node/pull/28016 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Diffstat (limited to 'deps/v8/src/logging/log-inl.h')
-rw-r--r--deps/v8/src/logging/log-inl.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/deps/v8/src/logging/log-inl.h b/deps/v8/src/logging/log-inl.h
new file mode 100644
index 0000000000..83677f5f64
--- /dev/null
+++ b/deps/v8/src/logging/log-inl.h
@@ -0,0 +1,51 @@
+// Copyright 2006-2009 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_LOGGING_LOG_INL_H_
+#define V8_LOGGING_LOG_INL_H_
+
+#include "src/execution/isolate.h"
+#include "src/logging/log.h"
+#include "src/objects/objects-inl.h"
+#include "src/tracing/trace-event.h"
+
+namespace v8 {
+namespace internal {
+
+CodeEventListener::LogEventsAndTags Logger::ToNativeByScript(
+ CodeEventListener::LogEventsAndTags tag, Script script) {
+ if (script.type() != Script::TYPE_NATIVE) return tag;
+ switch (tag) {
+ case CodeEventListener::FUNCTION_TAG:
+ return CodeEventListener::NATIVE_FUNCTION_TAG;
+ case CodeEventListener::LAZY_COMPILE_TAG:
+ return CodeEventListener::NATIVE_LAZY_COMPILE_TAG;
+ case CodeEventListener::SCRIPT_TAG:
+ return CodeEventListener::NATIVE_SCRIPT_TAG;
+ default:
+ return tag;
+ }
+}
+
+void Logger::CallEventLogger(Isolate* isolate, const char* name, StartEnd se,
+ bool expose_to_api) {
+ if (isolate->event_logger()) {
+ if (isolate->event_logger() == DefaultEventLoggerSentinel) {
+ LOG(isolate, TimerEvent(se, name));
+ } else if (expose_to_api) {
+ isolate->event_logger()(name, se);
+ }
+ }
+}
+
+template <class TimerEvent>
+void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) {
+ Logger::CallEventLogger(isolate_, TimerEvent::name(), se,
+ TimerEvent::expose_to_api());
+}
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_LOGGING_LOG_INL_H_