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

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: rebase, xor reflectee's hash 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') | runtime/lib/mirrors_impl.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 17f4e94bcce27d0689bc6a9928db56e4a94f34fa..7bf4a9e3892d61810ea867cb85e8f7f9a6754cc6 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::Current()->object_store();
siva 2013/09/03 19:43:43 You should be able to write this as ObjectStore* o
rmacnak 2013/09/03 20:10:54 Done.
+ const Class& cls = Class::Handle(object_store->object_class());
+ const Function& function =
+ Function::Handle(cls.LookupDynamicFunction(Symbols::hashCode()));
siva 2013/09/03 19:43:43 Also pass in the isolate to these handles as it is
rmacnak 2013/09/03 20:10:54 Done.
+ 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') | runtime/lib/mirrors_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698