Index: src/contexts.cc |
=================================================================== |
--- src/contexts.cc (revision 5039) |
+++ src/contexts.cc (working copy) |
@@ -120,9 +120,9 @@ |
// we have context-local slots |
// check non-parameter locals in context |
- Handle<Code> code(context->closure()->code()); |
+ Handle<Object> scope_info(context->closure()->shared()->scope_info()); |
Variable::Mode mode; |
- int index = ScopeInfo<>::ContextSlotIndex(*code, *name, &mode); |
+ int index = ScopeInfo<>::ContextSlotIndex(*scope_info, *name, &mode); |
ASSERT(index < 0 || index >= MIN_CONTEXT_SLOTS); |
if (index >= 0) { |
// slot found |
@@ -150,11 +150,11 @@ |
} |
// check parameter locals in context |
- int param_index = ScopeInfo<>::ParameterIndex(*code, *name); |
+ int param_index = ScopeInfo<>::ParameterIndex(*scope_info, *name); |
if (param_index >= 0) { |
// slot found. |
int index = |
- ScopeInfo<>::ContextSlotIndex(*code, |
+ ScopeInfo<>::ContextSlotIndex(*scope_info, |
Heap::arguments_shadow_symbol(), |
NULL); |
ASSERT(index >= 0); // arguments must exist and be in the heap context |
@@ -170,7 +170,7 @@ |
// check intermediate context (holding only the function name variable) |
if (follow_context_chain) { |
- int index = ScopeInfo<>::FunctionContextSlotIndex(*code, *name); |
+ int index = ScopeInfo<>::FunctionContextSlotIndex(*scope_info, *name); |
if (index >= 0) { |
// slot found |
if (FLAG_trace_contexts) { |
@@ -216,18 +216,18 @@ |
ASSERT(context->is_function_context()); |
// Check non-parameter locals. |
- Handle<Code> code(context->closure()->code()); |
+ Handle<Object> scope_info(context->closure()->shared()->scope_info()); |
Variable::Mode mode; |
- int index = ScopeInfo<>::ContextSlotIndex(*code, *name, &mode); |
+ int index = ScopeInfo<>::ContextSlotIndex(*scope_info, *name, &mode); |
ASSERT(index < 0 || index >= MIN_CONTEXT_SLOTS); |
if (index >= 0) return false; |
// Check parameter locals. |
- int param_index = ScopeInfo<>::ParameterIndex(*code, *name); |
+ int param_index = ScopeInfo<>::ParameterIndex(*scope_info, *name); |
if (param_index >= 0) return false; |
// Check context only holding the function name variable. |
- index = ScopeInfo<>::FunctionContextSlotIndex(*code, *name); |
+ index = ScopeInfo<>::FunctionContextSlotIndex(*scope_info, *name); |
if (index >= 0) return false; |
context = Context::cast(context->closure()->context()); |
} |