| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void RecordEvalCall() { scope_calls_eval_ = true; } | 236 void RecordEvalCall() { scope_calls_eval_ = true; } |
| 237 | 237 |
| 238 // Inform the scope that the corresponding code uses "arguments". | 238 // Inform the scope that the corresponding code uses "arguments". |
| 239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } | 239 void RecordArgumentsUsage() { scope_uses_arguments_ = true; } |
| 240 | 240 |
| 241 // Inform the scope that the corresponding code uses "super". | 241 // Inform the scope that the corresponding code uses "super". |
| 242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } | 242 void RecordSuperPropertyUsage() { scope_uses_super_property_ = true; } |
| 243 | 243 |
| 244 // Set the language mode flag (unless disabled by a global flag). | 244 // Set the language mode flag (unless disabled by a global flag). |
| 245 void SetLanguageMode(LanguageMode language_mode) { | 245 void SetLanguageMode(LanguageMode language_mode) { |
| 246 DCHECK(!is_module_scope()); |
| 246 language_mode_ = language_mode; | 247 language_mode_ = language_mode; |
| 247 } | 248 } |
| 248 | 249 |
| 249 // Set the ASM module flag. | 250 // Set the ASM module flag. |
| 250 void SetAsmModule() { asm_module_ = true; } | 251 void SetAsmModule() { asm_module_ = true; } |
| 251 | 252 |
| 252 // Inform the scope that the scope may execute declarations nonlinearly. | 253 // Inform the scope that the scope may execute declarations nonlinearly. |
| 253 // Currently, the only nonlinear scope is a switch statement. The name is | 254 // Currently, the only nonlinear scope is a switch statement. The name is |
| 254 // more general in case something else comes up with similar control flow, | 255 // more general in case something else comes up with similar control flow, |
| 255 // for example the ability to break out of something which does not have | 256 // for example the ability to break out of something which does not have |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 AstValueFactory* ast_value_factory_; | 802 AstValueFactory* ast_value_factory_; |
| 802 Zone* zone_; | 803 Zone* zone_; |
| 803 | 804 |
| 804 PendingCompilationErrorHandler pending_error_handler_; | 805 PendingCompilationErrorHandler pending_error_handler_; |
| 805 }; | 806 }; |
| 806 | 807 |
| 807 } // namespace internal | 808 } // namespace internal |
| 808 } // namespace v8 | 809 } // namespace v8 |
| 809 | 810 |
| 810 #endif // V8_AST_SCOPES_H_ | 811 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |