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/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
10 #include "src/pending-compilation-error-handler.h" | 10 #include "src/pending-compilation-error-handler.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 } | 345 } |
346 bool outer_scope_calls_sloppy_eval() const { | 346 bool outer_scope_calls_sloppy_eval() const { |
347 return outer_scope_calls_sloppy_eval_; | 347 return outer_scope_calls_sloppy_eval_; |
348 } | 348 } |
349 bool asm_module() const { return asm_module_; } | 349 bool asm_module() const { return asm_module_; } |
350 bool asm_function() const { return asm_function_; } | 350 bool asm_function() const { return asm_function_; } |
351 | 351 |
352 // Is this scope inside a with statement. | 352 // Is this scope inside a with statement. |
353 bool inside_with() const { return scope_inside_with_; } | 353 bool inside_with() const { return scope_inside_with_; } |
354 | 354 |
355 // Is this scope inside module code. | |
356 bool inside_module() const { return scope_inside_module_; } | |
adamk
2016/02/23 22:37:15
Scope isn't the right place to put this, since it'
mike3
2016/02/24 16:20:54
Acknowledged.
| |
357 | |
355 // Does this scope access "arguments". | 358 // Does this scope access "arguments". |
356 bool uses_arguments() const { return scope_uses_arguments_; } | 359 bool uses_arguments() const { return scope_uses_arguments_; } |
357 // Does this scope access "super" property (super.foo). | 360 // Does this scope access "super" property (super.foo). |
358 bool uses_super_property() const { return scope_uses_super_property_; } | 361 bool uses_super_property() const { return scope_uses_super_property_; } |
359 // Does this scope have the potential to execute declarations non-linearly? | 362 // Does this scope have the potential to execute declarations non-linearly? |
360 bool is_nonlinear() const { return scope_nonlinear_; } | 363 bool is_nonlinear() const { return scope_nonlinear_; } |
361 | 364 |
362 // Whether this needs to be represented by a runtime context. | 365 // Whether this needs to be represented by a runtime context. |
363 bool NeedsContext() const { | 366 bool NeedsContext() const { |
364 // Catch and module scopes always have heap slots. | 367 // Catch and module scopes always have heap slots. |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
646 // Map of function names to lists of functions defined in sloppy blocks | 649 // Map of function names to lists of functions defined in sloppy blocks |
647 SloppyBlockFunctionMap sloppy_block_function_map_; | 650 SloppyBlockFunctionMap sloppy_block_function_map_; |
648 | 651 |
649 // Illegal redeclaration. | 652 // Illegal redeclaration. |
650 Expression* illegal_redecl_; | 653 Expression* illegal_redecl_; |
651 | 654 |
652 // Scope-specific information computed during parsing. | 655 // Scope-specific information computed during parsing. |
653 // | 656 // |
654 // This scope is inside a 'with' of some outer scope. | 657 // This scope is inside a 'with' of some outer scope. |
655 bool scope_inside_with_; | 658 bool scope_inside_with_; |
659 // This scpope is inside module code | |
660 bool scope_inside_module_; | |
656 // This scope contains a 'with' statement. | 661 // This scope contains a 'with' statement. |
657 bool scope_contains_with_; | 662 bool scope_contains_with_; |
658 // This scope or a nested catch scope or with scope contain an 'eval' call. At | 663 // This scope or a nested catch scope or with scope contain an 'eval' call. At |
659 // the 'eval' call site this scope is the declaration scope. | 664 // the 'eval' call site this scope is the declaration scope. |
660 bool scope_calls_eval_; | 665 bool scope_calls_eval_; |
661 // This scope uses "arguments". | 666 // This scope uses "arguments". |
662 bool scope_uses_arguments_; | 667 bool scope_uses_arguments_; |
663 // This scope uses "super" property ('super.foo'). | 668 // This scope uses "super" property ('super.foo'). |
664 bool scope_uses_super_property_; | 669 bool scope_uses_super_property_; |
665 // This scope contains an "use asm" annotation. | 670 // This scope contains an "use asm" annotation. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
829 AstValueFactory* ast_value_factory_; | 834 AstValueFactory* ast_value_factory_; |
830 Zone* zone_; | 835 Zone* zone_; |
831 | 836 |
832 PendingCompilationErrorHandler pending_error_handler_; | 837 PendingCompilationErrorHandler pending_error_handler_; |
833 }; | 838 }; |
834 | 839 |
835 } // namespace internal | 840 } // namespace internal |
836 } // namespace v8 | 841 } // namespace v8 |
837 | 842 |
838 #endif // V8_AST_SCOPES_H_ | 843 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |