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

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

Issue 11275189: Clean up the codegen by not re-computing parameter names. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/optimize.dart ('k') | no next file » | 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 14615)
+++ sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart (working copy)
@@ -509,13 +509,6 @@
name = names.ownName[temp];
} while (name == null && temp is HCheck);
if (name != null) return addAllocatedName(instruction, name);
- } else if (instruction is HParameterValue) {
- HParameterValue parameter = instruction;
- name = parameterNames[parameter.sourceElement];
- if (name == null) {
- name = allocateWithHint(parameter.sourceElement.name.slowToString());
- }
- return addAllocatedName(instruction, name);
}
if (instruction.sourceElement != null) {
@@ -536,6 +529,9 @@
}
String addAllocatedName(HInstruction instruction, String name) {
+ if (instruction is HParameterValue) {
+ parameterNames[instruction.sourceElement] = name;
+ }
usedNames.add(name);
names.addNameUsed(name);
names.ownName[instruction] = name;
@@ -613,11 +609,11 @@
* have no users or that are generated at use site does not need a name.
*/
bool needsName(HInstruction instruction) {
- if (instruction.usedBy.isEmpty) return false;
// TODO(ngeoffray): locals/parameters are being generated at use site,
// but we need a name for them. We should probably not make
// them generate at use site to make things simpler.
if (instruction is HLocalValue && instruction is !HThis) 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 (e.g. a check [HConstant] does not
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/optimize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698