| 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 | 734 |
| 735 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) { | 735 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) { |
| 736 return CreateMirrorSystem(); | 736 return CreateMirrorSystem(); |
| 737 } | 737 } |
| 738 | 738 |
| 739 | 739 |
| 740 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { | 740 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { |
| 741 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); | 741 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); |
| 742 const Class& cls = Class::Handle(type.type_class()); | 742 const Class& cls = Class::Handle(type.type_class()); |
| 743 ASSERT(!cls.IsNull()); | 743 ASSERT(!cls.IsNull()); |
| 744 if (cls.IsDynamicClass() || cls.IsVoidClass()) { | 744 if (cls.IsDynamicClass() || |
| 745 cls.IsVoidClass() || |
| 746 (cls.IsSignatureClass() && !cls.IsCanonicalSignatureClass())) { |
| 745 Exceptions::ThrowArgumentError(type); | 747 Exceptions::ThrowArgumentError(type); |
| 746 UNREACHABLE(); | 748 UNREACHABLE(); |
| 747 } | 749 } |
| 748 const Type& stripped_type = Type::Handle(cls.RareType()); | 750 const Type& stripped_type = Type::Handle(cls.RareType()); |
| 749 return CreateClassMirror(cls, | 751 return CreateClassMirror(cls, |
| 750 stripped_type, | 752 stripped_type, |
| 751 Bool::True(), // is_declaration | 753 Bool::True(), // is_declaration |
| 752 Object::null_instance()); | 754 Object::null_instance()); |
| 753 } | 755 } |
| 754 | 756 |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 } | 1697 } |
| 1696 | 1698 |
| 1697 | 1699 |
| 1698 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1700 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1699 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1701 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1700 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1702 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1701 return field.type(); | 1703 return field.type(); |
| 1702 } | 1704 } |
| 1703 | 1705 |
| 1704 } // namespace dart | 1706 } // namespace dart |
| OLD | NEW |