| 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/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 #include "vm/port.h" | 10 #include "vm/port.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 DEFINE_NATIVE_ENTRY(ClassMirror_name, 1) { | 355 DEFINE_NATIVE_ENTRY(ClassMirror_name, 1) { |
| 356 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 356 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 357 const Class& klass = Class::Handle(ref.GetClassReferent()); | 357 const Class& klass = Class::Handle(ref.GetClassReferent()); |
| 358 return klass.UserVisibleName(); | 358 return klass.UserVisibleName(); |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| 362 DEFINE_NATIVE_ENTRY(ClassMirror_library, 1) { | 362 DEFINE_NATIVE_ENTRY(ClassMirror_library, 1) { |
| 363 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 363 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 364 const Class& klass = Class::Handle(ref.GetClassReferent()); | 364 const Class& klass = Class::Handle(ref.GetClassReferent()); |
| 365 return CreateLibraryMirror(Library::Handle(klass.library())); | 365 const Library& library = Library::Handle(klass.library()); |
| 366 // TODO(rmacnak): Revisit when we decide what to do about |
| 367 // reflectClass(dynamic). |
| 368 if (library.IsNull()) { |
| 369 return Instance::null(); |
| 370 } |
| 371 return CreateLibraryMirror(library); |
| 366 } | 372 } |
| 367 | 373 |
| 368 | 374 |
| 369 DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) { | 375 DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) { |
| 370 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 376 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 371 const Class& klass = Class::Handle(ref.GetClassReferent()); | 377 const Class& klass = Class::Handle(ref.GetClassReferent()); |
| 372 return klass.super_type(); | 378 return klass.super_type(); |
| 373 } | 379 } |
| 374 | 380 |
| 375 | 381 |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1187 | 1193 |
| 1188 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1194 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1189 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1195 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1190 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1196 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1191 | 1197 |
| 1192 const AbstractType& type = AbstractType::Handle(field.type()); | 1198 const AbstractType& type = AbstractType::Handle(field.type()); |
| 1193 return CreateTypeMirror(type); | 1199 return CreateTypeMirror(type); |
| 1194 } | 1200 } |
| 1195 | 1201 |
| 1196 } // namespace dart | 1202 } // namespace dart |
| OLD | NEW |