| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
| 6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
| 10 #include "src/base/compiler-specific.h" | 10 #include "src/base/compiler-specific.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 283 |
| 284 // Called by ParseProgram after setting up the scanner. | 284 // Called by ParseProgram after setting up the scanner. |
| 285 FunctionLiteral* DoParseProgram(ParseInfo* info); | 285 FunctionLiteral* DoParseProgram(ParseInfo* info); |
| 286 | 286 |
| 287 void SetCachedData(ParseInfo* info); | 287 void SetCachedData(ParseInfo* info); |
| 288 | 288 |
| 289 ScriptCompiler::CompileOptions compile_options() const { | 289 ScriptCompiler::CompileOptions compile_options() const { |
| 290 return compile_options_; | 290 return compile_options_; |
| 291 } | 291 } |
| 292 bool consume_cached_parse_data() const { | 292 bool consume_cached_parse_data() const { |
| 293 return allow_lazy() && | 293 return allow_lazy_ && |
| 294 compile_options_ == ScriptCompiler::kConsumeParserCache; | 294 compile_options_ == ScriptCompiler::kConsumeParserCache; |
| 295 } | 295 } |
| 296 bool produce_cached_parse_data() const { | 296 bool produce_cached_parse_data() const { |
| 297 return allow_lazy() && | 297 return allow_lazy_ && |
| 298 compile_options_ == ScriptCompiler::kProduceParserCache; | 298 compile_options_ == ScriptCompiler::kProduceParserCache; |
| 299 } | 299 } |
| 300 | 300 |
| 301 void ParseModuleItemList(ZoneList<Statement*>* body, bool* ok); | 301 void ParseModuleItemList(ZoneList<Statement*>* body, bool* ok); |
| 302 Statement* ParseModuleItem(bool* ok); | 302 Statement* ParseModuleItem(bool* ok); |
| 303 const AstRawString* ParseModuleSpecifier(bool* ok); | 303 const AstRawString* ParseModuleSpecifier(bool* ok); |
| 304 void ParseImportDeclaration(bool* ok); | 304 void ParseImportDeclaration(bool* ok); |
| 305 Statement* ParseExportDeclaration(bool* ok); | 305 Statement* ParseExportDeclaration(bool* ok); |
| 306 Statement* ParseExportDefault(bool* ok); | 306 Statement* ParseExportDefault(bool* ok); |
| 307 void ParseExportClause(ZoneList<const AstRawString*>* export_names, | 307 void ParseExportClause(ZoneList<const AstRawString*>* export_names, |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 ScriptCompiler::CompileOptions compile_options_; | 1139 ScriptCompiler::CompileOptions compile_options_; |
| 1140 ParseData* cached_parse_data_; | 1140 ParseData* cached_parse_data_; |
| 1141 | 1141 |
| 1142 PendingCompilationErrorHandler pending_error_handler_; | 1142 PendingCompilationErrorHandler pending_error_handler_; |
| 1143 | 1143 |
| 1144 // Other information which will be stored in Parser and moved to Isolate after | 1144 // Other information which will be stored in Parser and moved to Isolate after |
| 1145 // parsing. | 1145 // parsing. |
| 1146 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; | 1146 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; |
| 1147 int total_preparse_skipped_; | 1147 int total_preparse_skipped_; |
| 1148 bool parsing_on_main_thread_; | 1148 bool parsing_on_main_thread_; |
| 1149 bool allow_lazy_; |
| 1149 ParserLogger* log_; | 1150 ParserLogger* log_; |
| 1150 }; | 1151 }; |
| 1151 | 1152 |
| 1152 // ---------------------------------------------------------------------------- | 1153 // ---------------------------------------------------------------------------- |
| 1153 // Target is a support class to facilitate manipulation of the | 1154 // Target is a support class to facilitate manipulation of the |
| 1154 // Parser's target_stack_ (the stack of potential 'break' and | 1155 // Parser's target_stack_ (the stack of potential 'break' and |
| 1155 // 'continue' statement targets). Upon construction, a new target is | 1156 // 'continue' statement targets). Upon construction, a new target is |
| 1156 // added; it is removed upon destruction. | 1157 // added; it is removed upon destruction. |
| 1157 | 1158 |
| 1158 class ParserTarget BASE_EMBEDDED { | 1159 class ParserTarget BASE_EMBEDDED { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1187 | 1188 |
| 1188 private: | 1189 private: |
| 1189 ParserTarget** variable_; | 1190 ParserTarget** variable_; |
| 1190 ParserTarget* previous_; | 1191 ParserTarget* previous_; |
| 1191 }; | 1192 }; |
| 1192 | 1193 |
| 1193 } // namespace internal | 1194 } // namespace internal |
| 1194 } // namespace v8 | 1195 } // namespace v8 |
| 1195 | 1196 |
| 1196 #endif // V8_PARSING_PARSER_H_ | 1197 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |