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

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

Issue 13090002: Free names of inputs of an instruction that is generate at use site. An input of an instruction tha… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « no previous file | tests/compiler/dart2js/ssa_phi_codegen_test.dart » ('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 20723)
+++ sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (working copy)
@@ -626,7 +626,9 @@
return instructionInterval.diesAt(start);
}
- void handleInstruction(HInstruction instruction, VariableNamer namer) {
+ void freeUsedNamesAt(HInstruction instruction,
+ HInstruction at,
+ VariableNamer namer) {
// TODO(ager): We cannot perform this check to free names for
// HCheck instructions because they are special cased to have the
// same live intervals as the instruction they are checking. This
@@ -635,17 +637,27 @@
// end up checking that otherInput dies not here, but at the
// location of checkedInput. We should preserve the start id for
// the check instruction.
- if (instruction is! HCheck) {
+ if (at is HCheck) return;
+ if (needsName(instruction)) {
+ if (diesAt(instruction, at)) {
+ namer.freeName(instruction);
+ }
+ } else if (generateAtUseSite.contains(instruction)) {
+ // If the instruction is generated at use site, then all its
+ // inputs may also die at [at].
for (int i = 0, len = instruction.inputs.length; i < len; i++) {
HInstruction input = instruction.inputs[i];
- // If [input] has a name, and its use here is the last use, free
- // its name.
- if (needsName(input) && diesAt(input, instruction)) {
- namer.freeName(input);
- }
+ freeUsedNamesAt(input, at, namer);
}
}
+ }
+ void handleInstruction(HInstruction instruction, VariableNamer namer) {
+ for (int i = 0, len = instruction.inputs.length; i < len; i++) {
+ HInstruction input = instruction.inputs[i];
+ freeUsedNamesAt(input, instruction, namer);
+ }
+
if (needsName(instruction)) {
namer.allocateName(instruction);
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/ssa_phi_codegen_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698