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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 } | 1199 } |
1200 } | 1200 } |
1201 | 1201 |
1202 return member_mirrors.raw(); | 1202 return member_mirrors.raw(); |
1203 } | 1203 } |
1204 | 1204 |
1205 | 1205 |
1206 DEFINE_NATIVE_ENTRY(ClassMirror_type_variables, 1) { | 1206 DEFINE_NATIVE_ENTRY(ClassMirror_type_variables, 1) { |
1207 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1207 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
1208 const Class& klass = Class::Handle(ref.GetClassReferent()); | 1208 const Class& klass = Class::Handle(ref.GetClassReferent()); |
| 1209 const Error& error = Error::Handle(zone, klass.EnsureIsFinalized(thread)); |
| 1210 if (!error.IsNull()) { |
| 1211 Exceptions::PropagateError(error); |
| 1212 UNREACHABLE(); |
| 1213 } |
1209 return CreateTypeVariableList(klass); | 1214 return CreateTypeVariableList(klass); |
1210 } | 1215 } |
1211 | 1216 |
1212 | 1217 |
1213 DEFINE_NATIVE_ENTRY(ClassMirror_type_arguments, 1) { | 1218 DEFINE_NATIVE_ENTRY(ClassMirror_type_arguments, 1) { |
1214 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 1219 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
1215 | 1220 |
1216 const Class& cls = Class::Handle(type.type_class()); | 1221 const Class& cls = Class::Handle(type.type_class()); |
1217 const intptr_t num_params = cls.NumTypeParameters(); | 1222 const intptr_t num_params = cls.NumTypeParameters(); |
1218 | 1223 |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2106 } | 2111 } |
2107 | 2112 |
2108 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2113 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2109 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2114 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2110 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2115 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2111 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); | 2116 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); |
2112 } | 2117 } |
2113 | 2118 |
2114 | 2119 |
2115 } // namespace dart | 2120 } // namespace dart |
OLD | NEW |