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

Issue 11014013: Added slow_assert macro and flag for slow development assertions in the VM. (Closed)

Created:
8 years, 2 months ago by zerny-google
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Added slow_assert macro and flag for slow development assertions in the VM. R=kmillikin@google.com Committed: https://code.google.com/p/dart/source/detail?r=13069

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -15 lines) Patch
M runtime/platform/assert.h View 1 1 chunk +1 line, -2 lines 0 comments Download
A runtime/vm/assert.h View 1 2 3 4 1 chunk +24 lines, -0 lines 2 comments Download
M runtime/vm/compiler.cc View 1 2 3 4 5 3 chunks +4 lines, -2 lines 1 comment Download
M runtime/vm/flow_graph.cc View 1 2 3 6 chunks +8 lines, -8 lines 2 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 3 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
zerny-google
8 years, 2 months ago (2012-10-01 09:15:06 UTC) #1
Kevin Millikin (Google)
We should not commit such a limited-use python script. We can plumb the flag through ...
8 years, 2 months ago (2012-10-01 10:53:25 UTC) #2
zerny-google
Thanks. This should address your comments. http://codereview.chromium.org/11014013/diff/1/runtime/platform/assert.h File runtime/platform/assert.h (right): http://codereview.chromium.org/11014013/diff/1/runtime/platform/assert.h#newcode264 runtime/platform/assert.h:264: if (FLAG_slow_assert) ASSERT(cond); ...
8 years, 2 months ago (2012-10-01 11:12:04 UTC) #3
Kevin Millikin (Google)
LGTM. https://codereview.chromium.org/11014013/diff/5001/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): https://codereview.chromium.org/11014013/diff/5001/runtime/vm/compiler.cc#newcode52 runtime/vm/compiler.cc:52: DEFINE_FLAG(bool, slow_assert, false, "Enable slow assertions"); Let's spell ...
8 years, 2 months ago (2012-10-01 11:38:26 UTC) #4
zerny-google
http://codereview.chromium.org/11014013/diff/5001/runtime/vm/compiler.cc File runtime/vm/compiler.cc (right): http://codereview.chromium.org/11014013/diff/5001/runtime/vm/compiler.cc#newcode52 runtime/vm/compiler.cc:52: DEFINE_FLAG(bool, slow_assert, false, "Enable slow assertions"); On 2012/10/01 11:38:26, ...
8 years, 2 months ago (2012-10-01 11:50:36 UTC) #5
siva
8 years, 2 months ago (2012-10-01 23:35:40 UTC) #6
Please do not add a "vm/assert.h" file.

https://codereview.chromium.org/11014013/diff/10/runtime/vm/assert.h
File runtime/vm/assert.h (right):

https://codereview.chromium.org/11014013/diff/10/runtime/vm/assert.h#newcode3
runtime/vm/assert.h:3: // BSD-style license that can be found in the LICENSE
file.
I think it is not a good idea to add this file as we will end up with multiple
versions of assert.h and it can be very confusing.

https://codereview.chromium.org/11014013/diff/10/runtime/vm/assert.h#newcode20
runtime/vm/assert.h:20: #endif
I don't quite understand the need for a VM wide SLOW_ASSERT macro. We want to
run with ASSERT on all the time in many parts of the VM.

https://codereview.chromium.org/11014013/diff/10/runtime/vm/compiler.cc
File runtime/vm/compiler.cc (right):

https://codereview.chromium.org/11014013/diff/10/runtime/vm/compiler.cc#newco...
runtime/vm/compiler.cc:53: DEFINE_FLAG(bool, slow_asserts, false, "Enable slow
assertions");
Ditto comment regarding slow_asserts.

https://codereview.chromium.org/11014013/diff/10/runtime/vm/flow_graph.cc
File runtime/vm/flow_graph.cc (right):

https://codereview.chromium.org/11014013/diff/10/runtime/vm/flow_graph.cc#new...
runtime/vm/flow_graph.cc:137: SLOW_ASSERT(1 == MembershipCount(use,
use->definition()->input_use_list()));
It sounds like this needs to be
ASSERT(VerifyMembershipCount(use, use->definition()->input_use_list()));

if MemberShipCount is a very expensive operation and you do not want it executed
all the time then maybe you could have a '--verify-compiler-state' or some
equivalent flag and all these verification could be conditional on this flag.

https://codereview.chromium.org/11014013/diff/10/runtime/vm/flow_graph.cc#new...
runtime/vm/flow_graph.cc:285: SLOW_ASSERT(ValidateUseLists());
Ditto comment, this would be
ASSERT(ValidateUseLists());

and if that is an expensive operation you could conditionalize it under
'--verify-compiler-state'

Powered by Google App Engine
This is Rietveld 408576698