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

Issue 1405113003: dart2js js_runtime: faster code for floor() & ceil() (Closed)

Created:
5 years, 2 months ago by sra1
Modified:
4 years, 5 months ago
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

dart2js js_runtime: faster code for floor() & ceil() Within the [-2^31, 2^31) range it is faster to truncate and correct at boundaries than call Math.ceil/Math.floor. Each call to toInt() has been specialized to the calling operator (ceil, floor, ~/ etc). This makes the conversion faster (values are already integral) and lets us put the name of the operation and original operands in conversion errors, e.g (a / b).floor(); // b == 0 Unsupported operation: Infinity --> Unsupported operation: Infinity.floor() a ~/ b; // b == 0 Unsupported operation: Infinity --> Unsupported operation: Result of truncating division is Infinity: 132 ~/ 0 R=sigmund@google.com Downside: an extra 400 bytes Committed: https://github.com/dart-lang/sdk/commit/1eee3c7dc74aa22ef9b3a45b0fd821e67ac8da1d

Patch Set 1 : #

Total comments: 4

Patch Set 2 : rebase #

Patch Set 3 : whitespace #

Patch Set 4 : bug fix for floor() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -14 lines) Patch
M sdk/lib/_internal/js_runtime/lib/js_number.dart View 1 2 3 3 chunks +68 lines, -13 lines 0 comments Download
A tests/compiler/dart2js_extra/truncation_errors_test.dart View 1 2 1 chunk +119 lines, -0 lines 0 comments Download
M tests/corelib/double_floor_test.dart View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (8 generated)
sra1
5 years, 1 month ago (2015-11-06 04:12:26 UTC) #8
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/1405113003/diff/80001/sdk/lib/_internal/js_runtime/lib/js_number.dart File sdk/lib/_internal/js_runtime/lib/js_number.dart (right): https://codereview.chromium.org/1405113003/diff/80001/sdk/lib/_internal/js_runtime/lib/js_number.dart#newcode110 sdk/lib/_internal/js_runtime/lib/js_number.dart:110: } Would it make the code smaller if ...
5 years, 1 month ago (2015-11-06 17:37:01 UTC) #9
sra1
https://codereview.chromium.org/1405113003/diff/80001/sdk/lib/_internal/js_runtime/lib/js_number.dart File sdk/lib/_internal/js_runtime/lib/js_number.dart (right): https://codereview.chromium.org/1405113003/diff/80001/sdk/lib/_internal/js_runtime/lib/js_number.dart#newcode110 sdk/lib/_internal/js_runtime/lib/js_number.dart:110: } On 2015/11/06 17:37:01, Siggi Cherem (dart-lang) wrote: > ...
5 years, 1 month ago (2015-11-06 21:52:45 UTC) #10
sra1
4 years, 5 months ago (2016-07-15 19:28:10 UTC) #12
Message was sent while issue was closed.
Committed patchset #4 (id:140001) manually as
1eee3c7dc74aa22ef9b3a45b0fd821e67ac8da1d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698