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

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

Issue 25674017: Fix runtimeType for strings, integers and double: return their interface type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/exceptions.h" 9 #include "vm/exceptions.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 Array::Handle(ArgumentsDescriptor::New(args.Length())); 1141 Array::Handle(ArgumentsDescriptor::New(args.Length()));
1142 1142
1143 return InvokeDynamicFunction(reflectee, 1143 return InvokeDynamicFunction(reflectee,
1144 setter, 1144 setter,
1145 internal_setter_name, 1145 internal_setter_name,
1146 args, 1146 args,
1147 args_descriptor); 1147 args_descriptor);
1148 } 1148 }
1149 1149
1150 1150
1151 DEFINE_NATIVE_ENTRY(InstanceMirror_computeType, 1) {
1152 GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0));
1153 const Type& type = Type::Handle(instance.GetType());
1154 // The static type of null is specified to be the bottom type, however, the
1155 // runtime type of null is the Null type, which we correctly return here.
1156 return type.Canonicalize();
1157 }
1158
1159
1151 DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 3) { 1160 DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 3) {
1152 GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0)); 1161 GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0));
1153 ASSERT(!closure.IsNull() && closure.IsCallable(NULL, NULL)); 1162 ASSERT(!closure.IsNull() && closure.IsCallable(NULL, NULL));
1154 GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(1)); 1163 GET_NON_NULL_NATIVE_ARGUMENT(Array, args, arguments->NativeArgAt(1));
1155 GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(2)); 1164 GET_NON_NULL_NATIVE_ARGUMENT(Array, arg_names, arguments->NativeArgAt(2));
1156 1165
1157 const Array& args_descriptor = 1166 const Array& args_descriptor =
1158 Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names)); 1167 Array::Handle(ArgumentsDescriptor::New(args.Length(), arg_names));
1159 1168
1160 const Object& result = 1169 const Object& result =
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 } 1692 }
1684 1693
1685 1694
1686 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { 1695 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) {
1687 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); 1696 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
1688 const Field& field = Field::Handle(ref.GetFieldReferent()); 1697 const Field& field = Field::Handle(ref.GetFieldReferent());
1689 return field.type(); 1698 return field.type();
1690 } 1699 }
1691 1700
1692 } // namespace dart 1701 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/integers.dart ('k') | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698