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() : end_(-1), num_parameters_(-1), num_inner_functions_(-1) {} 14 LogFunction(int end,int num_parameters,int num_inner_functions)15 void LogFunction(int end, int num_parameters, int num_inner_functions) { 16 end_ = end; 17 num_parameters_ = num_parameters; 18 num_inner_functions_ = num_inner_functions; 19 } 20 end()21 int end() const { return end_; } num_parameters()22 int num_parameters() const { return num_parameters_; } num_inner_functions()23 int num_inner_functions() const { return num_inner_functions_; } 24 25 private: 26 int end_; 27 // For function entries. 28 int num_parameters_; 29 int num_inner_functions_; 30 }; 31 32 } // namespace internal 33 } // namespace v8. 34 35 #endif // V8_PARSING_PREPARSER_LOGGER_H_ 36