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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2980043002: Cleanup unused Dart API Dart_IdentityHash (Closed)
Patch Set: Created 3 years, 5 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/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index b9501b9421815afedcbf485482c055da6bfc8838..f4caf77da76ee1cbf1244d70bdf491e39dac9ab3 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -915,47 +915,6 @@ DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2) {
return false;
}
-DART_EXPORT uint64_t Dart_IdentityHash(Dart_Handle obj) {
- DARTSCOPE(Thread::Current());
-
- const Object& object = Object::Handle(Z, Api::UnwrapHandle(obj));
- if (!object.IsInstance() && !object.IsNull()) {
- return 0;
- }
-
- const Library& libcore = Library::Handle(Z, Library::CoreLibrary());
- const String& function_name =
- String::Handle(Z, String::New("identityHashCode"));
- const Function& function =
- Function::Handle(Z, libcore.LookupFunctionAllowPrivate(function_name));
- if (function.IsNull()) {
- UNREACHABLE();
- return 0;
- }
-
- const Array& arguments = Array::Handle(Z, Array::New(1));
- arguments.SetAt(0, object);
- const Object& result =
- Object::Handle(Z, DartEntry::InvokeFunction(function, arguments));
-
- if (result.IsSmi()) {
- return Smi::Cast(result).Value();
- }
- if (result.IsMint()) {
- const Mint& mint = Mint::Cast(result);
- if (!mint.IsNegative()) {
- return mint.AsInt64Value();
- }
- }
- if (result.IsBigint()) {
- const Bigint& bigint = Bigint::Cast(result);
- if (bigint.FitsIntoUint64()) {
- return bigint.AsUint64Value();
- }
- }
- return 0;
-}
-
DART_EXPORT Dart_Handle
Dart_HandleFromPersistent(Dart_PersistentHandle object) {
Thread* thread = Thread::Current();
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698