• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2018 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 #ifndef V8_PARSING_PREPARSER_LOGGER_H_
6 #define V8_PARSING_PREPARSER_LOGGER_H_
7 
8 namespace v8 {
9 namespace internal {
10 
11 class PreParserLogger final {
12  public:
PreParserLogger()13   PreParserLogger()
14       : end_(-1),
15         num_parameters_(-1),
16         function_length_(-1),
17         num_inner_functions_(-1) {}
18 
LogFunction(int end,int num_parameters,int function_length,int num_inner_functions)19   void LogFunction(int end, int num_parameters, int function_length,
20                    int num_inner_functions) {
21     end_ = end;
22     num_parameters_ = num_parameters;
23     function_length_ = function_length;
24     num_inner_functions_ = num_inner_functions;
25   }
26 
end()27   int end() const { return end_; }
num_parameters()28   int num_parameters() const { return num_parameters_; }
function_length()29   int function_length() const { return function_length_; }
num_inner_functions()30   int num_inner_functions() const { return num_inner_functions_; }
31 
32  private:
33   int end_;
34   // For function entries.
35   int num_parameters_;
36   int function_length_;
37   int num_inner_functions_;
38 };
39 
40 }  // namespace internal
41 }  // namespace v8.
42 
43 #endif  // V8_PARSING_PREPARSER_LOGGER_H_
44