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

Unified Diff: runtime/lib/mirrors.cc

Issue 23460013: Implement InstanceMirror.== in dart2js and InstanceMirror.hashCode in the VM and … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: use isolate parameter to native Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors.cc
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 17f4e94bcce27d0689bc6a9928db56e4a94f34fa..55b99b7d0458405bb7df0dc1ccdbd9df7f4232e3 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -751,6 +751,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->object_store();
+ const Class& cls = Class::Handle(isolate, object_store->object_class());
+ const Function& function =
+ Function::Handle(isolate, cls.LookupDynamicFunction(Symbols::hashCode()));
+ const Array& args = Array::Handle(isolate, 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,
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698