| 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 compile_options_ == ScriptCompiler::kConsumeParserCache; |
| 294 compile_options_ == ScriptCompiler::kConsumeParserCache; | |
| 295 } | 294 } |
| 296 bool produce_cached_parse_data() const { | 295 bool produce_cached_parse_data() const { |
| 297 return allow_lazy_ && | 296 return compile_options_ == ScriptCompiler::kProduceParserCache; |
| 298 compile_options_ == ScriptCompiler::kProduceParserCache; | |
| 299 } | 297 } |
| 300 | 298 |
| 301 void ParseModuleItemList(ZoneList<Statement*>* body, bool* ok); | 299 void ParseModuleItemList(ZoneList<Statement*>* body, bool* ok); |
| 302 Statement* ParseModuleItem(bool* ok); | 300 Statement* ParseModuleItem(bool* ok); |
| 303 const AstRawString* ParseModuleSpecifier(bool* ok); | 301 const AstRawString* ParseModuleSpecifier(bool* ok); |
| 304 void ParseImportDeclaration(bool* ok); | 302 void ParseImportDeclaration(bool* ok); |
| 305 Statement* ParseExportDeclaration(bool* ok); | 303 Statement* ParseExportDeclaration(bool* ok); |
| 306 Statement* ParseExportDefault(bool* ok); | 304 Statement* ParseExportDefault(bool* ok); |
| 307 void ParseExportClause(ZoneList<const AstRawString*>* export_names, | 305 void ParseExportClause(ZoneList<const AstRawString*>* export_names, |
| 308 ZoneList<Scanner::Location>* export_locations, | 306 ZoneList<Scanner::Location>* export_locations, |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 ScriptCompiler::CompileOptions compile_options_; | 1136 ScriptCompiler::CompileOptions compile_options_; |
| 1139 ParseData* cached_parse_data_; | 1137 ParseData* cached_parse_data_; |
| 1140 | 1138 |
| 1141 PendingCompilationErrorHandler pending_error_handler_; | 1139 PendingCompilationErrorHandler pending_error_handler_; |
| 1142 | 1140 |
| 1143 // Other information which will be stored in Parser and moved to Isolate after | 1141 // Other information which will be stored in Parser and moved to Isolate after |
| 1144 // parsing. | 1142 // parsing. |
| 1145 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; | 1143 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; |
| 1146 int total_preparse_skipped_; | 1144 int total_preparse_skipped_; |
| 1147 bool allow_lazy_; | 1145 bool allow_lazy_; |
| 1146 bool temp_zoned_; |
| 1148 ParserLogger* log_; | 1147 ParserLogger* log_; |
| 1149 }; | 1148 }; |
| 1150 | 1149 |
| 1151 // ---------------------------------------------------------------------------- | 1150 // ---------------------------------------------------------------------------- |
| 1152 // Target is a support class to facilitate manipulation of the | 1151 // Target is a support class to facilitate manipulation of the |
| 1153 // Parser's target_stack_ (the stack of potential 'break' and | 1152 // Parser's target_stack_ (the stack of potential 'break' and |
| 1154 // 'continue' statement targets). Upon construction, a new target is | 1153 // 'continue' statement targets). Upon construction, a new target is |
| 1155 // added; it is removed upon destruction. | 1154 // added; it is removed upon destruction. |
| 1156 | 1155 |
| 1157 class ParserTarget BASE_EMBEDDED { | 1156 class ParserTarget BASE_EMBEDDED { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1186 | 1185 |
| 1187 private: | 1186 private: |
| 1188 ParserTarget** variable_; | 1187 ParserTarget** variable_; |
| 1189 ParserTarget* previous_; | 1188 ParserTarget* previous_; |
| 1190 }; | 1189 }; |
| 1191 | 1190 |
| 1192 } // namespace internal | 1191 } // namespace internal |
| 1193 } // namespace v8 | 1192 } // namespace v8 |
| 1194 | 1193 |
| 1195 #endif // V8_PARSING_PARSER_H_ | 1194 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |