| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; } | 299 bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; } |
| 300 bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; } | 300 bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; } |
| 301 bool is_with_scope() const { return scope_type_ == WITH_SCOPE; } | 301 bool is_with_scope() const { return scope_type_ == WITH_SCOPE; } |
| 302 bool is_declaration_scope() const { return is_declaration_scope_; } | 302 bool is_declaration_scope() const { return is_declaration_scope_; } |
| 303 | 303 |
| 304 // Information about which scopes calls eval. | 304 // Information about which scopes calls eval. |
| 305 bool calls_eval() const { return scope_calls_eval_; } | 305 bool calls_eval() const { return scope_calls_eval_; } |
| 306 bool calls_sloppy_eval() const { | 306 bool calls_sloppy_eval() const { |
| 307 return scope_calls_eval_ && is_sloppy(language_mode()); | 307 return scope_calls_eval_ && is_sloppy(language_mode()); |
| 308 } | 308 } |
| 309 bool inner_scope_calls_eval() const { return inner_scope_calls_eval_; } |
| 309 bool IsAsmModule() const; | 310 bool IsAsmModule() const; |
| 310 bool IsAsmFunction() const; | 311 bool IsAsmFunction() const; |
| 311 // Does this scope have the potential to execute declarations non-linearly? | 312 // Does this scope have the potential to execute declarations non-linearly? |
| 312 bool is_nonlinear() const { return scope_nonlinear_; } | 313 bool is_nonlinear() const { return scope_nonlinear_; } |
| 313 | 314 |
| 314 // Whether this needs to be represented by a runtime context. | 315 // Whether this needs to be represented by a runtime context. |
| 315 bool NeedsContext() const { | 316 bool NeedsContext() const { |
| 316 // Catch scopes always have heap slots. | 317 // Catch scopes always have heap slots. |
| 317 DCHECK(!is_catch_scope() || num_heap_slots() > 0); | 318 DCHECK(!is_catch_scope() || num_heap_slots() > 0); |
| 318 return num_heap_slots() > 0; | 319 return num_heap_slots() > 0; |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 void AllocateModuleVariables(); | 874 void AllocateModuleVariables(); |
| 874 | 875 |
| 875 private: | 876 private: |
| 876 ModuleDescriptor* module_descriptor_; | 877 ModuleDescriptor* module_descriptor_; |
| 877 }; | 878 }; |
| 878 | 879 |
| 879 } // namespace internal | 880 } // namespace internal |
| 880 } // namespace v8 | 881 } // namespace v8 |
| 881 | 882 |
| 882 #endif // V8_AST_SCOPES_H_ | 883 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |