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

Issue 21301003: Fixes javascript integer overflow check. (Closed)

Created:
7 years, 4 months ago by zra
Modified:
7 years, 4 months ago
CC:
reviews_dartlang.org, floitsch
Visibility:
Public.

Description

Fixes javascript integer overflow check. R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=25675

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -214 lines) Patch
M runtime/lib/errors_patch.dart View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/vm/exceptions.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/exceptions.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 10 chunks +16 lines, -14 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 8 chunks +27 lines, -14 lines 2 comments Download
M runtime/vm/parser.cc View 1 2 3 4 5 1 chunk +4 lines, -3 lines 0 comments Download
M runtime/vm/symbols.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
D tests/standalone/53bit_overflow_literal_test.dart View 1 2 3 1 chunk +0 lines, -18 lines 0 comments Download
D tests/standalone/53bit_overflow_test.dart View 1 2 3 1 chunk +0 lines, -118 lines 0 comments Download
A + tests/standalone/javascript_int_overflow_literal_test.dart View 1 2 3 1 chunk +3 lines, -3 lines 1 comment Download
A + tests/standalone/javascript_int_overflow_test.dart View 1 2 3 4 5 3 chunks +30 lines, -29 lines 0 comments Download
M tests/standalone/standalone.status View 1 2 3 3 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
zra
What tests were failing on this?
7 years, 4 months ago (2013-07-30 23:04:52 UTC) #1
siva
On 2013/07/30 23:04:52, zra wrote: > What tests were failing on this? The failing tests ...
7 years, 4 months ago (2013-07-31 02:55:51 UTC) #2
zra
On 2013/07/31 02:55:51, siva wrote: > On 2013/07/30 23:04:52, zra wrote: > > What tests ...
7 years, 4 months ago (2013-07-31 15:17:02 UTC) #3
siva
lgtm https://codereview.chromium.org/21301003/diff/17001/runtime/lib/errors_patch.dart File runtime/lib/errors_patch.dart (right): https://codereview.chromium.org/21301003/diff/17001/runtime/lib/errors_patch.dart#newcode185 runtime/lib/errors_patch.dart:185: String toString() => "54-bit Overflow: $_value"; Should the ...
7 years, 4 months ago (2013-07-31 16:08:28 UTC) #4
zra
Thanks! https://codereview.chromium.org/21301003/diff/17001/runtime/lib/errors_patch.dart File runtime/lib/errors_patch.dart (right): https://codereview.chromium.org/21301003/diff/17001/runtime/lib/errors_patch.dart#newcode185 runtime/lib/errors_patch.dart:185: String toString() => "54-bit Overflow: $_value"; On 2013/07/31 ...
7 years, 4 months ago (2013-07-31 17:46:30 UTC) #5
zra
Committed patchset #6 manually as r25675 (presubmit successful).
7 years, 4 months ago (2013-07-31 17:51:34 UTC) #6
srdjan
lgtm
7 years, 4 months ago (2013-07-31 22:16:44 UTC) #7
Florian Schneider
DBC: https://codereview.chromium.org/21301003/diff/32002/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/21301003/diff/32002/runtime/vm/object.cc#newcode11287 runtime/vm/object.cc:11287: // -2^54 - 1 ... 2^54 - 1, ...
7 years, 4 months ago (2013-08-01 15:45:02 UTC) #8
zra
On 2013/08/01 15:45:02, Florian Schneider wrote: > DBC: > > https://codereview.chromium.org/21301003/diff/32002/runtime/vm/object.cc > File runtime/vm/object.cc (right): ...
7 years, 4 months ago (2013-08-01 15:58:19 UTC) #9
Florian Schneider
7 years, 4 months ago (2013-08-02 10:24:16 UTC) #10
Message was sent while issue was closed.
Not exactly: To be precise, 2^53 is represented precisely by the FP bit
representation 0x4340000000000000.
2^53 - 1, 2^53 - 2, etc. are also precisely represented.

Correspondingly -2^53 is precisely represented as 0xc340000000000000. So is
-2^53 + 1, -2^53 + 2, etc.

Your tests and code do not include those two numbers. Please update them
accordingly so that the valid interval
is (-2^53, 2^53) with the boundaries included.

https://codereview.chromium.org/21301003/diff/32002/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/21301003/diff/32002/runtime/vm/object.cc#newc...
runtime/vm/object.cc:11291: return (Utils::IsInt(54, value)) && (value !=
(-0x1FFFFFFFFFFFFF - 1));
I think this should be

return Utils::IsInt(54, value) || (value == 0x20000000000000);

https://codereview.chromium.org/21301003/diff/32002/tests/standalone/javascri...
File tests/standalone/javascript_int_overflow_literal_test.dart (right):

https://codereview.chromium.org/21301003/diff/32002/tests/standalone/javascri...
tests/standalone/javascript_int_overflow_literal_test.dart:12: var
too_big_literal = 0x20000000000000;  /// 01: compile-time error
0x20000000000000 is fine.

0x20000000000001 too large.

Same with negative integers:

-0x20000000000000 is fine, -0x20000000000001 overflows.

Powered by Google App Engine
This is Rietveld 408576698