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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10905235: Check boolean conversion in checked mode. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen.dart (revision 12308)
+++ lib/compiler/implementation/ssa/codegen.dart (working copy)
@@ -2444,18 +2444,23 @@
pushStatement(new js.If.noElse(test, body), node);
return;
}
+ assert(node.isCheckedModeCheck || node.isCastTypeCheck);
- assert(node.isCheckedModeCheck || node.isCastTypeCheck);
- SourceString helper = backend.getCheckedModeHelper(type);
- String additionalArgument = backend.namer.operatorIs(element);
- if (node.isCastTypeCheck) {
- helper = castNames[helper.stringValue];
+ SourceString helper;
+ if (node.isBooleanConversionCheck) {
+ helper = const SourceString('boolConversionCheck');
+ } else {
+ helper = backend.getCheckedModeHelper(type);
+ if (node.isCastTypeCheck) {
+ helper = castNames[helper.stringValue];
+ }
}
Element helperElement = compiler.findHelper(helper);
world.registerStaticUse(helperElement);
List<js.Expression> arguments = <js.Expression>[];
use(node.checkedInput);
arguments.add(pop());
+ String additionalArgument = backend.namer.operatorIs(element);
arguments.add(new js.LiteralString("'$additionalArgument'"));
String helperName = backend.namer.isolateAccess(helperElement);
push(new js.Call(new js.VariableUse(helperName), arguments));
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698