| 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/scopes.h" | 5 #include "src/scopes.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/messages.h" | 9 #include "src/messages.h" |
| 10 #include "src/parser.h" | 10 #include "src/parser.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 force_context_allocation_ = (outer_scope != NULL && !is_function_scope()) | 176 force_context_allocation_ = (outer_scope != NULL && !is_function_scope()) |
| 177 ? outer_scope->has_forced_context_allocation() : false; | 177 ? outer_scope->has_forced_context_allocation() : false; |
| 178 num_var_or_const_ = 0; | 178 num_var_or_const_ = 0; |
| 179 num_stack_slots_ = 0; | 179 num_stack_slots_ = 0; |
| 180 num_heap_slots_ = 0; | 180 num_heap_slots_ = 0; |
| 181 num_global_slots_ = 0; | 181 num_global_slots_ = 0; |
| 182 num_modules_ = 0; | 182 num_modules_ = 0; |
| 183 module_var_ = NULL; | 183 module_var_ = NULL; |
| 184 arity_ = 0; | 184 arity_ = 0; |
| 185 has_simple_parameters_ = true; | 185 has_simple_parameters_ = true; |
| 186 has_parameter_expressions_ = false; |
| 186 rest_parameter_ = NULL; | 187 rest_parameter_ = NULL; |
| 187 rest_index_ = -1; | 188 rest_index_ = -1; |
| 188 scope_info_ = scope_info; | 189 scope_info_ = scope_info; |
| 189 start_position_ = RelocInfo::kNoPosition; | 190 start_position_ = RelocInfo::kNoPosition; |
| 190 end_position_ = RelocInfo::kNoPosition; | 191 end_position_ = RelocInfo::kNoPosition; |
| 191 if (!scope_info.is_null()) { | 192 if (!scope_info.is_null()) { |
| 192 scope_calls_eval_ = scope_info->CallsEval(); | 193 scope_calls_eval_ = scope_info->CallsEval(); |
| 193 language_mode_ = scope_info->language_mode(); | 194 language_mode_ = scope_info->language_mode(); |
| 194 is_declaration_scope_ = scope_info->is_declaration_scope(); | 195 is_declaration_scope_ = scope_info->is_declaration_scope(); |
| 195 function_kind_ = scope_info->function_kind(); | 196 function_kind_ = scope_info->function_kind(); |
| (...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 function_ != NULL && function_->proxy()->var()->IsContextSlot(); | 1622 function_ != NULL && function_->proxy()->var()->IsContextSlot(); |
| 1622 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - | 1623 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - |
| 1623 (is_function_var_in_context ? 1 : 0); | 1624 (is_function_var_in_context ? 1 : 0); |
| 1624 } | 1625 } |
| 1625 | 1626 |
| 1626 | 1627 |
| 1627 int Scope::ContextGlobalCount() const { return num_global_slots(); } | 1628 int Scope::ContextGlobalCount() const { return num_global_slots(); } |
| 1628 | 1629 |
| 1629 } // namespace internal | 1630 } // namespace internal |
| 1630 } // namespace v8 | 1631 } // namespace v8 |
| OLD | NEW |