| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 case Variable::DYNAMIC_GLOBAL: UNREACHABLE(); break; | 142 case Variable::DYNAMIC_GLOBAL: UNREACHABLE(); break; |
| 143 case Variable::DYNAMIC_LOCAL: UNREACHABLE(); break; | 143 case Variable::DYNAMIC_LOCAL: UNREACHABLE(); break; |
| 144 case Variable::TEMPORARY: UNREACHABLE(); break; | 144 case Variable::TEMPORARY: UNREACHABLE(); break; |
| 145 } | 145 } |
| 146 return context; | 146 return context; |
| 147 } | 147 } |
| 148 | 148 |
| 149 // check parameter locals in context | 149 // check parameter locals in context |
| 150 int param_index = ScopeInfo<>::ParameterIndex(*code, *name); | 150 int param_index = ScopeInfo<>::ParameterIndex(*code, *name); |
| 151 if (param_index >= 0) { | 151 if (param_index >= 0) { |
| 152 // slot found | 152 // slot found. |
| 153 int index = | 153 int index = |
| 154 ScopeInfo<>::ContextSlotIndex(*code, | 154 ScopeInfo<>::ContextSlotIndex(*code, |
| 155 Heap::arguments_shadow_symbol(), | 155 Heap::arguments_shadow_symbol(), |
| 156 NULL); | 156 NULL); |
| 157 ASSERT(index >= 0); // arguments must exist and be in the heap context | 157 ASSERT(index >= 0); // arguments must exist and be in the heap context |
| 158 Handle<JSObject> arguments(JSObject::cast(context->get(index))); | 158 Handle<JSObject> arguments(JSObject::cast(context->get(index))); |
| 159 ASSERT(arguments->HasLocalProperty(Heap::length_symbol())); | 159 ASSERT(arguments->HasLocalProperty(Heap::length_symbol())); |
| 160 if (FLAG_trace_contexts) { | 160 if (FLAG_trace_contexts) { |
| 161 PrintF("=> found parameter %d in arguments object\n", param_index); | 161 PrintF("=> found parameter %d in arguments object\n", param_index); |
| 162 } | 162 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 | 245 |
| 246 bool Context::IsBootstrappingOrGlobalObject(Object* object) { | 246 bool Context::IsBootstrappingOrGlobalObject(Object* object) { |
| 247 // During bootstrapping we allow all objects to pass as global | 247 // During bootstrapping we allow all objects to pass as global |
| 248 // objects. This is necessary to fix circular dependencies. | 248 // objects. This is necessary to fix circular dependencies. |
| 249 return Bootstrapper::IsActive() || object->IsGlobalObject(); | 249 return Bootstrapper::IsActive() || object->IsGlobalObject(); |
| 250 } | 250 } |
| 251 #endif | 251 #endif |
| 252 | 252 |
| 253 } } // namespace v8::internal | 253 } } // namespace v8::internal |
| OLD | NEW |