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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 1394003008: dart2js cps_ir: Unary operator improvements (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 92852b7e7c04db1ca1b8857971a57c5320b79d5f..cc9a406f7c9b46e8516c849efd5cbf4a888a27b6 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -883,6 +883,10 @@ class CodeGenerator extends tree_ir.StatementVisitor
case BuiltinOperator.NumShr:
// No normalization required since output is always uint32.
return js.js('# >>> #', args);
+ case BuiltinOperator.NumBitNot:
+ return js.js('(~#) >>> 0', args);
+ case BuiltinOperator.NumNegate:
+ return js.js('-#', args);
case BuiltinOperator.StringConcatenate:
if (args.isEmpty) return js.string('');
return args.reduce((e1,e2) => new js.Binary('+', e1, e2));
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698