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

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: +source mirrors Created 6 years, 10 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 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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