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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/nodes.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
Index: sdk/lib/_internal/compiler/implementation/ssa/nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (revision 31017)
+++ sdk/lib/_internal/compiler/implementation/ssa/nodes.dart (working copy)
@@ -65,6 +65,7 @@
R visitThis(HThis node);
R visitThrow(HThrow node);
R visitThrowExpression(HThrowExpression node);
+ R visitTruncatingDivide(HTruncatingDivide node);
R visitTry(HTry node);
R visitTypeConversion(HTypeConversion node);
R visitTypeKnown(HTypeKnown node);
@@ -331,6 +332,7 @@
visitThis(HThis node) => visitParameterValue(node);
visitThrow(HThrow node) => visitControlFlow(node);
visitThrowExpression(HThrowExpression node) => visitInstruction(node);
+ visitTruncatingDivide(HTruncatingDivide node) => visitBinaryArithmetic(node);
visitTry(HTry node) => visitControlFlow(node);
visitIs(HIs node) => visitInstruction(node);
visitTypeConversion(HTypeConversion node) => visitCheck(node);
@@ -798,6 +800,7 @@
static const int VOID_TYPE_TYPECODE = 33;
static const int INTERFACE_TYPE_TYPECODE = 34;
static const int DYNAMIC_TYPE_TYPECODE = 35;
+ static const int TRUNCATING_DIVIDE_TYPECODE = 36;
HInstruction(this.inputs, this.instructionType)
: id = idCounter++, usedBy = <HInstruction>[] {
@@ -1679,6 +1682,18 @@
bool dataEquals(HInstruction other) => true;
}
+class HTruncatingDivide extends HBinaryArithmetic {
+ HTruncatingDivide(left, right, selector, type)
+ : super(left, right, selector, type);
+ accept(HVisitor visitor) => visitor.visitTruncatingDivide(this);
+
+ BinaryOperation operation(ConstantSystem constantSystem)
+ => constantSystem.truncatingDivide;
+ int typeCode() => HInstruction.TRUNCATING_DIVIDE_TYPECODE;
+ bool typeEquals(other) => other is HTruncatingDivide;
+ bool dataEquals(HInstruction other) => true;
+}
+
/**
* An [HSwitch] instruction has one input for the incoming
* value, and one input per constant that it can switch on.

Powered by Google App Engine
This is Rietveld 408576698