| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 Handle<Context> context, | 367 Handle<Context> context, |
| 368 Handle<JSObject> scope_object) { | 368 Handle<JSObject> scope_object) { |
| 369 Isolate* isolate = scope_info->GetIsolate(); | 369 Isolate* isolate = scope_info->GetIsolate(); |
| 370 int local_count = scope_info->ContextLocalCount(); | 370 int local_count = scope_info->ContextLocalCount(); |
| 371 if (local_count == 0) return true; | 371 if (local_count == 0) return true; |
| 372 // Fill all context locals to the context extension. | 372 // Fill all context locals to the context extension. |
| 373 int start = scope_info->ContextLocalNameEntriesIndex(); | 373 int start = scope_info->ContextLocalNameEntriesIndex(); |
| 374 int end = start + local_count; | 374 int end = start + local_count; |
| 375 for (int i = start; i < end; ++i) { | 375 for (int i = start; i < end; ++i) { |
| 376 int context_index = Context::MIN_CONTEXT_SLOTS + i - start; | 376 int context_index = Context::MIN_CONTEXT_SLOTS + i - start; |
| 377 RETURN_IF_EMPTY_HANDLE_VALUE( | 377 Handle<Object> result = Runtime::SetObjectProperty( |
| 378 isolate, | 378 isolate, |
| 379 SetProperty(isolate, | 379 scope_object, |
| 380 scope_object, | 380 Handle<String>(String::cast(scope_info->get(i))), |
| 381 Handle<String>(String::cast(scope_info->get(i))), | 381 Handle<Object>(context->get(context_index), isolate), |
| 382 Handle<Object>(context->get(context_index), isolate), | 382 ::NONE, |
| 383 ::NONE, | 383 kNonStrictMode); |
| 384 kNonStrictMode), | 384 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, result, false); |
| 385 false); | |
| 386 } | 385 } |
| 387 return true; | 386 return true; |
| 388 } | 387 } |
| 389 | 388 |
| 390 | 389 |
| 391 int ScopeInfo::ParameterEntriesIndex() { | 390 int ScopeInfo::ParameterEntriesIndex() { |
| 392 ASSERT(length() > 0); | 391 ASSERT(length() > 0); |
| 393 return kVariablePartIndex; | 392 return kVariablePartIndex; |
| 394 } | 393 } |
| 395 | 394 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } else { | 554 } else { |
| 556 ASSERT(var->index() >= 0); | 555 ASSERT(var->index() >= 0); |
| 557 info->set_index(i, var->index()); | 556 info->set_index(i, var->index()); |
| 558 } | 557 } |
| 559 } | 558 } |
| 560 ASSERT(i == info->length()); | 559 ASSERT(i == info->length()); |
| 561 return info; | 560 return info; |
| 562 } | 561 } |
| 563 | 562 |
| 564 } } // namespace v8::internal | 563 } } // namespace v8::internal |
| OLD | NEW |