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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { | 194 class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { |
195 public: | 195 public: |
196 explicit Parser(ParseInfo* info); | 196 explicit Parser(ParseInfo* info); |
197 ~Parser() { | 197 ~Parser() { |
198 delete reusable_preparser_; | 198 delete reusable_preparser_; |
199 reusable_preparser_ = NULL; | 199 reusable_preparser_ = NULL; |
200 delete cached_parse_data_; | 200 delete cached_parse_data_; |
201 cached_parse_data_ = NULL; | 201 cached_parse_data_ = NULL; |
202 } | 202 } |
203 | 203 |
| 204 static bool const IsPreParser() { return false; } |
| 205 |
204 // Parses the source code represented by the compilation info and sets its | 206 // Parses the source code represented by the compilation info and sets its |
205 // function literal. Returns false (and deallocates any allocated AST | 207 // function literal. Returns false (and deallocates any allocated AST |
206 // nodes) if parsing failed. | 208 // nodes) if parsing failed. |
207 static bool ParseStatic(ParseInfo* info); | 209 static bool ParseStatic(ParseInfo* info); |
208 bool Parse(ParseInfo* info); | 210 bool Parse(ParseInfo* info); |
209 void ParseOnBackground(ParseInfo* info); | 211 void ParseOnBackground(ParseInfo* info); |
210 | 212 |
211 // Deserialize the scope chain prior to parsing in which the script is going | 213 // Deserialize the scope chain prior to parsing in which the script is going |
212 // to be executed. If the script is a top-level script, or the scope chain | 214 // to be executed. If the script is a top-level script, or the scope chain |
213 // consists of only a native context, maybe_outer_scope_info should be an | 215 // consists of only a native context, maybe_outer_scope_info should be an |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 | 1143 |
1142 ScriptCompiler::CompileOptions compile_options_; | 1144 ScriptCompiler::CompileOptions compile_options_; |
1143 ParseData* cached_parse_data_; | 1145 ParseData* cached_parse_data_; |
1144 | 1146 |
1145 PendingCompilationErrorHandler pending_error_handler_; | 1147 PendingCompilationErrorHandler pending_error_handler_; |
1146 | 1148 |
1147 // Other information which will be stored in Parser and moved to Isolate after | 1149 // Other information which will be stored in Parser and moved to Isolate after |
1148 // parsing. | 1150 // parsing. |
1149 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; | 1151 int use_counts_[v8::Isolate::kUseCounterFeatureCount]; |
1150 int total_preparse_skipped_; | 1152 int total_preparse_skipped_; |
1151 | |
1152 bool parsing_on_main_thread_; | 1153 bool parsing_on_main_thread_; |
1153 ParserLogger* log_; | 1154 ParserLogger* log_; |
1154 }; | 1155 }; |
1155 | 1156 |
1156 // ---------------------------------------------------------------------------- | 1157 // ---------------------------------------------------------------------------- |
1157 // Target is a support class to facilitate manipulation of the | 1158 // Target is a support class to facilitate manipulation of the |
1158 // Parser's target_stack_ (the stack of potential 'break' and | 1159 // Parser's target_stack_ (the stack of potential 'break' and |
1159 // 'continue' statement targets). Upon construction, a new target is | 1160 // 'continue' statement targets). Upon construction, a new target is |
1160 // added; it is removed upon destruction. | 1161 // added; it is removed upon destruction. |
1161 | 1162 |
(...skipping 29 matching lines...) Expand all Loading... |
1191 | 1192 |
1192 private: | 1193 private: |
1193 ParserTarget** variable_; | 1194 ParserTarget** variable_; |
1194 ParserTarget* previous_; | 1195 ParserTarget* previous_; |
1195 }; | 1196 }; |
1196 | 1197 |
1197 } // namespace internal | 1198 } // namespace internal |
1198 } // namespace v8 | 1199 } // namespace v8 |
1199 | 1200 |
1200 #endif // V8_PARSING_PARSER_H_ | 1201 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |