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

Issue 17569004: Implement hashCode on objects stored in a set or used as map keys. (Closed)

Created:
7 years, 6 months ago by ahe
Modified:
7 years, 5 months ago
CC:
reviews_dartlang.org, ngeoffray, Johnni Winther, kasperl, karlklose
Visibility:
Public.

Description

Implement hashCode on objects stored in a set or used as map keys. R=johnniwinther@google.com, ngeoffray@google.com Committed: https://code.google.com/p/dart/source/detail?r=24464

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rebased on CL 17588005. #

Total comments: 8

Patch Set 3 : Address comments and fix one test failure. #

Patch Set 4 : Rebased #

Patch Set 5 : Merged with TOT #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+81 lines, -86 lines) Patch
M dart/sdk/lib/_internal/compiler/implementation/constants.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/dart_types.dart View 1 5 chunks +18 lines, -0 lines 4 comments Download
M dart/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/native_handler.dart View 1 1 chunk +2 lines, -1 line 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/scanner/token.dart View 2 chunks +4 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/ssa/types.dart View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart View 1 6 chunks +12 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/types/container_type_mask.dart View 1 2 chunks +4 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/types/element_type_mask.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart View 1 chunk +8 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/universe/side_effects.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/util/link.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/util/link_implementation.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/util/util.dart View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M dart/sdk/lib/_internal/compiler/implementation/warnings.dart View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M dart/tests/compiler/dart2js/analyze_dart2js_test.dart View 1 2 3 4 1 chunk +4 lines, -84 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
ahe
Makes dart2js 5% faster at compiling itself.
7 years, 6 months ago (2013-06-23 09:38:16 UTC) #1
Johnni Winther
lgtm https://codereview.chromium.org/17569004/diff/1/dart/sdk/lib/_internal/compiler/implementation/util/util.dart File dart/sdk/lib/_internal/compiler/implementation/util/util.dart (right): https://codereview.chromium.org/17569004/diff/1/dart/sdk/lib/_internal/compiler/implementation/util/util.dart#newcode112 dart/sdk/lib/_internal/compiler/implementation/util/util.dart:112: int computeHashCode(part1, [part2, part3, part4]) { Wouldn't it ...
7 years, 6 months ago (2013-06-23 19:07:42 UTC) #2
kasperl
https://codereview.chromium.org/17569004/diff/1/dart/sdk/lib/_internal/compiler/implementation/util/util.dart File dart/sdk/lib/_internal/compiler/implementation/util/util.dart (right): https://codereview.chromium.org/17569004/diff/1/dart/sdk/lib/_internal/compiler/implementation/util/util.dart#newcode112 dart/sdk/lib/_internal/compiler/implementation/util/util.dart:112: int computeHashCode(part1, [part2, part3, part4]) { At some point ...
7 years, 6 months ago (2013-06-24 06:32:43 UTC) #3
ngeoffray
LGTM
7 years, 6 months ago (2013-06-24 10:12:07 UTC) #4
ngeoffray
LGTM
7 years, 6 months ago (2013-06-24 10:12:07 UTC) #5
ahe
PTAL
7 years, 6 months ago (2013-06-24 19:25:59 UTC) #6
ngeoffray
LGTM https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart File dart/sdk/lib/_internal/compiler/implementation/dart_types.dart (right): https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart#newcode98 dart/sdk/lib/_internal/compiler/implementation/dart_types.dart:98: // of duplicating it here? Not my code, ...
7 years, 6 months ago (2013-06-24 19:43:10 UTC) #7
ahe
Thank you! https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart File dart/sdk/lib/_internal/compiler/implementation/dart_types.dart (right): https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart#newcode98 dart/sdk/lib/_internal/compiler/implementation/dart_types.dart:98: // of duplicating it here? On 2013/06/24 ...
7 years, 6 months ago (2013-06-24 20:18:54 UTC) #8
ahe
https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart File dart/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart (right): https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart#newcode47 dart/sdk/lib/_internal/compiler/implementation/tree/dartstring.dart:47: int get hashCode => throw new UnsupportedError('ArgumentsTypes.hashCode'); On 2013/06/24 ...
7 years, 6 months ago (2013-06-24 20:43:50 UTC) #9
sra1
https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart File dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (right): https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart#newcode151 dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart:151: int get hashCode => throw new UnsupportedError('IntValue.hashCode'); On 2013/06/24 ...
7 years, 6 months ago (2013-06-25 03:33:38 UTC) #10
ahe
https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart File dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (right): https://codereview.chromium.org/17569004/diff/8001/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart#newcode151 dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart:151: int get hashCode => throw new UnsupportedError('IntValue.hashCode'); I find ...
7 years, 6 months ago (2013-06-25 05:24:58 UTC) #11
ahe
Committed patchset #5 manually as r24464 (presubmit successful).
7 years, 6 months ago (2013-06-26 11:50:01 UTC) #12
Johnni Winther
https://codereview.chromium.org/17569004/diff/24001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart File dart/sdk/lib/_internal/compiler/implementation/dart_types.dart (right): https://codereview.chromium.org/17569004/diff/24001/dart/sdk/lib/_internal/compiler/implementation/dart_types.dart#newcode98 dart/sdk/lib/_internal/compiler/implementation/dart_types.dart:98: // of duplicating it here? I think its archaic. ...
7 years, 5 months ago (2013-06-28 14:24:20 UTC) #13
ahe
7 years, 5 months ago (2013-06-28 17:55:44 UTC) #14
Message was sent while issue was closed.
Thanks, Johnni.  I'll send you a separate CL.

https://codereview.chromium.org/17569004/diff/24001/dart/sdk/lib/_internal/co...
File dart/sdk/lib/_internal/compiler/implementation/dart_types.dart (right):

https://codereview.chromium.org/17569004/diff/24001/dart/sdk/lib/_internal/co...
dart/sdk/lib/_internal/compiler/implementation/dart_types.dart:98: // of
duplicating it here?
On 2013/06/28 14:24:21, Johnni Winther wrote:
> I think its archaic. Just remove it.

Done.

https://codereview.chromium.org/17569004/diff/24001/dart/sdk/lib/_internal/co...
dart/sdk/lib/_internal/compiler/implementation/dart_types.dart:562: // for
concrete suggestions.
On 2013/06/28 14:24:21, Johnni Winther wrote:
> If you have a good solution, put it in. The idea in the implementation was
that
> all subclasses of GenericType should require that [other] is an instance of
> their own type. Maybe we can now use [: runtimeType == other.runtimeType :] in
> GenericType as one would use .getClass() in Java?

Done.

Powered by Google App Engine
This is Rietveld 408576698