| 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/compiler.h" | 8 #include "vm/compiler.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 return CreateMirrorSystem(); | 832 return CreateMirrorSystem(); |
| 833 } | 833 } |
| 834 | 834 |
| 835 | 835 |
| 836 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { | 836 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { |
| 837 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 837 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 838 ASSERT(!type.IsMalformed()); | 838 ASSERT(!type.IsMalformed()); |
| 839 ASSERT(type.IsFinalized()); | 839 ASSERT(type.IsFinalized()); |
| 840 ASSERT(type.HasResolvedTypeClass()); | 840 ASSERT(type.HasResolvedTypeClass()); |
| 841 const Class& cls = Class::Handle(type.type_class()); | 841 const Class& cls = Class::Handle(type.type_class()); |
| 842 if (cls.IsDynamicClass() || cls.IsVoidClass()) { | 842 ASSERT(!cls.IsNull()); |
| 843 if (cls.IsDynamicClass() || |
| 844 cls.IsVoidClass() || |
| 845 (cls.IsSignatureClass() && !cls.IsCanonicalSignatureClass())) { |
| 843 Exceptions::ThrowArgumentError(type); | 846 Exceptions::ThrowArgumentError(type); |
| 844 UNREACHABLE(); | 847 UNREACHABLE(); |
| 845 } | 848 } |
| 846 const AbstractType& stripped_type = AbstractType::Handle(cls.RareType()); | 849 const AbstractType& stripped_type = AbstractType::Handle(cls.RareType()); |
| 847 return CreateClassMirror(cls, | 850 return CreateClassMirror(cls, |
| 848 stripped_type, | 851 stripped_type, |
| 849 Bool::True(), // is_declaration | 852 Bool::True(), // is_declaration |
| 850 Object::null_instance()); | 853 Object::null_instance()); |
| 851 } | 854 } |
| 852 | 855 |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 } | 1857 } |
| 1855 | 1858 |
| 1856 | 1859 |
| 1857 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1860 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1858 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1861 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1859 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1862 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1860 return field.type(); | 1863 return field.type(); |
| 1861 } | 1864 } |
| 1862 | 1865 |
| 1863 } // namespace dart | 1866 } // namespace dart |
| OLD | NEW |