OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/scopes.h" | 5 #include "vm/scopes.h" |
6 | 6 |
7 #include "vm/object.h" | 7 #include "vm/object.h" |
8 #include "vm/stack_frame.h" | 8 #include "vm/stack_frame.h" |
9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
10 | 10 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
632 | 632 |
633 void LocalScope::CaptureLocalVariables(LocalScope* top_scope) { | 633 void LocalScope::CaptureLocalVariables(LocalScope* top_scope) { |
634 ASSERT(top_scope->function_level() == function_level()); | 634 ASSERT(top_scope->function_level() == function_level()); |
635 LocalScope* scope = this; | 635 LocalScope* scope = this; |
636 while (scope != top_scope->parent()) { | 636 while (scope != top_scope->parent()) { |
637 for (intptr_t i = 0; i < scope->num_variables(); i++) { | 637 for (intptr_t i = 0; i < scope->num_variables(); i++) { |
638 LocalVariable* variable = scope->VariableAt(i); | 638 LocalVariable* variable = scope->VariableAt(i); |
639 if (variable->is_forced_stack() || | 639 if (variable->is_forced_stack() || |
640 (variable->name().raw() == Symbols::StackTraceVar().raw()) || | 640 (variable->name().raw() == Symbols::StackTraceVar().raw()) || |
641 (variable->name().raw() == Symbols::ExceptionVar().raw()) || | 641 (variable->name().raw() == Symbols::ExceptionVar().raw()) || |
642 (variable->name().raw() == Symbols::SavedTryContextVar().raw())) { | 642 (variable->name().raw() == Symbols::SavedTryContextVar().raw()) || |
643 (variable->name().raw() == Symbols::IteratorParameter().raw())) { | |
Vyacheslav Egorov (Google)
2017/03/27 14:31:46
Can we move this to kernel_to_il.cc? We prefer to
| |
643 // Don't capture those variables because the VM expects them to be on | 644 // Don't capture those variables because the VM expects them to be on |
644 // the stack. | 645 // the stack. |
645 continue; | 646 continue; |
646 } | 647 } |
647 scope->CaptureVariable(variable); | 648 scope->CaptureVariable(variable); |
648 } | 649 } |
649 scope = scope->parent(); | 650 scope = scope->parent(); |
650 } | 651 } |
651 } | 652 } |
652 | 653 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
698 return fixed_parameter_count - (index() - kParamEndSlotFromFp); | 699 return fixed_parameter_count - (index() - kParamEndSlotFromFp); |
699 } else { | 700 } else { |
700 // Shift negative indexes so that the lowest one is 0 (they are still | 701 // Shift negative indexes so that the lowest one is 0 (they are still |
701 // non-positive). | 702 // non-positive). |
702 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); | 703 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); |
703 } | 704 } |
704 } | 705 } |
705 | 706 |
706 | 707 |
707 } // namespace dart | 708 } // namespace dart |
OLD | NEW |