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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 return outer_scope; | 609 return outer_scope; |
610 } | 610 } |
611 | 611 |
612 | 612 |
613 void LocalScope::CaptureLocalVariables(LocalScope* top_scope) { | 613 void LocalScope::CaptureLocalVariables(LocalScope* top_scope) { |
614 ASSERT(top_scope->function_level() == function_level()); | 614 ASSERT(top_scope->function_level() == function_level()); |
615 LocalScope* scope = this; | 615 LocalScope* scope = this; |
616 while (scope != top_scope->parent()) { | 616 while (scope != top_scope->parent()) { |
617 for (intptr_t i = 0; i < scope->num_variables(); i++) { | 617 for (intptr_t i = 0; i < scope->num_variables(); i++) { |
618 LocalVariable* variable = scope->VariableAt(i); | 618 LocalVariable* variable = scope->VariableAt(i); |
619 if ((variable->name().raw() == Symbols::StackTraceVar().raw()) || | 619 if (variable->is_forced_stack() || |
| 620 (variable->name().raw() == Symbols::StackTraceVar().raw()) || |
620 (variable->name().raw() == Symbols::ExceptionVar().raw()) || | 621 (variable->name().raw() == Symbols::ExceptionVar().raw()) || |
621 (variable->name().raw() == Symbols::SavedTryContextVar().raw())) { | 622 (variable->name().raw() == Symbols::SavedTryContextVar().raw())) { |
622 // Don't capture those variables because the VM expects them to be on | 623 // Don't capture those variables because the VM expects them to be on |
623 // the stack. | 624 // the stack. |
624 continue; | 625 continue; |
625 } | 626 } |
626 scope->CaptureVariable(variable); | 627 scope->CaptureVariable(variable); |
627 } | 628 } |
628 scope = scope->parent(); | 629 scope = scope->parent(); |
629 } | 630 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 return fixed_parameter_count - (index() - kParamEndSlotFromFp); | 677 return fixed_parameter_count - (index() - kParamEndSlotFromFp); |
677 } else { | 678 } else { |
678 // Shift negative indexes so that the lowest one is 0 (they are still | 679 // Shift negative indexes so that the lowest one is 0 (they are still |
679 // non-positive). | 680 // non-positive). |
680 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); | 681 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); |
681 } | 682 } |
682 } | 683 } |
683 | 684 |
684 | 685 |
685 } // namespace dart | 686 } // namespace dart |
OLD | NEW |