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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart

Issue 12042003: Move relational operators to the new interceptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ssa; 5 part of ssa;
6 6
7 /** 7 /**
8 * Instead of emitting each SSA instruction with a temporary variable 8 * Instead of emitting each SSA instruction with a temporary variable
9 * mark instructions that can be emitted at their use-site. 9 * mark instructions that can be emitted at their use-site.
10 * For example, in: 10 * For example, in:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 // An integer check method must not have its input generated at use site, 61 // An integer check method must not have its input generated at use site,
62 // because it's using it twice. 62 // because it's using it twice.
63 void visitIntegerCheck(HIntegerCheck instruction) {} 63 void visitIntegerCheck(HIntegerCheck instruction) {}
64 64
65 // A type guard should not generate its input at use site, otherwise 65 // A type guard should not generate its input at use site, otherwise
66 // they would not be alive. 66 // they would not be alive.
67 void visitTypeGuard(HTypeGuard instruction) {} 67 void visitTypeGuard(HTypeGuard instruction) {}
68 68
69 // If an equality operation is builtin it must only have its inputs generated
70 // at use site if it does not require an expression with repeated uses
71 // (because of null / undefined).
72 void visitEquals(HEquals instruction) {
73 HInstruction left = instruction.left;
74 HInstruction right = instruction.right;
75 if (!instruction.isBuiltin(types) ||
76 singleIdentityComparison(left, right, types) != null) {
77 super.visitEquals(instruction);
78 }
79 // Do nothing.
80 }
81
82 // An identity operation must only have its inputs generated at use site if 69 // An identity operation must only have its inputs generated at use site if
83 // does not require an expression with multiple uses (because of null / 70 // does not require an expression with multiple uses (because of null /
84 // undefined). 71 // undefined).
85 void visitIdentity(HIdentity instruction) { 72 void visitIdentity(HIdentity instruction) {
86 HInstruction left = instruction.left; 73 HInstruction left = instruction.left;
87 HInstruction right = instruction.right; 74 HInstruction right = instruction.right;
88 if (singleIdentityComparison(left, right, types) != null) { 75 if (singleIdentityComparison(left, right, types) != null) {
89 super.visitIdentity(instruction); 76 super.visitIdentity(instruction);
90 } 77 }
91 // Do nothing. 78 // Do nothing.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 330 }
344 331
345 // If [thenInput] is defined in the first predecessor, then it is only used 332 // If [thenInput] is defined in the first predecessor, then it is only used
346 // by [phi] and can be generated at use site. 333 // by [phi] and can be generated at use site.
347 if (identical(thenInput.block, end.predecessors[0])) { 334 if (identical(thenInput.block, end.predecessors[0])) {
348 assert(thenInput.usedBy.length == 1); 335 assert(thenInput.usedBy.length == 1);
349 markAsGenerateAtUseSite(thenInput); 336 markAsGenerateAtUseSite(thenInput);
350 } 337 }
351 } 338 }
352 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698