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

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

Issue 10831392: If an instruction is known to already by a number, the integer check will try to make it an integer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/bailout.dart ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/nodes.dart
===================================================================
--- lib/compiler/implementation/ssa/nodes.dart (revision 10957)
+++ lib/compiler/implementation/ssa/nodes.dart (working copy)
@@ -1119,6 +1119,13 @@
HType get guaranteedType() => HType.INTEGER;
+ HType computeDesiredTypeForInput(HInstruction input, HTypeMap types) {
+ // If the desired type of the input is already a number, we want
+ // to specialize it to an integer.
+ if (input.isNumber(types)) return HType.INTEGER;
kasperl 2012/08/21 05:36:00 Maybe rewrite using ?:
ngeoffray 2012/08/21 07:38:41 Done.
+ return super.computeDesiredTypeForInput(input, types);
+ }
+
accept(HVisitor visitor) => visitor.visitIntegerCheck(this);
int typeCode() => 3;
bool typeEquals(other) => other is HIntegerCheck;
« no previous file with comments | « lib/compiler/implementation/ssa/bailout.dart ('k') | tests/compiler/dart2js/dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698