| 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 if (cls.IsDynamicClass() || cls.IsVoidClass()) { |
| 843 Exceptions::ThrowArgumentError(type); | 843 Exceptions::ThrowArgumentError(type); |
| 844 UNREACHABLE(); | 844 UNREACHABLE(); |
| 845 } | 845 } |
| 846 const AbstractType& stripped_type = AbstractType::Handle(cls.RareType()); | |
| 847 return CreateClassMirror(cls, | 846 return CreateClassMirror(cls, |
| 848 stripped_type, | 847 AbstractType::Handle(cls.DeclarationType()), |
| 849 Bool::True(), // is_declaration | 848 Bool::True(), // is_declaration |
| 850 Object::null_instance()); | 849 Object::null_instance()); |
| 851 } | 850 } |
| 852 | 851 |
| 853 | 852 |
| 854 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalTypeMirror, 1) { | 853 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalTypeMirror, 1) { |
| 855 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 854 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 856 return CreateTypeMirror(type); | 855 return CreateTypeMirror(type); |
| 857 } | 856 } |
| 858 | 857 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 const Library& library = Library::Handle(klass.library()); | 959 const Library& library = Library::Handle(klass.library()); |
| 961 ASSERT(!library.IsNull()); | 960 ASSERT(!library.IsNull()); |
| 962 return CreateLibraryMirror(library); | 961 return CreateLibraryMirror(library); |
| 963 } | 962 } |
| 964 | 963 |
| 965 | 964 |
| 966 DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) { | 965 DEFINE_NATIVE_ENTRY(ClassMirror_supertype, 1) { |
| 967 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 966 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 968 ASSERT(!type.IsMalformed()); | 967 ASSERT(!type.IsMalformed()); |
| 969 ASSERT(type.IsFinalized()); | 968 ASSERT(type.IsFinalized()); |
| 969 if (!type.HasResolvedTypeClass()) { |
| 970 Exceptions::ThrowArgumentError(type); |
| 971 UNREACHABLE(); |
| 972 } |
| 970 const Class& cls = Class::Handle(type.type_class()); | 973 const Class& cls = Class::Handle(type.type_class()); |
| 971 const AbstractType& super_type = AbstractType::Handle(cls.super_type()); | 974 const AbstractType& super_type = AbstractType::Handle(cls.super_type()); |
| 972 ASSERT(super_type.IsNull() || super_type.IsFinalized()); | 975 ASSERT(super_type.IsNull() || super_type.IsFinalized()); |
| 973 return super_type.raw(); | 976 return super_type.raw(); |
| 974 } | 977 } |
| 975 | 978 |
| 976 DEFINE_NATIVE_ENTRY(ClassMirror_supertype_instantiated, 1) { | 979 DEFINE_NATIVE_ENTRY(ClassMirror_supertype_instantiated, 1) { |
| 977 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); | 980 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 978 ASSERT(!type.IsMalformed()); | 981 ASSERT(!type.IsMalformed()); |
| 979 ASSERT(type.IsFinalized()); | 982 ASSERT(type.IsFinalized()); |
| 983 if (!type.HasResolvedTypeClass()) { |
| 984 Exceptions::ThrowArgumentError(type); |
| 985 UNREACHABLE(); |
| 986 } |
| 980 const Class& cls = Class::Handle(type.type_class()); | 987 const Class& cls = Class::Handle(type.type_class()); |
| 981 AbstractType& super_type = AbstractType::Handle(cls.super_type()); | 988 AbstractType& super_type = AbstractType::Handle(cls.super_type()); |
| 982 AbstractType& result = AbstractType::Handle(super_type.raw()); | 989 AbstractType& result = AbstractType::Handle(super_type.raw()); |
| 983 | 990 |
| 984 ASSERT(super_type.IsType()); | 991 ASSERT(super_type.IsType()); |
| 985 if (!super_type.IsInstantiated()) { | 992 if (!super_type.IsInstantiated()) { |
| 986 AbstractTypeArguments& type_args = | 993 AbstractTypeArguments& type_args = |
| 987 AbstractTypeArguments::Handle(type.arguments()); | 994 AbstractTypeArguments::Handle(type.arguments()); |
| 988 Error& bound_error = Error::Handle(); | 995 Error& bound_error = Error::Handle(); |
| 989 result ^= super_type.InstantiateFrom(type_args, &bound_error); | 996 result ^= super_type.InstantiateFrom(type_args, &bound_error); |
| 990 if (!bound_error.IsNull()) { | 997 if (!bound_error.IsNull()) { |
| 991 ThrowInvokeError(bound_error); | 998 ThrowInvokeError(bound_error); |
| 992 UNREACHABLE(); | 999 UNREACHABLE(); |
| 993 } | 1000 } |
| 994 result ^= result.Canonicalize(); | 1001 result ^= result.Canonicalize(); |
| 995 ASSERT(result.IsType()); | 1002 ASSERT(result.IsType()); |
| 996 } | 1003 } |
| 997 | 1004 |
| 998 ASSERT(result.IsFinalized()); | 1005 ASSERT(result.IsFinalized()); |
| 999 return result.raw(); | 1006 return result.raw(); |
| 1000 } | 1007 } |
| 1001 | 1008 |
| 1002 | 1009 |
| 1003 DEFINE_NATIVE_ENTRY(ClassMirror_interfaces, 1) { | 1010 DEFINE_NATIVE_ENTRY(ClassMirror_interfaces, 1) { |
| 1004 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1011 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 1005 const Class& klass = Class::Handle(ref.GetClassReferent()); | 1012 ASSERT(!type.IsMalformed()); |
| 1006 | 1013 ASSERT(type.IsFinalized()); |
| 1007 const Error& error = Error::Handle(klass.EnsureIsFinalized(isolate)); | 1014 if (!type.HasResolvedTypeClass()) { |
| 1015 Exceptions::ThrowArgumentError(type); |
| 1016 UNREACHABLE(); |
| 1017 } |
| 1018 const Class& cls = Class::Handle(type.type_class()); |
| 1019 const Error& error = Error::Handle(cls.EnsureIsFinalized(isolate)); |
| 1008 if (!error.IsNull()) { | 1020 if (!error.IsNull()) { |
| 1009 ThrowInvokeError(error); | 1021 ThrowInvokeError(error); |
| 1010 } | 1022 } |
| 1011 | 1023 |
| 1012 return klass.interfaces(); | 1024 return cls.interfaces(); |
| 1025 } |
| 1026 |
| 1027 DEFINE_NATIVE_ENTRY(ClassMirror_interfaces_instantiated, 1) { |
| 1028 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 1029 ASSERT(!type.IsMalformed()); |
| 1030 ASSERT(type.IsFinalized()); |
| 1031 if (!type.HasResolvedTypeClass()) { |
| 1032 Exceptions::ThrowArgumentError(type); |
| 1033 UNREACHABLE(); |
| 1034 } |
| 1035 const Class& cls = Class::Handle(type.type_class()); |
| 1036 const Error& error = Error::Handle(cls.EnsureIsFinalized(isolate)); |
| 1037 if (!error.IsNull()) { |
| 1038 ThrowInvokeError(error); |
| 1039 } |
| 1040 |
| 1041 AbstractTypeArguments& type_args = |
| 1042 AbstractTypeArguments::Handle(type.arguments()); |
| 1043 Error& bound_error = Error::Handle(); |
| 1044 |
| 1045 Array& interfaces = Array::Handle(cls.interfaces()); |
| 1046 Array& interfaces_inst = Array::Handle(Array::New(interfaces.Length())); |
| 1047 AbstractType& interface = AbstractType::Handle(); |
| 1048 |
| 1049 for (int i = 0; i < interfaces.Length(); i++) { |
| 1050 interface ^= interfaces.At(i); |
| 1051 ASSERT(interface.IsType()); |
| 1052 if (!interface.IsInstantiated()) { |
| 1053 bound_error ^= Object::null(); |
| 1054 interface ^= interface.InstantiateFrom(type_args, &bound_error); |
| 1055 if (!bound_error.IsNull()) { |
| 1056 ThrowInvokeError(bound_error); |
| 1057 UNREACHABLE(); |
| 1058 } |
| 1059 interface ^= interface.Canonicalize(); |
| 1060 ASSERT(interface.IsType()); |
| 1061 } |
| 1062 interfaces_inst.SetAt(i, interface); |
| 1063 } |
| 1064 |
| 1065 return interfaces_inst.raw(); |
| 1013 } | 1066 } |
| 1014 | 1067 |
| 1015 | 1068 |
| 1016 DEFINE_NATIVE_ENTRY(ClassMirror_mixin, 1) { | 1069 DEFINE_NATIVE_ENTRY(ClassMirror_mixin, 1) { |
| 1017 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1070 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 1018 const Class& klass = Class::Handle(ref.GetClassReferent()); | 1071 ASSERT(!type.IsMalformed()); |
| 1019 return klass.mixin(); | 1072 ASSERT(type.IsFinalized()); |
| 1073 if (!type.HasResolvedTypeClass()) { |
| 1074 Exceptions::ThrowArgumentError(type); |
| 1075 UNREACHABLE(); |
| 1076 } |
| 1077 const Class& cls = Class::Handle(type.type_class()); |
| 1078 const AbstractType& mixin_type = AbstractType::Handle(cls.mixin()); |
| 1079 ASSERT(mixin_type.IsNull() || mixin_type.IsFinalized()); |
| 1080 return mixin_type.raw(); |
| 1020 } | 1081 } |
| 1021 | 1082 |
| 1022 | 1083 |
| 1084 DEFINE_NATIVE_ENTRY(ClassMirror_mixin_instantiated, 2) { |
| 1085 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, type, arguments->NativeArgAt(0)); |
| 1086 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, |
| 1087 instantiator, |
| 1088 arguments->NativeArgAt(1)); |
| 1089 ASSERT(!type.IsMalformed()); |
| 1090 ASSERT(type.IsFinalized()); |
| 1091 if (!type.HasResolvedTypeClass()) { |
| 1092 Exceptions::ThrowArgumentError(type); |
| 1093 UNREACHABLE(); |
| 1094 } |
| 1095 const Class& cls = Class::Handle(type.type_class()); |
| 1096 const AbstractType& mixin_type = AbstractType::Handle(cls.mixin()); |
| 1097 if (mixin_type.IsNull()) { |
| 1098 return mixin_type.raw(); |
| 1099 } |
| 1100 ASSERT(mixin_type.IsFinalized()); |
| 1101 |
| 1102 ASSERT(!instantiator.IsMalformed()); |
| 1103 ASSERT(instantiator.IsFinalized()); |
| 1104 |
| 1105 AbstractType& result = AbstractType::Handle(mixin_type.raw()); |
| 1106 |
| 1107 ASSERT(mixin_type.IsType()); |
| 1108 if (!mixin_type.IsInstantiated()) { |
| 1109 AbstractTypeArguments& type_args = |
| 1110 AbstractTypeArguments::Handle(instantiator.arguments()); |
| 1111 Error& bound_error = Error::Handle(); |
| 1112 result ^= mixin_type.InstantiateFrom(type_args, &bound_error); |
| 1113 if (!bound_error.IsNull()) { |
| 1114 ThrowInvokeError(bound_error); |
| 1115 UNREACHABLE(); |
| 1116 } |
| 1117 result ^= result.Canonicalize(); |
| 1118 ASSERT(result.IsType()); |
| 1119 } |
| 1120 |
| 1121 ASSERT(result.IsFinalized()); |
| 1122 return result.raw(); |
| 1123 } |
| 1124 |
| 1125 |
| 1023 DEFINE_NATIVE_ENTRY(ClassMirror_members, 2) { | 1126 DEFINE_NATIVE_ENTRY(ClassMirror_members, 2) { |
| 1024 GET_NON_NULL_NATIVE_ARGUMENT(Instance, | 1127 GET_NON_NULL_NATIVE_ARGUMENT(Instance, |
| 1025 owner_mirror, | 1128 owner_mirror, |
| 1026 arguments->NativeArgAt(0)); | 1129 arguments->NativeArgAt(0)); |
| 1027 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1)); | 1130 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1)); |
| 1028 const Class& klass = Class::Handle(ref.GetClassReferent()); | 1131 const Class& klass = Class::Handle(ref.GetClassReferent()); |
| 1029 | 1132 |
| 1030 const Error& error = Error::Handle(klass.EnsureIsFinalized(isolate)); | 1133 const Error& error = Error::Handle(klass.EnsureIsFinalized(isolate)); |
| 1031 if (!error.IsNull()) { | 1134 if (!error.IsNull()) { |
| 1032 ThrowInvokeError(error); | 1135 ThrowInvokeError(error); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 AbstractType& type = AbstractType::Handle(); | 1217 AbstractType& type = AbstractType::Handle(); |
| 1115 | 1218 |
| 1116 while (entries.HasNext()) { | 1219 while (entries.HasNext()) { |
| 1117 entry = entries.GetNext(); | 1220 entry = entries.GetNext(); |
| 1118 if (entry.IsClass()) { | 1221 if (entry.IsClass()) { |
| 1119 const Class& klass = Class::Cast(entry); | 1222 const Class& klass = Class::Cast(entry); |
| 1120 // We filter out function signature classes and dynamic. | 1223 // We filter out function signature classes and dynamic. |
| 1121 // TODO(12478): Should not need to filter out dynamic. | 1224 // TODO(12478): Should not need to filter out dynamic. |
| 1122 if (!klass.IsCanonicalSignatureClass() && | 1225 if (!klass.IsCanonicalSignatureClass() && |
| 1123 !klass.IsDynamicClass()) { | 1226 !klass.IsDynamicClass()) { |
| 1124 type = klass.RareType(); | 1227 type = klass.DeclarationType(); |
| 1125 member_mirror = CreateClassMirror(klass, | 1228 member_mirror = CreateClassMirror(klass, |
| 1126 type, | 1229 type, |
| 1127 Bool::True(), // is_declaration | 1230 Bool::True(), // is_declaration |
| 1128 owner_mirror); | 1231 owner_mirror); |
| 1129 member_mirrors.Add(member_mirror); | 1232 member_mirrors.Add(member_mirror); |
| 1130 } | 1233 } |
| 1131 } else if (entry.IsField()) { | 1234 } else if (entry.IsField()) { |
| 1132 const Field& field = Field::Cast(entry); | 1235 const Field& field = Field::Cast(entry); |
| 1133 member_mirror = CreateVariableMirror(field, owner_mirror); | 1236 member_mirror = CreateVariableMirror(field, owner_mirror); |
| 1134 member_mirrors.Add(member_mirror); | 1237 member_mirrors.Add(member_mirror); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 type_mirror = CreateTypeMirror(arg_type); | 1292 type_mirror = CreateTypeMirror(arg_type); |
| 1190 result.SetAt(i, type_mirror); | 1293 result.SetAt(i, type_mirror); |
| 1191 } | 1294 } |
| 1192 return result.raw(); | 1295 return result.raw(); |
| 1193 } | 1296 } |
| 1194 | 1297 |
| 1195 | 1298 |
| 1196 DEFINE_NATIVE_ENTRY(TypeVariableMirror_owner, 1) { | 1299 DEFINE_NATIVE_ENTRY(TypeVariableMirror_owner, 1) { |
| 1197 GET_NON_NULL_NATIVE_ARGUMENT(TypeParameter, param, arguments->NativeArgAt(0)); | 1300 GET_NON_NULL_NATIVE_ARGUMENT(TypeParameter, param, arguments->NativeArgAt(0)); |
| 1198 const Class& owner = Class::Handle(param.parameterized_class()); | 1301 const Class& owner = Class::Handle(param.parameterized_class()); |
| 1199 const AbstractType& type = AbstractType::Handle(owner.RareType()); | 1302 const AbstractType& type = AbstractType::Handle(owner.DeclarationType()); |
| 1200 return CreateClassMirror(owner, | 1303 return CreateClassMirror(owner, |
| 1201 type, | 1304 type, |
| 1202 Bool::True(), // is_declaration | 1305 Bool::True(), // is_declaration |
| 1203 Instance::null_instance()); | 1306 Instance::null_instance()); |
| 1204 } | 1307 } |
| 1205 | 1308 |
| 1206 | 1309 |
| 1207 DEFINE_NATIVE_ENTRY(TypeVariableMirror_upper_bound, 1) { | 1310 DEFINE_NATIVE_ENTRY(TypeVariableMirror_upper_bound, 1) { |
| 1208 GET_NON_NULL_NATIVE_ARGUMENT(TypeParameter, param, arguments->NativeArgAt(0)); | 1311 GET_NON_NULL_NATIVE_ARGUMENT(TypeParameter, param, arguments->NativeArgAt(0)); |
| 1209 return param.bound(); | 1312 return param.bound(); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1563 internal_constructor_name, | 1666 internal_constructor_name, |
| 1564 lookup_constructor, | 1667 lookup_constructor, |
| 1565 InvocationMirror::kConstructor, | 1668 InvocationMirror::kConstructor, |
| 1566 InvocationMirror::kMethod); | 1669 InvocationMirror::kMethod); |
| 1567 UNREACHABLE(); | 1670 UNREACHABLE(); |
| 1568 } | 1671 } |
| 1569 | 1672 |
| 1570 ASSERT(!type.IsNull()); | 1673 ASSERT(!type.IsNull()); |
| 1571 AbstractTypeArguments& type_arguments = | 1674 AbstractTypeArguments& type_arguments = |
| 1572 AbstractTypeArguments::Handle(type.arguments()); | 1675 AbstractTypeArguments::Handle(type.arguments()); |
| 1676 if (!type.IsInstantiated()) { |
| 1677 // Must have been a declaration type. |
| 1678 AbstractType& rare_type = AbstractType::Handle(klass.RareType()); |
| 1679 ASSERT(rare_type.IsInstantiated()); |
| 1680 type_arguments = rare_type.arguments(); |
| 1681 } |
| 1573 | 1682 |
| 1574 Class& redirected_klass = Class::Handle(klass.raw()); | 1683 Class& redirected_klass = Class::Handle(klass.raw()); |
| 1575 Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); | 1684 Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); |
| 1576 if (lookup_constructor.IsRedirectingFactory()) { | 1685 if (lookup_constructor.IsRedirectingFactory()) { |
| 1577 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); | 1686 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); |
| 1578 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); | 1687 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); |
| 1579 | 1688 |
| 1580 if (!redirect_type.IsInstantiated()) { | 1689 if (!redirect_type.IsInstantiated()) { |
| 1581 // The type arguments of the redirection type are instantiated from the | 1690 // The type arguments of the redirection type are instantiated from the |
| 1582 // type arguments of the type reflected by the class mirror. | 1691 // type arguments of the type reflected by the class mirror. |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 const Function& func = Function::Handle(ref.GetFunctionReferent()); | 1888 const Function& func = Function::Handle(ref.GetFunctionReferent()); |
| 1780 if (func.IsNonImplicitClosureFunction()) { | 1889 if (func.IsNonImplicitClosureFunction()) { |
| 1781 return CreateMethodMirror(Function::Handle( | 1890 return CreateMethodMirror(Function::Handle( |
| 1782 func.parent_function()), Object::null_instance()); | 1891 func.parent_function()), Object::null_instance()); |
| 1783 } | 1892 } |
| 1784 const Class& owner = Class::Handle(func.Owner()); | 1893 const Class& owner = Class::Handle(func.Owner()); |
| 1785 if (owner.IsTopLevel()) { | 1894 if (owner.IsTopLevel()) { |
| 1786 return CreateLibraryMirror(Library::Handle(owner.library())); | 1895 return CreateLibraryMirror(Library::Handle(owner.library())); |
| 1787 } | 1896 } |
| 1788 | 1897 |
| 1789 AbstractType& type = AbstractType::Handle(owner.RareType()); | 1898 AbstractType& type = AbstractType::Handle(owner.DeclarationType()); |
| 1790 return CreateClassMirror(owner, type, Bool::True(), Object::null_instance()); | 1899 return CreateClassMirror(owner, type, Bool::True(), Object::null_instance()); |
| 1791 } | 1900 } |
| 1792 | 1901 |
| 1793 | 1902 |
| 1794 DEFINE_NATIVE_ENTRY(MethodMirror_parameters, 2) { | 1903 DEFINE_NATIVE_ENTRY(MethodMirror_parameters, 2) { |
| 1795 GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner, arguments->NativeArgAt(0)); | 1904 GET_NON_NULL_NATIVE_ARGUMENT(Instance, owner, arguments->NativeArgAt(0)); |
| 1796 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1)); | 1905 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(1)); |
| 1797 const Function& func = Function::Handle(ref.GetFunctionReferent()); | 1906 const Function& func = Function::Handle(ref.GetFunctionReferent()); |
| 1798 return CreateParameterMirrorList(func, owner); | 1907 return CreateParameterMirrorList(func, owner); |
| 1799 } | 1908 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 } | 1963 } |
| 1855 | 1964 |
| 1856 | 1965 |
| 1857 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1966 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1858 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1967 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1859 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1968 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1860 return field.type(); | 1969 return field.type(); |
| 1861 } | 1970 } |
| 1862 | 1971 |
| 1863 } // namespace dart | 1972 } // namespace dart |
| OLD | NEW |