Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: runtime/lib/mirrors.cc

Issue 126823004: Add TypeMirror.isSubtypeOf, TypeMirror.isAssignableTo, ClassMirror.isSubclassOf (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 2050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2061 2061
2062 2062
2063 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { 2063 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) {
2064 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); 2064 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
2065 const Field& field = Field::Handle(ref.GetFieldReferent()); 2065 const Field& field = Field::Handle(ref.GetFieldReferent());
2066 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); 2066 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1));
2067 const AbstractType& type = AbstractType::Handle(field.type()); 2067 const AbstractType& type = AbstractType::Handle(field.type());
2068 return InstantiateType(type, instantiator); 2068 return InstantiateType(type, instantiator);
2069 } 2069 }
2070 2070
2071 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) {
2072 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
2073 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
2074 return Bool::Get(a.IsSubtypeOf(b, NULL)).raw();
2075 }
2076
2077 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) {
2078 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
2079 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
2080 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw();
2081 }
2082
2083
2071 } // namespace dart 2084 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | tests/lib/mirrors/relation_assignable_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698