11cb0ef41Sopenharmony_ci// Copyright 2018 the V8 project authors. All rights reserved.
21cb0ef41Sopenharmony_ci// Use of this source code is governed by a BSD-style license that can be
31cb0ef41Sopenharmony_ci// found in the LICENSE file.
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci#ifndef V8_PARSING_PREPARSER_LOGGER_H_
61cb0ef41Sopenharmony_ci#define V8_PARSING_PREPARSER_LOGGER_H_
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_cinamespace v8 {
91cb0ef41Sopenharmony_cinamespace internal {
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ciclass PreParserLogger final {
121cb0ef41Sopenharmony_ci public:
131cb0ef41Sopenharmony_ci  PreParserLogger()
141cb0ef41Sopenharmony_ci      : end_(-1),
151cb0ef41Sopenharmony_ci        num_parameters_(-1),
161cb0ef41Sopenharmony_ci        function_length_(-1),
171cb0ef41Sopenharmony_ci        num_inner_functions_(-1) {}
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci  void LogFunction(int end, int num_parameters, int function_length,
201cb0ef41Sopenharmony_ci                   int num_inner_functions) {
211cb0ef41Sopenharmony_ci    end_ = end;
221cb0ef41Sopenharmony_ci    num_parameters_ = num_parameters;
231cb0ef41Sopenharmony_ci    function_length_ = function_length;
241cb0ef41Sopenharmony_ci    num_inner_functions_ = num_inner_functions;
251cb0ef41Sopenharmony_ci  }
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_ci  int end() const { return end_; }
281cb0ef41Sopenharmony_ci  int num_parameters() const { return num_parameters_; }
291cb0ef41Sopenharmony_ci  int function_length() const { return function_length_; }
301cb0ef41Sopenharmony_ci  int num_inner_functions() const { return num_inner_functions_; }
311cb0ef41Sopenharmony_ci
321cb0ef41Sopenharmony_ci private:
331cb0ef41Sopenharmony_ci  int end_;
341cb0ef41Sopenharmony_ci  // For function entries.
351cb0ef41Sopenharmony_ci  int num_parameters_;
361cb0ef41Sopenharmony_ci  int function_length_;
371cb0ef41Sopenharmony_ci  int num_inner_functions_;
381cb0ef41Sopenharmony_ci};
391cb0ef41Sopenharmony_ci
401cb0ef41Sopenharmony_ci}  // namespace internal
411cb0ef41Sopenharmony_ci}  // namespace v8.
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci#endif  // V8_PARSING_PREPARSER_LOGGER_H_
44