1 // Copyright 2020 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/logging/local-logger.h"
6
7 #include "src/execution/isolate.h"
8 #include "src/objects/map.h"
9
10 namespace v8 {
11 namespace internal {
12
13 // TODO(leszeks): Add support for logging from off-thread.
LocalLogger(Isolate* isolate)14 LocalLogger::LocalLogger(Isolate* isolate)
15 : logger_(isolate->logger()),
16 is_logging_(isolate->logger()->is_logging()),
17 is_listening_to_code_events_(
18 isolate->logger()->is_listening_to_code_events()) {}
19
ScriptDetails(Script script)20 void LocalLogger::ScriptDetails(Script script) {
21 logger_->ScriptDetails(script);
22 }
ScriptEvent(Logger::ScriptEventType type, int script_id)23 void LocalLogger::ScriptEvent(Logger::ScriptEventType type, int script_id) {
24 logger_->ScriptEvent(type, script_id);
25 }
CodeLinePosInfoRecordEvent(Address code_start, ByteArray source_position_table, JitCodeEvent::CodeType code_type)26 void LocalLogger::CodeLinePosInfoRecordEvent(Address code_start,
27 ByteArray source_position_table,
28 JitCodeEvent::CodeType code_type) {
29 logger_->CodeLinePosInfoRecordEvent(code_start, source_position_table,
30 code_type);
31 }
32
MapCreate(Map map)33 void LocalLogger::MapCreate(Map map) { logger_->MapCreate(map); }
34
MapDetails(Map map)35 void LocalLogger::MapDetails(Map map) { logger_->MapDetails(map); }
36
37 } // namespace internal
38 } // namespace v8
39