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 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 | 2088 |
2089 | 2089 |
2090 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { | 2090 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { |
2091 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 2091 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
2092 const Field& field = Field::Handle(ref.GetFieldReferent()); | 2092 const Field& field = Field::Handle(ref.GetFieldReferent()); |
2093 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); | 2093 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); |
2094 const AbstractType& type = AbstractType::Handle(field.type()); | 2094 const AbstractType& type = AbstractType::Handle(field.type()); |
2095 return InstantiateType(type, instantiator); | 2095 return InstantiateType(type, instantiator); |
2096 } | 2096 } |
2097 | 2097 |
| 2098 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
| 2099 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 2100 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 2101 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw(); |
| 2102 } |
| 2103 |
| 2104 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { |
| 2105 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 2106 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 2107 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); |
| 2108 } |
| 2109 |
| 2110 |
2098 } // namespace dart | 2111 } // namespace dart |
OLD | NEW |