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

Issue 8267004: Faster slow asserts. (Closed)

Created:
9 years, 2 months ago by Erik Corry
Modified:
9 years, 2 months ago
CC:
v8-dev
Visibility:
Public.

Description

Faster slow asserts. Committed: http://code.google.com/p/v8/source/detail?r=9607

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -5 lines) Patch
M src/checks.h View 2 chunks +2 lines, -5 lines 2 comments Download

Messages

Total messages: 5 (0 generated)
Erik Corry
9 years, 2 months ago (2011-10-13 11:51:31 UTC) #1
Vyacheslav Egorov (Chromium)
LGTM
9 years, 2 months ago (2011-10-13 11:53:52 UTC) #2
Sven Panne
http://codereview.chromium.org/8267004/diff/1/src/checks.h File src/checks.h (right): http://codereview.chromium.org/8267004/diff/1/src/checks.h#newcode273 src/checks.h:273: #define SLOW_ASSERT(condition) if (FLAG_enable_slow_asserts) CHECK(condition) Although it's a bit ...
9 years, 2 months ago (2011-10-13 13:07:00 UTC) #3
Kevin Millikin (Chromium)
http://codereview.chromium.org/8267004/diff/1/src/checks.h File src/checks.h (right): http://codereview.chromium.org/8267004/diff/1/src/checks.h#newcode273 src/checks.h:273: #define SLOW_ASSERT(condition) if (FLAG_enable_slow_asserts) CHECK(condition) On 2011/10/13 13:07:00, Sven ...
9 years, 2 months ago (2011-10-13 13:21:19 UTC) #4
Sven Panne
9 years, 2 months ago (2011-10-13 14:09:25 UTC) #5
On 2011/10/13 13:21:19, Kevin Millikin wrote:
> http://codereview.chromium.org/8267004/diff/1/src/checks.h
> File src/checks.h (right):
> 
> http://codereview.chromium.org/8267004/diff/1/src/checks.h#newcode273
> src/checks.h:273: #define SLOW_ASSERT(condition) if (FLAG_enable_slow_asserts)
> CHECK(condition)
> On 2011/10/13 13:07:00, Sven wrote:
> > Although it's a bit late for a comment: Using the ugly, but common "do { if
> ...
> > } while(0)" idiom here would be safer...
> 
> Yes, we need that, or else the ugly
> 
> if (FLAG_enable_slow_asserts) CHECK(condition) else (void)0
> 
> as used in the CHECK_OK macro in parser.h.

I've just seen CHECK_OK for the first time... o_O This even beats our usual 2nd
order macros in terms of "readability". +1 for the greatest CPP abuse in v8! :-)

Powered by Google App Engine
This is Rietveld 408576698