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

Issue 24280003: Add Object.hashCodeOf to get the default hashCode of an object. (Closed)

Created:
7 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
7 years, 3 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Johnni Winther
Visibility:
Public.

Description

Add Object.hashCodeOf to get the default hashCode of an object. BUG= http://dartbug.com/13404 R=floitsch@google.com, iposva@google.com Committed: https://code.google.com/p/dart/source/detail?r=27865

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use existing _objectHashCode. #

Total comments: 4

Patch Set 3 : Make identityHashCodeOf top-level. Implement VM using instance getter. #

Patch Set 4 : Now named Object.identityHashCode #

Patch Set 5 : Now top-level and called identityHashCode #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -10 lines) Patch
M runtime/lib/bool_patch.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/double.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/identical_patch.dart View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/lib/integers.dart View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/lib/null_patch.dart View 1 2 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/object_patch.dart View 1 2 4 1 chunk +3 lines, -1 line 0 comments Download
M sdk/lib/_internal/lib/core_patch.dart View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M sdk/lib/_internal/lib/js_helper.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/core/identical.dart View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
A tests/corelib/hashcode_test.dart View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
Lasse Reichstein Nielsen
7 years, 3 months ago (2013-09-20 13:08:45 UTC) #1
kasperl
https://codereview.chromium.org/24280003/diff/1/sdk/lib/core/object.dart File sdk/lib/core/object.dart (right): https://codereview.chromium.org/24280003/diff/1/sdk/lib/core/object.dart#newcode104 sdk/lib/core/object.dart:104: external static int hashCodeOf(Object object); How about calling this ...
7 years, 3 months ago (2013-09-20 13:17:17 UTC) #2
floitsch
LGTM once we agree on the name.
7 years, 3 months ago (2013-09-20 13:21:40 UTC) #3
Lasse Reichstein Nielsen
I'd prefer identityHashCode (or perhaps even just identityHash) as a top-level function, but decided to ...
7 years, 3 months ago (2013-09-20 14:02:40 UTC) #4
sra1
On 2013/09/20 13:17:17, kasperl wrote: > https://codereview.chromium.org/24280003/diff/1/sdk/lib/core/object.dart > File sdk/lib/core/object.dart (right): > > https://codereview.chromium.org/24280003/diff/1/sdk/lib/core/object.dart#newcode104 > ...
7 years, 3 months ago (2013-09-20 14:06:08 UTC) #5
Johnni Winther
https://codereview.chromium.org/24280003/diff/1/sdk/lib/_internal/lib/core_patch.dart File sdk/lib/_internal/lib/core_patch.dart (right): https://codereview.chromium.org/24280003/diff/1/sdk/lib/_internal/lib/core_patch.dart#newcode34 sdk/lib/_internal/lib/core_patch.dart:34: // Basic JS non-object types don't work with objectHashCode. ...
7 years, 3 months ago (2013-09-20 18:23:02 UTC) #6
Lasse Reichstein Nielsen
https://codereview.chromium.org/24280003/diff/1/sdk/lib/_internal/lib/core_patch.dart File sdk/lib/_internal/lib/core_patch.dart (right): https://codereview.chromium.org/24280003/diff/1/sdk/lib/_internal/lib/core_patch.dart#newcode34 sdk/lib/_internal/lib/core_patch.dart:34: // Basic JS non-object types don't work with objectHashCode. ...
7 years, 3 months ago (2013-09-23 07:08:27 UTC) #7
floitsch
I vote for Object.identityHashCodeOf It is long, but in the end it shouldn't be used ...
7 years, 3 months ago (2013-09-23 13:45:13 UTC) #8
Ivan Posva
On 2013/09/23 13:45:13, floitsch wrote: > I vote for Object.identityHashCodeOf > It is long, but ...
7 years, 3 months ago (2013-09-24 06:21:32 UTC) #9
Ivan Posva
NMW... See attached comments. -Ivan https://codereview.chromium.org/24280003/diff/11001/runtime/lib/object_patch.dart File runtime/lib/object_patch.dart (right): https://codereview.chromium.org/24280003/diff/11001/runtime/lib/object_patch.dart#newcode18 runtime/lib/object_patch.dart:18: // Num doesn't use ...
7 years, 3 months ago (2013-09-24 06:22:10 UTC) #10
kasperl
On 2013/09/24 06:21:32, Ivan Posva wrote: > On 2013/09/23 13:45:13, floitsch wrote: > > I ...
7 years, 3 months ago (2013-09-24 06:24:15 UTC) #11
Lasse Reichstein Nielsen
My personal favorite is a top-level identityHashCode. Having it as a static in Object is ...
7 years, 3 months ago (2013-09-24 08:38:57 UTC) #12
Lasse Reichstein Nielsen
Is now top-level identityHashCodeOf. Will rename to identityHashOf, just for brevity. Please take a look ...
7 years, 3 months ago (2013-09-24 09:38:56 UTC) #13
kasperl
On 2013/09/24 09:38:56, Lasse Reichstein Nielsen wrote: > Is now top-level identityHashCodeOf. > Will rename ...
7 years, 3 months ago (2013-09-24 10:04:06 UTC) #14
Lasse Reichstein Nielsen
On 2013/09/24 10:04:06, kasperl wrote: > On 2013/09/24 09:38:56, Lasse Reichstein Nielsen wrote: > > ...
7 years, 3 months ago (2013-09-24 10:28:57 UTC) #15
kasperl
On 2013/09/24 10:28:57, Lasse Reichstein Nielsen wrote: > On 2013/09/24 10:04:06, kasperl wrote: > > ...
7 years, 3 months ago (2013-09-24 10:34:59 UTC) #16
Lasse Reichstein Nielsen
VM implementation changed, PTAL.
7 years, 3 months ago (2013-09-24 19:50:53 UTC) #17
Ivan Posva
On 2013/09/24 19:50:53, Lasse Reichstein Nielsen wrote: > VM implementation changed, PTAL. VM implementation LGTM ...
7 years, 3 months ago (2013-09-24 23:17:20 UTC) #18
Lasse Reichstein Nielsen
7 years, 3 months ago (2013-09-25 08:15:58 UTC) #19
Message was sent while issue was closed.
Committed patchset #5 manually as r27865 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698