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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/closure.dart

Issue 12389046: Re-apply: Inside a generative constructor, "this" is created at the very end. So we have to use the… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library closureToClassMapper; 5 library closureToClassMapper;
6 6
7 import "elements/elements.dart"; 7 import "elements/elements.dart";
8 import "dart2jslib.dart"; 8 import "dart2jslib.dart";
9 import "dart_types.dart"; 9 import "dart_types.dart";
10 import "scanner/scannerlib.dart" show Token; 10 import "scanner/scannerlib.dart" show Token;
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 useLocal(type.element); 440 useLocal(type.element);
441 } else if (type is InterfaceType) { 441 } else if (type is InterfaceType) {
442 InterfaceType ifcType = type; 442 InterfaceType ifcType = type;
443 for (DartType argument in ifcType.typeArguments) { 443 for (DartType argument in ifcType.typeArguments) {
444 analyzeTypeVariables(argument); 444 analyzeTypeVariables(argument);
445 } 445 }
446 } 446 }
447 } 447 }
448 if (outermostElement.isMember() && 448 if (outermostElement.isMember() &&
449 compiler.world.needsRti(outermostElement.getEnclosingClass())) { 449 compiler.world.needsRti(outermostElement.getEnclosingClass())) {
450 if (outermostElement.isInstanceMember() 450 if (outermostElement.isConstructor()) {
451 || outermostElement.isGenerativeConstructor()) { 451 analyzeTypeVariables(type);
452 } else if (outermostElement.isInstanceMember()) {
452 if (hasTypeVariable(type)) useLocal(closureData.thisElement); 453 if (hasTypeVariable(type)) useLocal(closureData.thisElement);
453 } else if (outermostElement.isFactoryConstructor()) {
454 analyzeTypeVariables(type);
455 } 454 }
456 } 455 }
457 456
458 node.visitChildren(this); 457 node.visitChildren(this);
459 } 458 }
460 459
461 // If variables that are declared in the [node] scope are captured and need 460 // If variables that are declared in the [node] scope are captured and need
462 // to be boxed create a box-element and update the [capturingScopes] in the 461 // to be boxed create a box-element and update the [capturingScopes] in the
463 // current [closureData]. 462 // current [closureData].
464 // The boxed variables are updated in the [capturedVariableMapping]. 463 // The boxed variables are updated in the [capturedVariableMapping].
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 669 }
671 670
672 visitTryStatement(TryStatement node) { 671 visitTryStatement(TryStatement node) {
673 // TODO(ngeoffray): implement finer grain state. 672 // TODO(ngeoffray): implement finer grain state.
674 bool oldInTryStatement = inTryStatement; 673 bool oldInTryStatement = inTryStatement;
675 inTryStatement = true; 674 inTryStatement = true;
676 node.visitChildren(this); 675 node.visitChildren(this);
677 inTryStatement = oldInTryStatement; 676 inTryStatement = oldInTryStatement;
678 } 677 }
679 } 678 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698