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

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

Issue 14783015: Fix performance regression after adding inlining support for operators, [], and []=. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (revision 22723)
+++ sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (working copy)
@@ -222,13 +222,6 @@
}
}
- HInstruction unwrap(instruction) {
- do {
- instruction = instruction.checkedInput;
- } while (instruction is HCheck);
- return instruction;
- }
-
void markAsLiveInEnvironment(HInstruction instruction,
LiveEnvironment environment) {
if (generateAtUseSite.contains(instruction)) {
@@ -239,7 +232,8 @@
// checked instruction live. The checked instruction and the
// [HCheck] will share the same live ranges.
if (instruction is HCheck) {
- HInstruction checked = unwrap(instruction);
+ HCheck check = instruction;
+ HInstruction checked = check.unwrap();
if (!generateAtUseSite.contains(checked)) {
environment.add(checked, instructionId);
}
@@ -253,7 +247,8 @@
// Special case the HCheck instruction to have the same live
// interval as the instruction it is checking.
if (instruction is HCheck) {
- HInstruction checked = unwrap(instruction);
+ HCheck check = instruction;
+ HInstruction checked = check.unwrap();
if (!generateAtUseSite.contains(checked)) {
liveIntervals.putIfAbsent(checked, () => new LiveInterval());
// Unconditionally force the live ranges of the HCheck to
@@ -625,17 +620,15 @@
* Returns whether [instruction] needs a name. Instructions that
* have no users or that are generated at use site do not need a name.
*/
- bool needsName(HInstruction instruction) {
+ bool needsName(instruction) {
if (instruction is HThis) return false;
if (instruction is HParameterValue) return true;
if (instruction.usedBy.isEmpty) return false;
if (generateAtUseSite.contains(instruction)) return false;
- // A [HCheck] instruction that has control flow needs a name only if its
- // checked input needs a name (for example, a checked [HConstant] does not
- // need a name).
- if (instruction is HCheck && instruction.isControlFlow()) {
- HCheck check = instruction;
- return needsName(instruction.checkedInput);
+ // A [HCheck] instruction needs a name only if its
+ // checked input does not have a fixed name or value.
+ if (instruction is HCheck) {
+ return !instruction.unwrap().isCodeMotionInvariant();
}
return true;
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698