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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 966763002: Fix order of box and types for constructor-body invocations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added tests. Created 5 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/constructor12_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index ea4d0808b9b4174c12d6b9be4c24020a20cf6d7a..bfeaefbea404b7cc6bcf952e555030df02324378 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -2228,6 +2228,15 @@ class SsaBuilder extends ResolvedVisitor {
}
});
+ // If there are locals that escape (ie mutated in closures), we
+ // pass the box to the constructor.
+ // The box must be passed before any type variable.
+ ClosureScope scopeData = parameterClosureData.capturingScopes[node];
+ if (scopeData != null) {
+ bodyCallInputs.add(localsHandler.readLocal(scopeData.boxElement));
+ }
+
+ // Type variables arguments must come after the box (if there is one).
ClassElement currentClass = constructor.enclosingClass;
if (backend.classNeedsRti(currentClass)) {
// If [currentClass] needs RTI, we add the type variables as
@@ -2240,13 +2249,6 @@ class SsaBuilder extends ResolvedVisitor {
});
}
- // If there are locals that escape (ie mutated in closures), we
- // pass the box to the constructor.
- ClosureScope scopeData = parameterClosureData.capturingScopes[node];
- if (scopeData != null) {
- bodyCallInputs.add(localsHandler.readLocal(scopeData.boxElement));
- }
-
if (!isNativeUpgradeFactory && // TODO(13836): Fix inlining.
tryInlineMethod(body, null, bodyCallInputs, function)) {
pop();
« no previous file with comments | « no previous file | tests/language/constructor12_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698