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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "scopes.h" | 7 #include "scopes.h" |
8 | 8 |
9 #include "accessors.h" | 9 #include "accessors.h" |
10 #include "bootstrapper.h" | 10 #include "bootstrapper.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 return result; | 372 return result; |
373 } | 373 } |
374 // If we have a serialized scope info, we might find the variable there. | 374 // If we have a serialized scope info, we might find the variable there. |
375 // There should be no local slot with the given name. | 375 // There should be no local slot with the given name. |
376 ASSERT(scope_info_->StackSlotIndex(*name) < 0); | 376 ASSERT(scope_info_->StackSlotIndex(*name) < 0); |
377 | 377 |
378 // Check context slot lookup. | 378 // Check context slot lookup. |
379 VariableMode mode; | 379 VariableMode mode; |
380 Variable::Location location = Variable::CONTEXT; | 380 Variable::Location location = Variable::CONTEXT; |
381 InitializationFlag init_flag; | 381 InitializationFlag init_flag; |
382 int index = scope_info_->ContextSlotIndex(*name, &mode, &init_flag); | 382 int index = ScopeInfo::ContextSlotIndex(scope_info_, name, &mode, &init_flag); |
383 if (index < 0) { | 383 if (index < 0) { |
384 // Check parameters. | 384 // Check parameters. |
385 index = scope_info_->ParameterIndex(*name); | 385 index = scope_info_->ParameterIndex(*name); |
386 if (index < 0) return NULL; | 386 if (index < 0) return NULL; |
387 | 387 |
388 mode = DYNAMIC; | 388 mode = DYNAMIC; |
389 location = Variable::LOOKUP; | 389 location = Variable::LOOKUP; |
390 init_flag = kCreatedInitialized; | 390 init_flag = kCreatedInitialized; |
391 } | 391 } |
392 | 392 |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 } | 1372 } |
1373 | 1373 |
1374 | 1374 |
1375 int Scope::ContextLocalCount() const { | 1375 int Scope::ContextLocalCount() const { |
1376 if (num_heap_slots() == 0) return 0; | 1376 if (num_heap_slots() == 0) return 0; |
1377 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1377 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1378 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1378 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
1379 } | 1379 } |
1380 | 1380 |
1381 } } // namespace v8::internal | 1381 } } // namespace v8::internal |
OLD | NEW |