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 #include "src/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1896 } else if (var != kDummyPreParserVariable && | 1896 } else if (var != kDummyPreParserVariable && |
1897 var != kDummyPreParserLexicalVariable) { | 1897 var != kDummyPreParserLexicalVariable) { |
1898 if (info != nullptr) { | 1898 if (info != nullptr) { |
1899 // In this case we need to leave scopes in a way that they can be | 1899 // In this case we need to leave scopes in a way that they can be |
1900 // allocated. If we resolved variables from lazy parsed scopes, we need | 1900 // allocated. If we resolved variables from lazy parsed scopes, we need |
1901 // to context allocate the var. | 1901 // to context allocate the var. |
1902 ResolveTo(info, proxy, var); | 1902 ResolveTo(info, proxy, var); |
1903 if (!var->is_dynamic() && lookup != this) var->ForceContextAllocation(); | 1903 if (!var->is_dynamic() && lookup != this) var->ForceContextAllocation(); |
1904 } else { | 1904 } else { |
1905 var->set_is_used(); | 1905 var->set_is_used(); |
| 1906 if (proxy->is_assigned()) { |
| 1907 var->set_maybe_assigned(); |
| 1908 } |
1906 } | 1909 } |
1907 } | 1910 } |
1908 } | 1911 } |
1909 | 1912 |
1910 // Clear unresolved_ as it's in an inconsistent state. | 1913 // Clear unresolved_ as it's in an inconsistent state. |
1911 unresolved_ = nullptr; | 1914 unresolved_ = nullptr; |
1912 | 1915 |
1913 for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) { | 1916 for (Scope* scope = inner_scope_; scope != nullptr; scope = scope->sibling_) { |
1914 stack = scope->FetchFreeVariables(max_outer_scope, info, stack); | 1917 stack = scope->FetchFreeVariables(max_outer_scope, info, stack); |
1915 } | 1918 } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2198 Variable* function = | 2201 Variable* function = |
2199 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; | 2202 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; |
2200 bool is_function_var_in_context = | 2203 bool is_function_var_in_context = |
2201 function != nullptr && function->IsContextSlot(); | 2204 function != nullptr && function->IsContextSlot(); |
2202 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 2205 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
2203 (is_function_var_in_context ? 1 : 0); | 2206 (is_function_var_in_context ? 1 : 0); |
2204 } | 2207 } |
2205 | 2208 |
2206 } // namespace internal | 2209 } // namespace internal |
2207 } // namespace v8 | 2210 } // namespace v8 |
OLD | NEW |