Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Side by Side Diff: runtime/vm/kernel_to_il.cc

Issue 2640353002: VM: [Kernel] Ensure we don't capture :stack_trace variable in yielding functions (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/language/language_kernel.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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)
OLDNEW
« no previous file with comments | « no previous file | tests/language/language_kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698