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/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 break; | 1098 break; |
1099 case VariableLocation::PARAMETER: | 1099 case VariableLocation::PARAMETER: |
1100 PrintF("parameter[%d]", var->index()); | 1100 PrintF("parameter[%d]", var->index()); |
1101 break; | 1101 break; |
1102 case VariableLocation::LOCAL: | 1102 case VariableLocation::LOCAL: |
1103 PrintF("local[%d]", var->index()); | 1103 PrintF("local[%d]", var->index()); |
1104 break; | 1104 break; |
1105 case VariableLocation::CONTEXT: | 1105 case VariableLocation::CONTEXT: |
1106 PrintF("context[%d]", var->index()); | 1106 PrintF("context[%d]", var->index()); |
1107 break; | 1107 break; |
1108 case VariableLocation::GLOBAL: | |
1109 PrintF("global[%d]", var->index()); | |
1110 break; | |
1111 case VariableLocation::LOOKUP: | 1108 case VariableLocation::LOOKUP: |
1112 PrintF("lookup"); | 1109 PrintF("lookup"); |
1113 break; | 1110 break; |
1114 case VariableLocation::MODULE: | 1111 case VariableLocation::MODULE: |
1115 PrintF("module"); | 1112 PrintF("module"); |
1116 break; | 1113 break; |
1117 } | 1114 } |
1118 } | 1115 } |
1119 | 1116 |
1120 | 1117 |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 Variable* function = | 1687 Variable* function = |
1691 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; | 1688 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; |
1692 bool is_function_var_in_context = | 1689 bool is_function_var_in_context = |
1693 function != nullptr && function->IsContextSlot(); | 1690 function != nullptr && function->IsContextSlot(); |
1694 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1691 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1695 (is_function_var_in_context ? 1 : 0); | 1692 (is_function_var_in_context ? 1 : 0); |
1696 } | 1693 } |
1697 | 1694 |
1698 } // namespace internal | 1695 } // namespace internal |
1699 } // namespace v8 | 1696 } // namespace v8 |
OLD | NEW |