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/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
9 #include "src/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; } | 419 bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; } |
420 | 420 |
421 protected: | 421 protected: |
422 explicit Scope(Zone* zone); | 422 explicit Scope(Zone* zone); |
423 | 423 |
424 void set_language_mode(LanguageMode language_mode) { | 424 void set_language_mode(LanguageMode language_mode) { |
425 is_strict_ = is_strict(language_mode); | 425 is_strict_ = is_strict(language_mode); |
426 } | 426 } |
427 | 427 |
428 private: | 428 private: |
429 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name, | 429 Variable* Declare(Zone* zone, const AstRawString* name, VariableMode mode, |
430 VariableMode mode, VariableKind kind, | 430 VariableKind kind, InitializationFlag initialization_flag, |
431 InitializationFlag initialization_flag, | |
432 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); | 431 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); |
433 | 432 |
434 // This method should only be invoked on scopes created during parsing (i.e., | 433 // This method should only be invoked on scopes created during parsing (i.e., |
435 // not deserialized from a context). Also, since NeedsContext() is only | 434 // not deserialized from a context). Also, since NeedsContext() is only |
436 // returning a valid result after variables are resolved, NeedsScopeInfo() | 435 // returning a valid result after variables are resolved, NeedsScopeInfo() |
437 // should also be invoked after resolution. | 436 // should also be invoked after resolution. |
438 bool NeedsScopeInfo() const; | 437 bool NeedsScopeInfo() const; |
439 | 438 |
440 Zone* zone_; | 439 Zone* zone_; |
441 | 440 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 void AllocateModuleVariables(); | 853 void AllocateModuleVariables(); |
855 | 854 |
856 private: | 855 private: |
857 ModuleDescriptor* module_descriptor_; | 856 ModuleDescriptor* module_descriptor_; |
858 }; | 857 }; |
859 | 858 |
860 } // namespace internal | 859 } // namespace internal |
861 } // namespace v8 | 860 } // namespace v8 |
862 | 861 |
863 #endif // V8_AST_SCOPES_H_ | 862 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |