Line data Source code
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:
13 : PreParserLogger()
14 : : end_(-1),
15 : num_parameters_(-1),
16 : function_length_(-1),
17 924365 : num_inner_functions_(-1) {}
18 :
19 : void LogFunction(int end, int num_parameters, int function_length,
20 : int num_inner_functions) {
21 2565729 : end_ = end;
22 2565729 : num_parameters_ = num_parameters;
23 2565729 : function_length_ = function_length;
24 2565729 : num_inner_functions_ = num_inner_functions;
25 : }
26 :
27 : int end() const { return end_; }
28 : int num_parameters() const { return num_parameters_; }
29 : int function_length() const { return function_length_; }
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_
|