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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // During formal parameter list parsing the scope only contains | 420 // During formal parameter list parsing the scope only contains |
421 // two variables inserted at initialization: "this" and "arguments". | 421 // two variables inserted at initialization: "this" and "arguments". |
422 // "this" is an invalid parameter name and "arguments" is invalid parameter | 422 // "this" is an invalid parameter name and "arguments" is invalid parameter |
423 // name in strict mode. Therefore looking up with the map which includes | 423 // name in strict mode. Therefore looking up with the map which includes |
424 // "this" and "arguments" in addition to all formal parameters is safe. | 424 // "this" and "arguments" in addition to all formal parameters is safe. |
425 return variables_.Lookup(name) != NULL; | 425 return variables_.Lookup(name) != NULL; |
426 } | 426 } |
427 | 427 |
428 int num_var() const { return variables_.occupancy(); } | 428 int num_var() const { return variables_.occupancy(); } |
429 | 429 |
| 430 bool HasLazilyParsedInnerFunctionScope() const; |
| 431 |
430 // --------------------------------------------------------------------------- | 432 // --------------------------------------------------------------------------- |
431 // Debugging. | 433 // Debugging. |
432 | 434 |
433 #ifdef DEBUG | 435 #ifdef DEBUG |
434 void Print(int n = 0); // n = indentation; n < 0 => don't print recursively | 436 void Print(int n = 0); // n = indentation; n < 0 => don't print recursively |
435 | 437 |
436 // Check that the scope has positions assigned. | 438 // Check that the scope has positions assigned. |
437 void CheckScopePositions(); | 439 void CheckScopePositions(); |
438 | 440 |
439 // Check that all Scopes in the scope tree use the same Zone. | 441 // Check that all Scopes in the scope tree use the same Zone. |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 void AllocateModuleVariables(); | 898 void AllocateModuleVariables(); |
897 | 899 |
898 private: | 900 private: |
899 ModuleDescriptor* module_descriptor_; | 901 ModuleDescriptor* module_descriptor_; |
900 }; | 902 }; |
901 | 903 |
902 } // namespace internal | 904 } // namespace internal |
903 } // namespace v8 | 905 } // namespace v8 |
904 | 906 |
905 #endif // V8_AST_SCOPES_H_ | 907 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |