| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // check parameter locals in context | 156 // check parameter locals in context |
| 157 int param_index = scope_info->ParameterIndex(*name); | 157 int param_index = scope_info->ParameterIndex(*name); |
| 158 if (param_index >= 0) { | 158 if (param_index >= 0) { |
| 159 // slot found. | 159 // slot found. |
| 160 int index = scope_info->ContextSlotIndex( | 160 int index = scope_info->ContextSlotIndex( |
| 161 isolate->heap()->arguments_shadow_symbol(), NULL); | 161 isolate->heap()->arguments_shadow_symbol(), NULL); |
| 162 ASSERT(index >= 0); // arguments must exist and be in the heap context | 162 ASSERT(index >= 0); // arguments must exist and be in the heap context |
| 163 Handle<JSObject> arguments(JSObject::cast(context->get(index)), | 163 Handle<JSObject> arguments(JSObject::cast(context->get(index)), |
| 164 isolate); | 164 isolate); |
| 165 ASSERT(arguments->HasLocalProperty(isolate->heap()->length_symbol())); | |
| 166 if (FLAG_trace_contexts) { | 165 if (FLAG_trace_contexts) { |
| 167 PrintF("=> found parameter %d in arguments object\n", param_index); | 166 PrintF("=> found parameter %d in arguments object\n", param_index); |
| 168 } | 167 } |
| 169 *index_ = param_index; | 168 *index_ = param_index; |
| 170 *attributes = NONE; | 169 *attributes = NONE; |
| 171 return arguments; | 170 return arguments; |
| 172 } | 171 } |
| 173 | 172 |
| 174 // check intermediate context (holding only the function name variable) | 173 // check intermediate context (holding only the function name variable) |
| 175 if (follow_context_chain) { | 174 if (follow_context_chain) { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // During bootstrapping we allow all objects to pass as global | 338 // During bootstrapping we allow all objects to pass as global |
| 340 // objects. This is necessary to fix circular dependencies. | 339 // objects. This is necessary to fix circular dependencies. |
| 341 Isolate* isolate = Isolate::Current(); | 340 Isolate* isolate = Isolate::Current(); |
| 342 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || | 341 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || |
| 343 isolate->bootstrapper()->IsActive() || | 342 isolate->bootstrapper()->IsActive() || |
| 344 object->IsGlobalObject(); | 343 object->IsGlobalObject(); |
| 345 } | 344 } |
| 346 #endif | 345 #endif |
| 347 | 346 |
| 348 } } // namespace v8::internal | 347 } } // namespace v8::internal |
| OLD | NEW |