| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #include "src/ast/context-slot-cache.h" | 7 #include "src/ast/context-slot-cache.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 | 10 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 int var_index = scope->AsDeclarationScope()->function_var()->index(); | 190 int var_index = scope->AsDeclarationScope()->function_var()->index(); |
| 191 scope_info->set(index++, | 191 scope_info->set(index++, |
| 192 *scope->AsDeclarationScope()->function_var()->name()); | 192 *scope->AsDeclarationScope()->function_var()->name()); |
| 193 scope_info->set(index++, Smi::FromInt(var_index)); | 193 scope_info->set(index++, Smi::FromInt(var_index)); |
| 194 DCHECK(function_name_info != CONTEXT || | 194 DCHECK(function_name_info != CONTEXT || |
| 195 var_index == scope_info->ContextLength() - 1); | 195 var_index == scope_info->ContextLength() - 1); |
| 196 } | 196 } |
| 197 | 197 |
| 198 DCHECK(index == scope_info->length()); | 198 DCHECK(index == scope_info->length()); |
| 199 DCHECK(scope->num_parameters() == scope_info->ParameterCount()); | 199 DCHECK(scope->num_parameters() == scope_info->ParameterCount()); |
| 200 DCHECK(scope->num_heap_slots() == scope_info->ContextLength() || | 200 DCHECK(scope->num_heap_slots() == scope_info->ContextLength()); |
| 201 (scope->num_heap_slots() == kVariablePartIndex && | |
| 202 scope_info->ContextLength() == 0)); | |
| 203 return scope_info; | 201 return scope_info; |
| 204 } | 202 } |
| 205 | 203 |
| 206 | 204 |
| 207 Handle<ScopeInfo> ScopeInfo::CreateGlobalThisBinding(Isolate* isolate) { | 205 Handle<ScopeInfo> ScopeInfo::CreateGlobalThisBinding(Isolate* isolate) { |
| 208 DCHECK(isolate->bootstrapper()->IsActive()); | 206 DCHECK(isolate->bootstrapper()->IsActive()); |
| 209 | 207 |
| 210 const int stack_local_count = 0; | 208 const int stack_local_count = 0; |
| 211 const int context_local_count = 1; | 209 const int context_local_count = 1; |
| 212 const int context_global_count = 0; | 210 const int context_global_count = 0; |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 ContextLocalNameEntriesIndex() + ContextLocalCount(), this); | 684 ContextLocalNameEntriesIndex() + ContextLocalCount(), this); |
| 687 } | 685 } |
| 688 | 686 |
| 689 PrintF("}\n"); | 687 PrintF("}\n"); |
| 690 } | 688 } |
| 691 #endif // DEBUG | 689 #endif // DEBUG |
| 692 | 690 |
| 693 | 691 |
| 694 } // namespace internal | 692 } // namespace internal |
| 695 } // namespace v8 | 693 } // namespace v8 |
| OLD | NEW |