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

Issue 2531533003: Revert of [base] Define CHECK comparison for signed vs. unsigned (Closed)

Created:
4 years ago by Clemens Hammacher
Modified:
4 years ago
CC:
ahaas, Benedikt Meurer, v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Revert of [base] Define CHECK comparison for signed vs. unsigned (patchset #5 id:80001 of https://codereview.chromium.org/2526783002/ ) Reason for revert: Need to revert previous CL because of Android compile error, and this one depends in it. Original issue's description: > [base] Define CHECK comparison for signed vs. unsigned > > The current CHECK/DCHECK implementation fails statically if a signed > value is compared against an unsigned value. The common solution is to > cast on each caller, which is tedious and error-prone (might hide bugs). > This CL implements signed vs. unsigned comparisons by executing up to > two comparisons. For example, if i is int32_t and u is uint_32_t, a > DCHECK_LE(i, u) would create the check > i <= 0 || static_cast<uint32_t>(i) <= u. > For checks against constants, at least one of the checks can be removed > by compiler optimizations. > > The tradeoff we have to make is to sometimes silently execute an > additional comparison. And we increase code complexity of course, even > though the usage is just as easy (or even easier) as before. > > The compile time impact seems to be minimal: > I ran 3 full compilations for Optdebug on my local machine, one time on > the current ToT, one time with this CL plus http://crrev.com/2524093002. > Before: 143.72 +- 1.21 seconds > Now: 144.18 +- 0.67 seconds > > In order to check that the new comparisons are working, I refactored > some DCHECKs in wasm to use the new magic. > > R=bmeurer@chromium.org, titzer@chromium.org > > Committed: https://crrev.com/5925074a9dab5a8577766545b91b62f2c531d3dc > Cr-Commit-Position: refs/heads/master@{#41275} TBR=ishell@chromium.org,titzer@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Committed: https://crrev.com/0406620c6c43a405b0025795e03056ddc7667789 Cr-Commit-Position: refs/heads/master@{#41277}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -90 lines) Patch
M src/base/logging.h View 1 chunk +5 lines, -61 lines 0 comments Download
M src/log-utils.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/wasm/ast-decoder.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/wasm/wasm-debug.cc View 2 chunks +6 lines, -4 lines 0 comments Download
M src/wasm/wasm-interpreter.cc View 4 chunks +6 lines, -6 lines 0 comments Download
M src/wasm/wasm-module.h View 2 chunks +2 lines, -2 lines 0 comments Download
M src/wasm/wasm-module.cc View 4 chunks +5 lines, -5 lines 0 comments Download
M src/wasm/wasm-objects.cc View 4 chunks +8 lines, -6 lines 0 comments Download
M src/wasm/wasm-text.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (6 generated)
Clemens Hammacher
Created Revert of [base] Define CHECK comparison for signed vs. unsigned
4 years ago (2016-11-24 19:14:55 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2531533003/1
4 years ago (2016-11-24 19:15:01 UTC) #3
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years ago (2016-11-24 19:15:03 UTC) #5
Michael Achenbach
lgtm
4 years ago (2016-11-24 19:50:38 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2531533003/1
4 years ago (2016-11-24 19:50:46 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years ago (2016-11-24 19:50:58 UTC) #11
commit-bot: I haz the power
4 years ago (2016-11-24 19:51:24 UTC) #13
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/0406620c6c43a405b0025795e03056ddc7667789
Cr-Commit-Position: refs/heads/master@{#41277}

Powered by Google App Engine
This is Rietveld 408576698