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

Unified Diff: dart/frog/leg/ssa/builder.dart

Issue 9536020: Work around buggy break in List.sort and optimize constant folding of negative values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « dart/frog/leg/lib/dual_pivot_quicksort.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/ssa/builder.dart
diff --git a/dart/frog/leg/ssa/builder.dart b/dart/frog/leg/ssa/builder.dart
index 04deac976cc90c3fc947801210c55d635b4e4caa..cffadd05bb0aadf001ff35a9b91f42ff966648c9 100644
--- a/dart/frog/leg/ssa/builder.dart
+++ b/dart/frog/leg/ssa/builder.dart
@@ -1302,7 +1302,15 @@ class SsaBuilder implements Visitor {
new HStatic(interceptors.getPrefixOperatorInterceptor(op));
add(target);
switch (op.source.stringValue) {
- case "-": push(new HNegate(target, operand)); break;
+ case "-":
kasperl 2012/03/01 06:13:00 This could possible be dealt with in a faster way
ahe 2012/03/01 06:54:15 Done.
+ if ((operand is HLiteral) && (operand.value is double)) {
+ stack.add(graph.addNewLiteralDouble(-operand.value));
+ } else if ((operand is HLiteral) && (operand.value is int)) {
+ stack.add(graph.addNewLiteralInt(-operand.value));
ngeoffray 2012/02/29 20:36:26 Why is that not done in the constant folder instea
ahe 2012/02/29 20:41:24 Because it is really slow at doing it.
ngeoffray 2012/03/01 08:15:51 Why is that?
floitsch 2012/03/01 10:32:18 The problem is not really the constant folding, bu
+ } else {
+ push(new HNegate(target, operand));
+ }
+ break;
case "~": push(new HBitNot(target, operand)); break;
default: unreachable();
}
« no previous file with comments | « dart/frog/leg/lib/dual_pivot_quicksort.dart ('k') | dart/tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698