Chromium Code Reviews| Index: runtime/lib/mirrors.cc |
| =================================================================== |
| --- runtime/lib/mirrors.cc (revision 28266) |
| +++ runtime/lib/mirrors.cc (working copy) |
| @@ -1148,6 +1148,24 @@ |
| } |
| +DEFINE_NATIVE_ENTRY(InstanceMirror_computeType, 1) { |
| + GET_NON_NULL_NATIVE_ARGUMENT(Instance, instance, arguments->NativeArgAt(0)); |
| + if (instance.IsString()) { |
|
rmacnak
2013/10/04 21:21:22
We are not required to hide these implementation t
|
| + return Type::StringType(); |
| + } |
| + if (instance.IsInteger()) { |
| + return Type::IntType(); |
| + } |
| + if (instance.IsDouble()) { |
| + return Type::Double(); |
| + } |
| + const Type& type = Type::Handle(instance.GetType()); |
| + // The static type of null is specified to be the bottom type, however, the |
| + // runtime type of null is the Null type, which we correctly return here. |
| + return type.Canonicalize(); |
| +} |
| + |
| + |
| DEFINE_NATIVE_ENTRY(ClosureMirror_apply, 3) { |
| GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0)); |
| ASSERT(!closure.IsNull() && closure.IsCallable(NULL, NULL)); |