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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/builder.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 | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.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/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 14615)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -332,8 +332,7 @@
if (element != null && element.isGenerativeConstructorBody()) {
// The box is passed as a parameter to a generative
// constructor body.
- box = new HParameterValue(scopeData.boxElement);
- builder.add(box);
+ box = builder.addParameter(scopeData.boxElement);
} else {
box = createBox();
}
@@ -394,8 +393,7 @@
FunctionElement functionElement = element;
FunctionSignature params = functionElement.computeSignature(compiler);
params.orderedForEachParameter((Element parameterElement) {
- HInstruction parameter = new HParameterValue(parameterElement);
- builder.add(parameter);
+ HInstruction parameter = builder.addParameter(parameterElement);
builder.parameters[parameterElement] = parameter;
directLocals[parameterElement] = parameter;
parameter.guaranteedType =
@@ -896,6 +894,7 @@
HInstruction rethrowableException;
Map<Element, HInstruction> parameters;
final RuntimeTypeInformation rti;
+ HParameterValue lastAddedParameter;
Map<TargetElement, JumpHandler> jumpTargets;
@@ -1039,6 +1038,17 @@
return bodyElement;
}
+ HParameterValue addParameter(Element element) {
+ HParameterValue result = new HParameterValue(element);
+ if (lastAddedParameter == null) {
+ graph.entry.addBefore(graph.entry.first, result);
+ } else {
+ graph.entry.addAfter(lastAddedParameter, result);
+ }
+ lastAddedParameter = result;
+ return result;
+ }
+
/**
* Documentation wanted -- johnniwinther
*
@@ -1457,8 +1467,7 @@
if (currentElement.isGenerativeConstructorBody()) {
// A generative constructor body receives extra parameters that
// indicate if a parameter was passed to the factory.
- check = new HParameterValue(checkResultElement);
- add(check);
+ check = addParameter(checkResultElement);
} else {
// This is the code we emit for a parameter that is being checked
// on whether it was given at value at the call site:
@@ -1550,8 +1559,7 @@
var enclosing = element.enclosingElement;
if (element.isConstructor() && compiler.world.needsRti(enclosing)) {
enclosing.typeVariables.forEach((TypeVariableType typeVariable) {
- HParameterValue param = new HParameterValue(typeVariable.element);
- add(param);
+ HParameterValue param = addParameter(typeVariable.element);
localsHandler.directLocals[typeVariable.element] = param;
});
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698