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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 VariableKind kind = NORMAL_VARIABLE, | 476 VariableKind kind = NORMAL_VARIABLE, |
477 InitializationFlag initialization_flag = kCreatedInitialized, | 477 InitializationFlag initialization_flag = kCreatedInitialized, |
478 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); | 478 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); |
479 | 479 |
480 // This method should only be invoked on scopes created during parsing (i.e., | 480 // This method should only be invoked on scopes created during parsing (i.e., |
481 // not deserialized from a context). Also, since NeedsContext() is only | 481 // not deserialized from a context). Also, since NeedsContext() is only |
482 // returning a valid result after variables are resolved, NeedsScopeInfo() | 482 // returning a valid result after variables are resolved, NeedsScopeInfo() |
483 // should also be invoked after resolution. | 483 // should also be invoked after resolution. |
484 bool NeedsScopeInfo() const; | 484 bool NeedsScopeInfo() const; |
485 | 485 |
| 486 Variable* NewTemporary(const AstRawString* name, |
| 487 MaybeAssignedFlag maybe_assigned); |
486 Zone* zone_; | 488 Zone* zone_; |
487 | 489 |
488 // Scope tree. | 490 // Scope tree. |
489 Scope* outer_scope_; // the immediately enclosing outer scope, or NULL | 491 Scope* outer_scope_; // the immediately enclosing outer scope, or NULL |
490 Scope* inner_scope_; // an inner scope of this scope | 492 Scope* inner_scope_; // an inner scope of this scope |
491 Scope* sibling_; // a sibling inner scope of the outer scope of this scope. | 493 Scope* sibling_; // a sibling inner scope of the outer scope of this scope. |
492 | 494 |
493 // The variables declared in this scope: | 495 // The variables declared in this scope: |
494 // | 496 // |
495 // All user-declared variables (incl. parameters). For script scopes | 497 // All user-declared variables (incl. parameters). For script scopes |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 void AllocateModuleVariables(); | 963 void AllocateModuleVariables(); |
962 | 964 |
963 private: | 965 private: |
964 ModuleDescriptor* module_descriptor_; | 966 ModuleDescriptor* module_descriptor_; |
965 }; | 967 }; |
966 | 968 |
967 } // namespace internal | 969 } // namespace internal |
968 } // namespace v8 | 970 } // namespace v8 |
969 | 971 |
970 #endif // V8_AST_SCOPES_H_ | 972 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |