OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "lib/mirrors.h" | 5 #include "lib/mirrors.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
867 "Type arguments must be instances of Type."))); | 867 "Type arguments must be instances of Type."))); |
868 Exceptions::ThrowByType(Exceptions::kArgumentValue, error_args); | 868 Exceptions::ThrowByType(Exceptions::kArgumentValue, error_args); |
869 UNREACHABLE(); | 869 UNREACHABLE(); |
870 } | 870 } |
871 type_arg ^= args.At(i); | 871 type_arg ^= args.At(i); |
872 type_args_obj.SetTypeAt(i, type_arg); | 872 type_args_obj.SetTypeAt(i, type_arg); |
873 } | 873 } |
874 | 874 |
875 Type& instantiated_type = | 875 Type& instantiated_type = |
876 Type::Handle(Type::New(clz, type_args_obj, TokenPosition::kNoSource)); | 876 Type::Handle(Type::New(clz, type_args_obj, TokenPosition::kNoSource)); |
877 instantiated_type ^= ClassFinalizer::FinalizeType( | 877 instantiated_type ^= ClassFinalizer::FinalizeType(clz, instantiated_type); |
878 clz, instantiated_type, ClassFinalizer::kCanonicalize); | |
879 if (instantiated_type.IsMalbounded()) { | 878 if (instantiated_type.IsMalbounded()) { |
880 const LanguageError& type_error = | 879 const LanguageError& type_error = |
881 LanguageError::Handle(instantiated_type.error()); | 880 LanguageError::Handle(instantiated_type.error()); |
882 const Array& error_args = Array::Handle(Array::New(3)); | 881 const Array& error_args = Array::Handle(Array::New(3)); |
883 error_args.SetAt(0, args); | 882 error_args.SetAt(0, args); |
884 error_args.SetAt(1, String::Handle(String::New("typeArguments"))); | 883 error_args.SetAt(1, String::Handle(String::New("typeArguments"))); |
885 error_args.SetAt(2, String::Handle(type_error.FormatMessage())); | 884 error_args.SetAt(2, String::Handle(type_error.FormatMessage())); |
886 Exceptions::ThrowByType(Exceptions::kArgumentValue, error_args); | 885 Exceptions::ThrowByType(Exceptions::kArgumentValue, error_args); |
887 UNREACHABLE(); | 886 UNREACHABLE(); |
888 } | 887 } |
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 | 2087 |
2089 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2088 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2090 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2091 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2090 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2092 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2091 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
2093 } | 2092 } |
2094 | 2093 |
2095 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME | 2094 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME |
2096 | 2095 |
2097 } // namespace dart | 2096 } // namespace dart |
OLD | NEW |