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

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

Issue 106973008: Optimize num::~/, num::>> and num::<< for some cases. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (revision 31017)
+++ sdk/lib/_internal/compiler/implementation/ssa/codegen.dart (working copy)
@@ -1249,6 +1249,16 @@
visitShiftLeft(HShiftLeft node) => visitBitInvokeBinary(node, '<<');
visitShiftRight(HShiftRight node) => visitBitInvokeBinary(node, '>>>');
+ visitTruncatingDivide(HTruncatingDivide node) {
+ assert(node.left.isUInt31(compiler));
+ assert(node.right.isPositiveInteger(compiler));
+ use(node.left);
+ js.Expression jsLeft = pop();
+ use(node.right);
+ push(new js.Binary('/', jsLeft, pop()), node);
+ push(new js.Binary('|', pop(), new js.LiteralNumber("0")), node);
+ }
+
visitNegate(HNegate node) => visitInvokeUnary(node, '-');
visitLess(HLess node) => visitRelational(node, '<');
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698