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

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

Issue 10453096: Use the parameterNames map to allocate names for HParameterValue. In case of native methods, we mus… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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 | « dart/lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/ssa/variable_allocator.dart
===================================================================
--- dart/lib/compiler/implementation/ssa/variable_allocator.dart (revision 8145)
+++ dart/lib/compiler/implementation/ssa/variable_allocator.dart (working copy)
@@ -385,8 +385,9 @@
class VariableNamer {
final VariableNames names;
final Set<String> usedNames;
+ final Map<Element, String> parameterNames;
- VariableNamer(LiveEnvironment environment, this.names)
+ VariableNamer(LiveEnvironment environment, this.names, this.parameterNames)
: usedNames = new Set<String>() {
// [VariableNames.SWAP_TEMP] is being used when there is a cycle
// in a copy handler. Therefore we make sure no one will use it.
@@ -442,7 +443,10 @@
if (name == null) return;
} else if (instruction is HParameterValue) {
HParameterValue parameter = instruction;
- name = allocateWithHint(parameter.element.name.slowToString());
+ name = parameterNames[parameter.element];
+ if (name == null) {
+ name = allocateWithHint(parameter.element.name.slowToString());
+ }
} else if (instruction.sourceElement !== null) {
name = allocateWithHint(instruction.sourceElement.name.slowToString());
} else {
@@ -490,13 +494,15 @@
final Map<HBasicBlock, LiveEnvironment> liveInstructions;
final Map<HInstruction, LiveInterval> liveIntervals;
final Set<HInstruction> generateAtUseSite;
+ final Map<Element, String> parameterNames;
final VariableNames names;
SsaVariableAllocator(this.compiler,
this.liveInstructions,
this.liveIntervals,
- this.generateAtUseSite)
+ this.generateAtUseSite,
+ this.parameterNames)
: names = new VariableNames();
void visitGraph(HGraph graph) {
@@ -504,7 +510,8 @@
}
void visitBasicBlock(HBasicBlock block) {
- VariableNamer namer = new VariableNamer(liveInstructions[block], names);
+ VariableNamer namer = new VariableNamer(
+ liveInstructions[block], names, parameterNames);
block.forEachPhi((HPhi phi) {
handlePhi(phi, namer);
« no previous file with comments | « dart/lib/compiler/implementation/ssa/codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698