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/mirrors.h" | 5 #include "lib/mirrors.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 776 } |
777 | 777 |
778 ASSERT(!instantiator.IsNull()); | 778 ASSERT(!instantiator.IsNull()); |
779 ASSERT(instantiator.IsFinalized()); | 779 ASSERT(instantiator.IsFinalized()); |
780 PROPAGATE_IF_MALFORMED(instantiator); | 780 PROPAGATE_IF_MALFORMED(instantiator); |
781 | 781 |
782 const TypeArguments& type_args = | 782 const TypeArguments& type_args = |
783 TypeArguments::Handle(instantiator.arguments()); | 783 TypeArguments::Handle(instantiator.arguments()); |
784 Error& bound_error = Error::Handle(); | 784 Error& bound_error = Error::Handle(); |
785 AbstractType& result = AbstractType::Handle( | 785 AbstractType& result = AbstractType::Handle( |
786 type.InstantiateFrom(type_args, &bound_error, NULL, Heap::kOld)); | 786 type.InstantiateFrom(type_args, &bound_error, NULL, NULL, Heap::kOld)); |
787 if (!bound_error.IsNull()) { | 787 if (!bound_error.IsNull()) { |
788 Exceptions::PropagateError(bound_error); | 788 Exceptions::PropagateError(bound_error); |
789 UNREACHABLE(); | 789 UNREACHABLE(); |
790 } | 790 } |
791 ASSERT(result.IsFinalized()); | 791 ASSERT(result.IsFinalized()); |
792 return result.Canonicalize(); | 792 return result.Canonicalize(); |
793 } | 793 } |
794 | 794 |
795 | 795 |
796 DEFINE_NATIVE_ENTRY(MirrorSystem_libraries, 0) { | 796 DEFINE_NATIVE_ENTRY(MirrorSystem_libraries, 0) { |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); | 1668 Function& redirected_constructor = Function::Handle(lookup_constructor.raw()); |
1669 if (lookup_constructor.IsRedirectingFactory()) { | 1669 if (lookup_constructor.IsRedirectingFactory()) { |
1670 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); | 1670 ClassFinalizer::ResolveRedirectingFactory(klass, lookup_constructor); |
1671 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); | 1671 Type& redirect_type = Type::Handle(lookup_constructor.RedirectionType()); |
1672 | 1672 |
1673 if (!redirect_type.IsInstantiated()) { | 1673 if (!redirect_type.IsInstantiated()) { |
1674 // The type arguments of the redirection type are instantiated from the | 1674 // The type arguments of the redirection type are instantiated from the |
1675 // type arguments of the type reflected by the class mirror. | 1675 // type arguments of the type reflected by the class mirror. |
1676 Error& bound_error = Error::Handle(); | 1676 Error& bound_error = Error::Handle(); |
1677 redirect_type ^= redirect_type.InstantiateFrom( | 1677 redirect_type ^= redirect_type.InstantiateFrom( |
1678 type_arguments, &bound_error, NULL, Heap::kOld); | 1678 type_arguments, &bound_error, NULL, NULL, Heap::kOld); |
1679 if (!bound_error.IsNull()) { | 1679 if (!bound_error.IsNull()) { |
1680 Exceptions::PropagateError(bound_error); | 1680 Exceptions::PropagateError(bound_error); |
1681 UNREACHABLE(); | 1681 UNREACHABLE(); |
1682 } | 1682 } |
1683 redirect_type ^= redirect_type.Canonicalize(); | 1683 redirect_type ^= redirect_type.Canonicalize(); |
1684 } | 1684 } |
1685 | 1685 |
1686 type = redirect_type.raw(); | 1686 type = redirect_type.raw(); |
1687 type_arguments = redirect_type.arguments(); | 1687 type_arguments = redirect_type.arguments(); |
1688 | 1688 |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2084 } | 2084 } |
2085 | 2085 |
2086 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2086 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2087 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2087 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2089 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); | 2089 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); |
2090 } | 2090 } |
2091 | 2091 |
2092 | 2092 |
2093 } // namespace dart | 2093 } // namespace dart |
OLD | NEW |