Index: runtime/lib/mirrors.cc |
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc |
index 9386f4bf915694669b5a33d2afc6924e72884c6e..f748058b969cdf299ea4b0b3805ace70b0edf2b9 100644 |
--- a/runtime/lib/mirrors.cc |
+++ b/runtime/lib/mirrors.cc |
@@ -739,6 +739,18 @@ DEFINE_NATIVE_ENTRY(TypeVariableMirror_upper_bound, 1) { |
} |
+DEFINE_NATIVE_ENTRY(InstanceMirror_identityHash, 1) { |
+ GET_NATIVE_ARGUMENT(Instance, reflectee, arguments->NativeArgAt(0)); |
+ ObjectStore* object_store = Isolate::Current()->object_store(); |
+ const Class& cls = Class::Handle(object_store->object_class()); |
+ const Function& function = |
+ Function::Handle(cls.LookupDynamicFunction(Symbols::hashCode())); |
+ const Array& args = Array::Handle(Array::New(1)); |
+ args.SetAt(0, reflectee); |
+ return DartEntry::InvokeFunction(function, args); |
+} |
+ |
+ |
// Invoke the function, or noSuchMethod if it is null. Propagate any unhandled |
// exceptions. Wrap and propagate any compilation errors. |
static RawObject* ReflectivelyInvokeDynamicFunction(const Instance& receiver, |