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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 return SetCatchVariableValue(variable_name, new_value); | 356 return SetCatchVariableValue(variable_name, new_value); |
357 case ScopeIterator::ScopeTypeClosure: | 357 case ScopeIterator::ScopeTypeClosure: |
358 return SetClosureVariableValue(variable_name, new_value); | 358 return SetClosureVariableValue(variable_name, new_value); |
359 case ScopeIterator::ScopeTypeScript: | 359 case ScopeIterator::ScopeTypeScript: |
360 return SetScriptVariableValue(variable_name, new_value); | 360 return SetScriptVariableValue(variable_name, new_value); |
361 case ScopeIterator::ScopeTypeBlock: | 361 case ScopeIterator::ScopeTypeBlock: |
362 case ScopeIterator::ScopeTypeEval: | 362 case ScopeIterator::ScopeTypeEval: |
363 return SetInnerScopeVariableValue(variable_name, new_value); | 363 return SetInnerScopeVariableValue(variable_name, new_value); |
364 case ScopeIterator::ScopeTypeModule: | 364 case ScopeIterator::ScopeTypeModule: |
365 // TODO(2399): should we implement it? | 365 // TODO(2399): should we implement it? |
| 366 // XXX |
366 break; | 367 break; |
367 } | 368 } |
368 return false; | 369 return false; |
369 } | 370 } |
370 | 371 |
371 | 372 |
372 Handle<ScopeInfo> ScopeIterator::CurrentScopeInfo() { | 373 Handle<ScopeInfo> ScopeIterator::CurrentScopeInfo() { |
373 DCHECK(!failed_); | 374 DCHECK(!failed_); |
374 if (!nested_scope_chain_.is_empty()) { | 375 if (!nested_scope_chain_.is_empty()) { |
375 return nested_scope_chain_.last().scope_info; | 376 return nested_scope_chain_.last().scope_info; |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 Handle<ScopeInfo> scope_info(context->scope_info()); | 611 Handle<ScopeInfo> scope_info(context->scope_info()); |
611 | 612 |
612 // Allocate and initialize a JSObject with all the members of the debugged | 613 // Allocate and initialize a JSObject with all the members of the debugged |
613 // module. | 614 // module. |
614 Handle<JSObject> module_scope = | 615 Handle<JSObject> module_scope = |
615 isolate_->factory()->NewJSObjectWithNullProto(); | 616 isolate_->factory()->NewJSObjectWithNullProto(); |
616 | 617 |
617 // Fill all context locals. | 618 // Fill all context locals. |
618 CopyContextLocalsToScopeObject(scope_info, context, module_scope); | 619 CopyContextLocalsToScopeObject(scope_info, context, module_scope); |
619 | 620 |
| 621 // XXX stack locals. maybe even imports/exports? |
| 622 |
620 return module_scope; | 623 return module_scope; |
621 } | 624 } |
622 | 625 |
623 bool ScopeIterator::SetParameterValue(Handle<ScopeInfo> scope_info, | 626 bool ScopeIterator::SetParameterValue(Handle<ScopeInfo> scope_info, |
624 JavaScriptFrame* frame, | 627 JavaScriptFrame* frame, |
625 Handle<String> parameter_name, | 628 Handle<String> parameter_name, |
626 Handle<Object> new_value) { | 629 Handle<Object> new_value) { |
627 // Setting stack locals of optimized frames is not supported. | 630 // Setting stack locals of optimized frames is not supported. |
628 if (frame->is_optimized()) return false; | 631 if (frame->is_optimized()) return false; |
629 HandleScope scope(isolate_); | 632 HandleScope scope(isolate_); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); | 832 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); |
830 if (beg_pos <= position && position < end_pos) { | 833 if (beg_pos <= position && position < end_pos) { |
831 GetNestedScopeChain(isolate, inner_scope, position); | 834 GetNestedScopeChain(isolate, inner_scope, position); |
832 return; | 835 return; |
833 } | 836 } |
834 } | 837 } |
835 } | 838 } |
836 | 839 |
837 } // namespace internal | 840 } // namespace internal |
838 } // namespace v8 | 841 } // namespace v8 |
OLD | NEW |