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

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

Issue 12304006: When inlining, create a new local handler, to avoid polluting the local handler of the caller. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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/language/inline_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/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 18617)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -1009,6 +1009,12 @@
compiledArguments);
assert(succeeded);
+ // Create the inlining state after evaluating the arguments, that
+ // may have an impact on the state of the current method.
+ InliningState state = new InliningState(
+ function, returnElement, returnType, elements, stack, localsHandler);
+ localsHandler = new LocalsHandler.from(localsHandler);
+
FunctionSignature signature = function.computeSignature(compiler);
int index = 0;
signature.orderedForEachParameter((Element parameter) {
@@ -1036,8 +1042,6 @@
}
}
}
- InliningState state =
- new InliningState(function, returnElement, returnType, elements, stack);
// TODO(kasperl): Bad smell. We shouldn't be constructing elements here.
returnElement = new ElementX(const SourceString("result"),
@@ -1063,6 +1067,7 @@
assert(stack.length == 1);
state.oldStack.add(stack[0]);
stack = state.oldStack;
+ localsHandler = state.oldLocalsHandler;
}
/**
@@ -4834,12 +4839,14 @@
final DartType oldReturnType;
final TreeElements oldElements;
final List<HInstruction> oldStack;
+ final LocalsHandler oldLocalsHandler;
InliningState(this.function,
this.oldReturnElement,
this.oldReturnType,
this.oldElements,
- this.oldStack) {
+ this.oldStack,
+ this.oldLocalsHandler) {
assert(function.isImplementation);
}
}
« no previous file with comments | « no previous file | tests/language/inline_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698