Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 <map> | 5 #include <map> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "vm/kernel_to_il.h" | 9 #include "vm/kernel_to_il.h" |
| 10 | 10 |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 | 664 |
| 665 | 665 |
| 666 void ScopeBuilder::VisitFunctionNode(FunctionNode* node) { | 666 void ScopeBuilder::VisitFunctionNode(FunctionNode* node) { |
| 667 List<TypeParameter>& type_parameters = node->type_parameters(); | 667 List<TypeParameter>& type_parameters = node->type_parameters(); |
| 668 for (intptr_t i = 0; i < type_parameters.length(); ++i) { | 668 for (intptr_t i = 0; i < type_parameters.length(); ++i) { |
| 669 VisitTypeParameter(type_parameters[i]); | 669 VisitTypeParameter(type_parameters[i]); |
| 670 } | 670 } |
| 671 | 671 |
| 672 if (node->async_marker() == FunctionNode::kSyncYielding) { | 672 if (node->async_marker() == FunctionNode::kSyncYielding) { |
| 673 LocalScope* scope = parsed_function_->node_sequence()->scope(); | 673 LocalScope* scope = parsed_function_->node_sequence()->scope(); |
| 674 intptr_t offset = parsed_function_->function().num_fixed_parameters(); | |
| 674 for (intptr_t i = 0; | 675 for (intptr_t i = 0; |
| 675 i < parsed_function_->function().NumOptionalPositionalParameters(); | 676 i < parsed_function_->function().NumOptionalPositionalParameters(); |
| 676 i++) { | 677 i++) { |
| 677 scope->VariableAt(i)->set_is_forced_stack(); | 678 scope->VariableAt(offset + i)->set_is_forced_stack(); |
|
Florian Schneider
2017/01/19 17:57:16
Can we get rid of is_forced_stack?
(see the discu
| |
| 678 } | 679 } |
| 679 } | 680 } |
| 680 | 681 |
| 681 // Do not visit the positional and named parameters, because they've | 682 // Do not visit the positional and named parameters, because they've |
| 682 // already been added to the scope. | 683 // already been added to the scope. |
| 683 if (node->body() != NULL) { | 684 if (node->body() != NULL) { |
| 684 node->body()->AcceptStatementVisitor(this); | 685 node->body()->AcceptStatementVisitor(this); |
| 685 } | 686 } |
| 686 | 687 |
| 687 // Ensure that :await_jump_var, :await_ctx_var and :async_op are captured. | 688 // Ensure that :await_jump_var, :await_ctx_var and :async_op are captured. |
| (...skipping 5356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6044 thread->clear_sticky_error(); | 6045 thread->clear_sticky_error(); |
| 6045 return error.raw(); | 6046 return error.raw(); |
| 6046 } | 6047 } |
| 6047 } | 6048 } |
| 6048 | 6049 |
| 6049 | 6050 |
| 6050 } // namespace kernel | 6051 } // namespace kernel |
| 6051 } // namespace dart | 6052 } // namespace dart |
| 6052 | 6053 |
| 6053 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 6054 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| OLD | NEW |