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_AST_SCOPES_H_ | 5 #ifndef V8_AST_SCOPES_H_ |
6 #define V8_AST_SCOPES_H_ | 6 #define V8_AST_SCOPES_H_ |
7 | 7 |
8 #include "src/ast/variables.h" | 8 #include "src/ast/variables.h" |
9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 // Check that all Scopes in the scope tree use the same Zone. | 396 // Check that all Scopes in the scope tree use the same Zone. |
397 void CheckZones(); | 397 void CheckZones(); |
398 #endif | 398 #endif |
399 | 399 |
400 // Retrieve `IsSimpleParameterList` of current or outer function. | 400 // Retrieve `IsSimpleParameterList` of current or outer function. |
401 bool HasSimpleParameters(); | 401 bool HasSimpleParameters(); |
402 void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; } | 402 void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; } |
403 | 403 |
404 protected: | 404 protected: |
405 explicit Scope(Zone* zone, ScopeType scope_type = SCRIPT_SCOPE); | 405 explicit Scope(Zone* zone); |
406 | 406 |
407 void set_language_mode(LanguageMode language_mode) { | 407 void set_language_mode(LanguageMode language_mode) { |
408 is_strict_ = is_strict(language_mode); | 408 is_strict_ = is_strict(language_mode); |
409 } | 409 } |
410 | 410 |
411 private: | 411 private: |
412 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name, | 412 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name, |
413 VariableMode mode, Variable::Kind kind, | 413 VariableMode mode, Variable::Kind kind, |
414 InitializationFlag initialization_flag, | 414 InitializationFlag initialization_flag, |
415 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned) { | 415 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned) { |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 void AllocateModuleVariables(); | 843 void AllocateModuleVariables(); |
844 | 844 |
845 private: | 845 private: |
846 ModuleDescriptor* module_descriptor_; | 846 ModuleDescriptor* module_descriptor_; |
847 }; | 847 }; |
848 | 848 |
849 } // namespace internal | 849 } // namespace internal |
850 } // namespace v8 | 850 } // namespace v8 |
851 | 851 |
852 #endif // V8_AST_SCOPES_H_ | 852 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |