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

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

Issue 2958833003: Allocate local variable holding type arguments in generic functions in Kernel. (Closed)
Patch Set: Created 3 years, 5 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 | « runtime/vm/compiler.cc ('k') | runtime/vm/parser.cc » ('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 "vm/kernel_binary_flowgraph.h" 5 #include "vm/kernel_binary_flowgraph.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/longjump.h" 8 #include "vm/longjump.h"
9 #include "vm/object_store.h" 9 #include "vm/object_store.h"
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 LocalScope* enclosing_scope = NULL; 103 LocalScope* enclosing_scope = NULL;
104 if (function.IsLocalFunction()) { 104 if (function.IsLocalFunction()) {
105 enclosing_scope = LocalScope::RestoreOuterScope( 105 enclosing_scope = LocalScope::RestoreOuterScope(
106 ContextScope::Handle(Z, function.context_scope())); 106 ContextScope::Handle(Z, function.context_scope()));
107 } 107 }
108 current_function_scope_ = scope_ = new (Z) LocalScope(enclosing_scope, 0, 0); 108 current_function_scope_ = scope_ = new (Z) LocalScope(enclosing_scope, 0, 0);
109 scope_->set_begin_token_pos(function.token_pos()); 109 scope_->set_begin_token_pos(function.token_pos());
110 scope_->set_end_token_pos(function.end_token_pos()); 110 scope_->set_end_token_pos(function.end_token_pos());
111 111
112 // Add function type arguments variable before current context variable.
113 if (FLAG_reify_generic_functions && function.IsGeneric()) {
114 LocalVariable* type_args_var = MakeVariable(
115 TokenPosition::kNoSource, TokenPosition::kNoSource,
116 Symbols::FunctionTypeArgumentsVar(), AbstractType::dynamic_type());
117 scope_->AddVariable(type_args_var);
118 parsed_function_->set_function_type_arguments(type_args_var);
119 }
120
112 LocalVariable* context_var = parsed_function->current_context_var(); 121 LocalVariable* context_var = parsed_function->current_context_var();
113 context_var->set_is_forced_stack(); 122 context_var->set_is_forced_stack();
114 scope_->AddVariable(context_var); 123 scope_->AddVariable(context_var);
115 124
116 parsed_function->SetNodeSequence( 125 parsed_function->SetNodeSequence(
117 new SequenceNode(TokenPosition::kNoSource, scope_)); 126 new SequenceNode(TokenPosition::kNoSource, scope_));
118 127
119 intptr_t parent_offset = -1; 128 intptr_t parent_offset = -1;
120 builder_->SetOffset(kernel_offset_); 129 builder_->SetOffset(kernel_offset_);
121 130
(...skipping 6804 matching lines...) Expand 10 before | Expand all | Expand 10 after
6926 metadata_values.SetAt(i, value); 6935 metadata_values.SetAt(i, value);
6927 } 6936 }
6928 6937
6929 return metadata_values.raw(); 6938 return metadata_values.raw();
6930 } 6939 }
6931 6940
6932 } // namespace kernel 6941 } // namespace kernel
6933 } // namespace dart 6942 } // namespace dart
6934 6943
6935 #endif // !defined(DART_PRECOMPILED_RUNTIME) 6944 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698