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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // to be executed. If the script is a top-level script, or the scope chain | 215 // to be executed. If the script is a top-level script, or the scope chain |
216 // consists of only a native context, maybe_outer_scope_info should be an | 216 // consists of only a native context, maybe_outer_scope_info should be an |
217 // empty handle. | 217 // empty handle. |
218 // | 218 // |
219 // This only deserializes the scope chain, but doesn't connect the scopes to | 219 // This only deserializes the scope chain, but doesn't connect the scopes to |
220 // their corresponding scope infos. Therefore, looking up variables in the | 220 // their corresponding scope infos. Therefore, looking up variables in the |
221 // deserialized scopes is not possible. | 221 // deserialized scopes is not possible. |
222 void DeserializeScopeChain(ParseInfo* info, | 222 void DeserializeScopeChain(ParseInfo* info, |
223 MaybeHandle<ScopeInfo> maybe_outer_scope_info); | 223 MaybeHandle<ScopeInfo> maybe_outer_scope_info); |
224 | 224 |
225 // Handle errors detected during parsing | 225 // Handle errors detected during parsing, move statistics to Isolate, |
226 void ReportErrors(Isolate* isolate, Handle<Script> script); | 226 // internalize strings (move them to the heap). |
227 // Move statistics to Isolate | 227 void Internalize(Isolate* isolate, Handle<Script> script, bool error); |
228 void UpdateStatistics(Isolate* isolate, Handle<Script> script); | |
229 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); | 228 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); |
230 | 229 |
231 private: | 230 private: |
232 friend class ParserBase<Parser>; | 231 friend class ParserBase<Parser>; |
233 friend class v8::internal::ExpressionClassifier<ParserTypes<Parser>>; | 232 friend class v8::internal::ExpressionClassifier<ParserTypes<Parser>>; |
234 friend bool v8::internal::parsing::ParseProgram(ParseInfo*, bool); | 233 friend bool v8::internal::parsing::ParseProgram(ParseInfo*); |
235 friend bool v8::internal::parsing::ParseFunction(ParseInfo*, bool); | 234 friend bool v8::internal::parsing::ParseFunction(ParseInfo*); |
236 | 235 |
237 bool AllowsLazyParsingWithoutUnresolvedVariables() const { | 236 bool AllowsLazyParsingWithoutUnresolvedVariables() const { |
238 return scope()->AllowsLazyParsingWithoutUnresolvedVariables( | 237 return scope()->AllowsLazyParsingWithoutUnresolvedVariables( |
239 original_scope_); | 238 original_scope_); |
240 } | 239 } |
241 | 240 |
242 bool parse_lazily() const { return mode_ == PARSE_LAZILY; } | 241 bool parse_lazily() const { return mode_ == PARSE_LAZILY; } |
243 enum Mode { PARSE_LAZILY, PARSE_EAGERLY }; | 242 enum Mode { PARSE_LAZILY, PARSE_EAGERLY }; |
244 | 243 |
245 class ParsingModeScope BASE_EMBEDDED { | 244 class ParsingModeScope BASE_EMBEDDED { |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 | 1191 |
1193 private: | 1192 private: |
1194 ParserTarget** variable_; | 1193 ParserTarget** variable_; |
1195 ParserTarget* previous_; | 1194 ParserTarget* previous_; |
1196 }; | 1195 }; |
1197 | 1196 |
1198 } // namespace internal | 1197 } // namespace internal |
1199 } // namespace v8 | 1198 } // namespace v8 |
1200 | 1199 |
1201 #endif // V8_PARSING_PARSER_H_ | 1200 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |