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

Unified Diff: runtime/vm/dart_entry.cc

Issue 358723002: Add Instance::HashCode that matches hashCode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | « runtime/vm/dart_entry.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
===================================================================
--- runtime/vm/dart_entry.cc (revision 37709)
+++ runtime/vm/dart_entry.cc (working copy)
@@ -362,6 +362,24 @@
}
+RawObject* DartLibraryCalls::HashCode(const Instance& receiver) {
+ const int kNumArguments = 1; // Receiver.
+ ArgumentsDescriptor args_desc(
+ Array::Handle(ArgumentsDescriptor::New(kNumArguments)));
+ const Function& function = Function::Handle(
+ Resolver::ResolveDynamic(receiver,
+ Symbols::hashCode(),
+ args_desc));
+ ASSERT(!function.IsNull());
+ const Array& args = Array::Handle(Array::New(kNumArguments));
+ args.SetAt(0, receiver);
+ const Object& result = Object::Handle(DartEntry::InvokeFunction(function,
+ args));
+ ASSERT(result.IsInstance() || result.IsError());
+ return result.raw();
+}
+
+
RawObject* DartLibraryCalls::Equals(const Instance& left,
const Instance& right) {
const int kNumArguments = 2;
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698