| 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/invocation_mirror.h" | 5 #include "lib/invocation_mirror.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) { | 299 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) { |
| 300 return CreateMirrorSystem(); | 300 return CreateMirrorSystem(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 | 303 |
| 304 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { | 304 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { |
| 305 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); | 305 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); |
| 306 const Class& cls = Class::Handle(type.type_class()); | 306 const Class& cls = Class::Handle(type.type_class()); |
| 307 ASSERT(!cls.IsNull()); | 307 ASSERT(!cls.IsNull()); |
| 308 return CreateClassMirror(cls, | 308 // Strip the type for generics only. |
| 309 AbstractType::Handle(), | 309 if (cls.NumTypeParameters() == 0) { |
| 310 Instance::null_instance()); | 310 return CreateClassMirror(cls, |
| 311 type, |
| 312 Object::null_instance()); |
| 313 } else { |
| 314 return CreateClassMirror(cls, |
| 315 AbstractType::Handle(), |
| 316 Object::null_instance()); |
| 317 } |
| 311 } | 318 } |
| 312 | 319 |
| 313 | 320 |
| 314 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalTypeMirror, 1) { | 321 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalTypeMirror, 1) { |
| 315 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 322 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 316 return CreateTypeMirror(type); | 323 return CreateTypeMirror(type); |
| 317 } | 324 } |
| 318 | 325 |
| 319 | 326 |
| 320 static void ThrowMirroredCompilationError(const String& message) { | 327 static void ThrowMirroredCompilationError(const String& message) { |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 } | 1301 } |
| 1295 | 1302 |
| 1296 | 1303 |
| 1297 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1304 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1298 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1305 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1299 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1306 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1300 return field.type(); | 1307 return field.type(); |
| 1301 } | 1308 } |
| 1302 | 1309 |
| 1303 } // namespace dart | 1310 } // namespace dart |
| OLD | NEW |