| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/debug/debug-scopes.h" | 5 #include "src/debug/debug-scopes.h" |
| 6 | 6 |
| 7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
| 8 #include "src/frames-inl.h" | 8 #include "src/frames-inl.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 554 |
| 555 // Set the context local variable value. | 555 // Set the context local variable value. |
| 556 bool ScopeIterator::SetContextLocalValue(Handle<ScopeInfo> scope_info, | 556 bool ScopeIterator::SetContextLocalValue(Handle<ScopeInfo> scope_info, |
| 557 Handle<Context> context, | 557 Handle<Context> context, |
| 558 Handle<String> variable_name, | 558 Handle<String> variable_name, |
| 559 Handle<Object> new_value) { | 559 Handle<Object> new_value) { |
| 560 for (int i = 0; i < scope_info->ContextLocalCount(); i++) { | 560 for (int i = 0; i < scope_info->ContextLocalCount(); i++) { |
| 561 Handle<String> next_name(scope_info->ContextLocalName(i)); | 561 Handle<String> next_name(scope_info->ContextLocalName(i)); |
| 562 if (String::Equals(variable_name, next_name)) { | 562 if (String::Equals(variable_name, next_name)) { |
| 563 VariableMode mode; | 563 VariableMode mode; |
| 564 VariableLocation location; | |
| 565 InitializationFlag init_flag; | 564 InitializationFlag init_flag; |
| 566 MaybeAssignedFlag maybe_assigned_flag; | 565 MaybeAssignedFlag maybe_assigned_flag; |
| 567 int context_index = | 566 int context_index = ScopeInfo::ContextSlotIndex( |
| 568 ScopeInfo::ContextSlotIndex(scope_info, next_name, &mode, &location, | 567 scope_info, next_name, &mode, &init_flag, &maybe_assigned_flag); |
| 569 &init_flag, &maybe_assigned_flag); | |
| 570 context->set(context_index, *new_value); | 568 context->set(context_index, *new_value); |
| 571 return true; | 569 return true; |
| 572 } | 570 } |
| 573 } | 571 } |
| 574 | 572 |
| 575 return false; | 573 return false; |
| 576 } | 574 } |
| 577 | 575 |
| 578 | 576 |
| 579 bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name, | 577 bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name, |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 isolate_, value, Object::GetPropertyOrElement(extension, key), false); | 779 isolate_, value, Object::GetPropertyOrElement(extension, key), false); |
| 782 RETURN_ON_EXCEPTION_VALUE( | 780 RETURN_ON_EXCEPTION_VALUE( |
| 783 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( | 781 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( |
| 784 scope_object, key, value, NONE), false); | 782 scope_object, key, value, NONE), false); |
| 785 } | 783 } |
| 786 return true; | 784 return true; |
| 787 } | 785 } |
| 788 | 786 |
| 789 } // namespace internal | 787 } // namespace internal |
| 790 } // namespace v8 | 788 } // namespace v8 |
| OLD | NEW |