| 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 "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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 *klass, Function::Handle(Z), i, | 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 // There is no dynamic bound, only Object. | 256 // TODO(github.com/dart-lang/kernel/issues/42): This should be handled |
| 257 // TODO(27590): Should we fix this in the kernel IR generator? | 257 // by the frontend. |
| 258 if (kernel_parameter->bound()->IsDynamicType()) { | 258 if (kernel_parameter->bound()->IsDynamicType()) { |
| 259 parameter ^= type_parameters.TypeAt(i); | 259 parameter ^= type_parameters.TypeAt(i); |
| 260 parameter.set_bound(Type::Handle(Z, I->object_store()->object_type())); | 260 parameter.set_bound(Type::Handle(Z, I->object_store()->object_type())); |
| 261 } else { | 261 } else { |
| 262 AbstractType& bound = | 262 AbstractType& bound = |
| 263 T.TranslateTypeWithoutFinalization(kernel_parameter->bound()); | 263 T.TranslateTypeWithoutFinalization(kernel_parameter->bound()); |
| 264 if (bound.IsMalformedOrMalbounded()) { | 264 if (bound.IsMalformedOrMalbounded()) { |
| 265 bound = I->object_store()->object_type(); | 265 bound = I->object_store()->object_type(); |
| 266 } | 266 } |
| 267 | 267 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 if (kind == Procedure::kIncompleteProcedure) { | 689 if (kind == Procedure::kIncompleteProcedure) { |
| 690 return RawFunction::kSignatureFunction; | 690 return RawFunction::kSignatureFunction; |
| 691 } else { | 691 } else { |
| 692 ASSERT(0 <= kind && kind <= Procedure::kFactory); | 692 ASSERT(0 <= kind && kind <= Procedure::kFactory); |
| 693 return static_cast<RawFunction::Kind>(lookuptable[kind]); | 693 return static_cast<RawFunction::Kind>(lookuptable[kind]); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 | 696 |
| 697 } // namespace kernel | 697 } // namespace kernel |
| 698 } // namespace dart | 698 } // namespace dart |
| OLD | NEW |