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/base/hashmap.h" | 9 #include "src/base/hashmap.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 bool calls_eval() const { return scope_calls_eval_; } | 314 bool calls_eval() const { return scope_calls_eval_; } |
315 bool calls_sloppy_eval() const { | 315 bool calls_sloppy_eval() const { |
316 return scope_calls_eval_ && is_sloppy(language_mode_); | 316 return scope_calls_eval_ && is_sloppy(language_mode_); |
317 } | 317 } |
318 bool outer_scope_calls_sloppy_eval() const { | 318 bool outer_scope_calls_sloppy_eval() const { |
319 return outer_scope_calls_sloppy_eval_; | 319 return outer_scope_calls_sloppy_eval_; |
320 } | 320 } |
321 bool asm_module() const { return asm_module_; } | 321 bool asm_module() const { return asm_module_; } |
322 bool asm_function() const { return asm_function_; } | 322 bool asm_function() const { return asm_function_; } |
323 | 323 |
324 // Is this scope inside a with statement. | |
325 bool inside_with() const { return scope_inside_with_; } | |
326 | |
327 // Does this scope access "super" property (super.foo). | 324 // Does this scope access "super" property (super.foo). |
328 bool uses_super_property() const { return scope_uses_super_property_; } | 325 bool uses_super_property() const { return scope_uses_super_property_; } |
329 // Does this scope have the potential to execute declarations non-linearly? | 326 // Does this scope have the potential to execute declarations non-linearly? |
330 bool is_nonlinear() const { return scope_nonlinear_; } | 327 bool is_nonlinear() const { return scope_nonlinear_; } |
331 | 328 |
332 // Whether this needs to be represented by a runtime context. | 329 // Whether this needs to be represented by a runtime context. |
333 bool NeedsContext() const { | 330 bool NeedsContext() const { |
334 // Catch scopes always have heap slots. | 331 // Catch scopes always have heap slots. |
335 DCHECK(!is_catch_scope() || num_heap_slots() > 0); | 332 DCHECK(!is_catch_scope() || num_heap_slots() > 0); |
336 return num_heap_slots() > 0; | 333 return num_heap_slots() > 0; |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 // Convenience variable; Subclass constructor only | 893 // Convenience variable; Subclass constructor only |
897 Variable* this_function_; | 894 Variable* this_function_; |
898 // Module descriptor; module scopes only. | 895 // Module descriptor; module scopes only. |
899 ModuleDescriptor* module_descriptor_; | 896 ModuleDescriptor* module_descriptor_; |
900 }; | 897 }; |
901 | 898 |
902 } // namespace internal | 899 } // namespace internal |
903 } // namespace v8 | 900 } // namespace v8 |
904 | 901 |
905 #endif // V8_AST_SCOPES_H_ | 902 #endif // V8_AST_SCOPES_H_ |
OLD | NEW |