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

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: Created 7 years, 4 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') | sdk/lib/_internal/lib/js_mirrors.dart » ('J')
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 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,
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | sdk/lib/_internal/lib/js_mirrors.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698