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

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

Issue 2818273002: Remove parent_level field of function type parameters. (Closed)
Patch Set: Created 3 years, 8 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
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_reader.h" 5 #include "vm/kernel_reader.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 TypeArguments::Handle(Z, TypeArguments::null()); 236 TypeArguments::Handle(Z, TypeArguments::null());
237 intptr_t num_type_parameters = kernel_klass->type_parameters().length(); 237 intptr_t num_type_parameters = kernel_klass->type_parameters().length();
238 if (num_type_parameters > 0) { 238 if (num_type_parameters > 0) {
239 dart::TypeParameter& parameter = dart::TypeParameter::Handle(Z); 239 dart::TypeParameter& parameter = dart::TypeParameter::Handle(Z);
240 Type& null_bound = Type::Handle(Z, Type::null()); 240 Type& null_bound = Type::Handle(Z, Type::null());
241 241
242 // Step a) Create array of [TypeParameter] objects (without bound). 242 // Step a) Create array of [TypeParameter] objects (without bound).
243 type_parameters = TypeArguments::New(num_type_parameters); 243 type_parameters = TypeArguments::New(num_type_parameters);
244 for (intptr_t i = 0; i < num_type_parameters; i++) { 244 for (intptr_t i = 0; i < num_type_parameters; i++) {
245 parameter = dart::TypeParameter::New( 245 parameter = dart::TypeParameter::New(
246 *klass, Function::Handle(Z), i, 0, 246 *klass, Function::Handle(Z), i,
247 H.DartSymbol(kernel_klass->type_parameters()[i]->name()), null_bound, 247 H.DartSymbol(kernel_klass->type_parameters()[i]->name()), null_bound,
248 TokenPosition::kNoSource); 248 TokenPosition::kNoSource);
249 type_parameters.SetTypeAt(i, parameter); 249 type_parameters.SetTypeAt(i, parameter);
250 } 250 }
251 klass->set_type_parameters(type_parameters); 251 klass->set_type_parameters(type_parameters);
252 252
253 // Step b) Fill in the bounds of all [TypeParameter]s. 253 // Step b) Fill in the bounds of all [TypeParameter]s.
254 for (intptr_t i = 0; i < num_type_parameters; i++) { 254 for (intptr_t i = 0; i < num_type_parameters; i++) {
255 TypeParameter* kernel_parameter = kernel_klass->type_parameters()[i]; 255 TypeParameter* kernel_parameter = kernel_klass->type_parameters()[i];
256 // TODO(github.com/dart-lang/kernel/issues/42): This should be handled 256 // TODO(github.com/dart-lang/kernel/issues/42): This should be handled
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 initializer_fun.set_is_debuggable(false); 864 initializer_fun.set_is_debuggable(false);
865 initializer_fun.set_is_reflectable(false); 865 initializer_fun.set_is_reflectable(false);
866 initializer_fun.set_is_inlinable(false); 866 initializer_fun.set_is_inlinable(false);
867 return new (zone) ParsedFunction(thread, initializer_fun); 867 return new (zone) ParsedFunction(thread, initializer_fun);
868 } 868 }
869 869
870 870
871 } // namespace kernel 871 } // namespace kernel
872 } // namespace dart 872 } // namespace dart
873 #endif // !defined(DART_PRECOMPILED_RUNTIME) 873 #endif // !defined(DART_PRECOMPILED_RUNTIME)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698