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

Issue 10905235: Check boolean conversion in checked mode. (Closed)

Created:
8 years, 3 months ago by ngeoffray
Modified:
8 years, 3 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Check boolean conversion in checked mode. Committed: https://code.google.com/p/dart/source/detail?r=12312

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -37 lines) Patch
M lib/compiler/implementation/js_backend/emitter.dart View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/lib/js_helper.dart View 1 2 2 chunks +12 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 chunks +15 lines, -8 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 chunk +10 lines, -5 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 2 chunks +5 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 2 chunks +5 lines, -20 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
ngeoffray
Fixes issue 5030.
8 years, 3 months ago (2012-09-13 10:25:40 UTC) #1
kasperl
LGTM. https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implementation/lib/js_helper.dart File lib/compiler/implementation/lib/js_helper.dart (right): https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implementation/lib/js_helper.dart#newcode981 lib/compiler/implementation/lib/js_helper.dart:981: boolTypeCheck(value); Wouldn't it be more logical to just ...
8 years, 3 months ago (2012-09-13 10:34:19 UTC) #2
ngeoffray
8 years, 3 months ago (2012-09-13 10:52:31 UTC) #3
Thanks Kasper. I also changed the emitter to put false to JS values needed by
the isolate library.

https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implem...
File lib/compiler/implementation/lib/js_helper.dart (right):

https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implem...
lib/compiler/implementation/lib/js_helper.dart:981: boolTypeCheck(value);
On 2012/09/13 10:34:19, kasperl wrote:
> Wouldn't it be more logical to just check that value is bool here? What kind
of
> error is this boolean conversion supposed to give if the value isn't a bool?
> Right now, you either get a type error or an assertion error which seems a bit
> weird.

As discussed, this method is implementing what the spec says: type check and
then assert it's not null. I kept the code as-is.

https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implem...
File lib/compiler/implementation/ssa/builder.dart (right):

https://chromiumcodereview.appspot.com/10905235/diff/2001/lib/compiler/implem...
lib/compiler/implementation/ssa/builder.dart:1437: HInstruction result;
On 2012/09/13 10:34:19, kasperl wrote:
> Maybe move this to the else branch and just return the result of calling
> potentiallyCheckType?

Done.

Powered by Google App Engine
This is Rietveld 408576698