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/parsing/parser-base.h" | 10 #include "src/parsing/parser-base.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 // Parses the source code represented by the compilation info and sets its | 180 // Parses the source code represented by the compilation info and sets its |
181 // function literal. Returns false (and deallocates any allocated AST | 181 // function literal. Returns false (and deallocates any allocated AST |
182 // nodes) if parsing failed. | 182 // nodes) if parsing failed. |
183 static bool ParseStatic(ParseInfo* info); | 183 static bool ParseStatic(ParseInfo* info); |
184 bool Parse(ParseInfo* info); | 184 bool Parse(ParseInfo* info); |
185 void ParseOnBackground(ParseInfo* info); | 185 void ParseOnBackground(ParseInfo* info); |
186 | 186 |
187 // Deserialize the scope chain prior to parsing in which the script is going | 187 // Deserialize the scope chain prior to parsing in which the script is going |
188 // to be executed. If the script is a top-level script, or the scope chain | 188 // to be executed. If the script is a top-level script, or the scope chain |
189 // consists of only a native context, maybe_context should be an empty | 189 // consists of only a native context, maybe_outer_scope_info should be an |
190 // handle. | 190 // empty handle. |
191 // | 191 // |
192 // This only deserializes the scope chain, but doesn't connect the scopes to | 192 // This only deserializes the scope chain, but doesn't connect the scopes to |
193 // their corresponding scope infos. Therefore, looking up variables in the | 193 // their corresponding scope infos. Therefore, looking up variables in the |
194 // deserialized scopes is not possible. | 194 // deserialized scopes is not possible. |
195 void DeserializeScopeChain(ParseInfo* info, | 195 void DeserializeScopeChain(ParseInfo* info, |
196 MaybeHandle<Context> maybe_context); | 196 MaybeHandle<ScopeInfo> maybe_outer_scope_info); |
197 | 197 |
198 // Handle errors detected during parsing, move statistics to Isolate, | 198 // Handle errors detected during parsing, move statistics to Isolate, |
199 // internalize strings (move them to the heap). | 199 // internalize strings (move them to the heap). |
200 void Internalize(Isolate* isolate, Handle<Script> script, bool error); | 200 void Internalize(Isolate* isolate, Handle<Script> script, bool error); |
201 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); | 201 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); |
202 | 202 |
203 private: | 203 private: |
204 friend class ParserBase<Parser>; | 204 friend class ParserBase<Parser>; |
205 friend class v8::internal::ExpressionClassifier<ParserTypes<Parser>>; | 205 friend class v8::internal::ExpressionClassifier<ParserTypes<Parser>>; |
206 | 206 |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 | 1080 |
1081 #ifdef DEBUG | 1081 #ifdef DEBUG |
1082 void Print(AstNode* node); | 1082 void Print(AstNode* node); |
1083 #endif // DEBUG | 1083 #endif // DEBUG |
1084 }; | 1084 }; |
1085 | 1085 |
1086 } // namespace internal | 1086 } // namespace internal |
1087 } // namespace v8 | 1087 } // namespace v8 |
1088 | 1088 |
1089 #endif // V8_PARSING_PARSER_H_ | 1089 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |