local-logger.h 1.1 KB
Newer Older
1 2 3 4
// Copyright 2020 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.

5 6
#ifndef V8_LOGGING_LOCAL_LOGGER_H_
#define V8_LOGGING_LOCAL_LOGGER_H_
7 8 9 10 11 12 13

#include "src/base/logging.h"
#include "src/logging/log.h"

namespace v8 {
namespace internal {

14
// TODO(leszeks): Add support for logging from off-thread.
15
class LocalLogger {
16
 public:
17 18 19 20 21
  explicit LocalLogger(Isolate* isolate);

  bool is_logging() const { return is_logging_; }
  bool is_listening_to_code_events() const {
    return is_listening_to_code_events_;
22
  }
23 24
  void ScriptDetails(Script script);
  void ScriptEvent(Logger::ScriptEventType type, int script_id);
25
  void CodeLinePosInfoRecordEvent(Address code_start,
26 27
                                  ByteArray source_position_table,
                                  JitCodeEvent::CodeType code_type);
28

29 30 31
  void MapCreate(Map map);
  void MapDetails(Map map);

32 33 34 35
 private:
  Logger* logger_;
  bool is_logging_;
  bool is_listening_to_code_events_;
36 37 38 39 40
};

}  // namespace internal
}  // namespace v8

41
#endif  // V8_LOGGING_LOCAL_LOGGER_H_