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

Issue 11369181: Update get$hashCode to not use JS for most uses. Also fix issue 6522 where the hashCode of a String… (Closed)

Created:
8 years, 1 month ago by ngeoffray
Modified:
8 years, 1 month ago
Reviewers:
ahe, sra1
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Update get$hashCode to not use JS for most uses. Also fix issue 6522 where the hashCode of a String was always 0. Committed: https://code.google.com/p/dart/source/detail?r=14785

Patch Set 1 #

Patch Set 2 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -7 lines) Patch
M sdk/lib/_internal/compiler/implementation/lib/interceptors.dart View 1 1 chunk +7 lines, -7 lines 2 comments Download
A tests/compiler/dart2js_extra/hash_code_test.dart View 1 1 chunk +11 lines, -0 lines 3 comments Download

Messages

Total messages: 5 (0 generated)
ngeoffray
8 years, 1 month ago (2012-11-12 10:23:30 UTC) #1
ngeoffray
PTAL, test added and code tweaked as discussed.
8 years, 1 month ago (2012-11-12 12:10:33 UTC) #2
ahe
Awesome, LGTM!
8 years, 1 month ago (2012-11-12 12:56:53 UTC) #3
sra1
I filed Issue 6666 - that would have made it apparent that there was a ...
8 years, 1 month ago (2012-11-12 18:20:58 UTC) #4
ahe
8 years, 1 month ago (2012-11-12 20:35:23 UTC) #5
Thank you, Stephen.

https://codereview.chromium.org/11369181/diff/3001/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (right):

https://codereview.chromium.org/11369181/diff/3001/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/lib/interceptors.dart:644: hash =
0x1fffffff & (hash + (0x03ffffff & hash) <<  3);
Same problem here as on line 646.

https://codereview.chromium.org/11369181/diff/3001/tests/compiler/dart2js_ext...
File tests/compiler/dart2js_extra/hash_code_test.dart (right):

https://codereview.chromium.org/11369181/diff/3001/tests/compiler/dart2js_ext...
tests/compiler/dart2js_extra/hash_code_test.dart:10: Expect.equals(37224448,
'b'.hashCode);
On 2012/11/12 18:20:58, sra1 wrote:
> = 0x02380000
> 
> There is something very wrong with these numbers.

I assume the problem is that these two value have roughly the same bits?

Powered by Google App Engine
This is Rietveld 408576698