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

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

Issue 11418113: Substitution added to DartType (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/renamer.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 "tree/tree.dart"; 9 import "tree/tree.dart";
10 import "util/util.dart"; 10 import "util/util.dart";
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 } 364 }
365 365
366 visitNewExpression(NewExpression node) { 366 visitNewExpression(NewExpression node) {
367 DartType type = elements.getType(node); 367 DartType type = elements.getType(node);
368 368
369 bool hasTypeVariable(DartType type) { 369 bool hasTypeVariable(DartType type) {
370 if (type is TypeVariableType) { 370 if (type is TypeVariableType) {
371 return true; 371 return true;
372 } else if (type is InterfaceType) { 372 } else if (type is InterfaceType) {
373 InterfaceType ifcType = type; 373 InterfaceType ifcType = type;
374 for (DartType argument in ifcType.arguments) { 374 for (DartType argument in ifcType.typeArguments) {
375 if (hasTypeVariable(argument)) { 375 if (hasTypeVariable(argument)) {
376 return true; 376 return true;
377 } 377 }
378 } 378 }
379 } 379 }
380 return false; 380 return false;
381 } 381 }
382 382
383 void analyzeTypeVariables(DartType type) { 383 void analyzeTypeVariables(DartType type) {
384 if (type is TypeVariableType) { 384 if (type is TypeVariableType) {
385 useLocal(type.element); 385 useLocal(type.element);
386 } else if (type is InterfaceType) { 386 } else if (type is InterfaceType) {
387 InterfaceType ifcType = type; 387 InterfaceType ifcType = type;
388 for (DartType argument in ifcType.arguments) { 388 for (DartType argument in ifcType.typeArguments) {
389 analyzeTypeVariables(argument); 389 analyzeTypeVariables(argument);
390 } 390 }
391 } 391 }
392 } 392 }
393 if (outermostElement.isMember() && 393 if (outermostElement.isMember() &&
394 compiler.world.needsRti(outermostElement.getEnclosingClass())) { 394 compiler.world.needsRti(outermostElement.getEnclosingClass())) {
395 if (outermostElement.isInstanceMember() 395 if (outermostElement.isInstanceMember()
396 || outermostElement.isGenerativeConstructor()) { 396 || outermostElement.isGenerativeConstructor()) {
397 if (hasTypeVariable(type)) useLocal(closureData.thisElement); 397 if (hasTypeVariable(type)) useLocal(closureData.thisElement);
398 } else if (outermostElement.isFactoryConstructor()) { 398 } else if (outermostElement.isFactoryConstructor()) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 } 615 }
616 616
617 visitTryStatement(TryStatement node) { 617 visitTryStatement(TryStatement node) {
618 // TODO(ngeoffray): implement finer grain state. 618 // TODO(ngeoffray): implement finer grain state.
619 bool oldInTryStatement = inTryStatement; 619 bool oldInTryStatement = inTryStatement;
620 inTryStatement = true; 620 inTryStatement = true;
621 node.visitChildren(this); 621 node.visitChildren(this);
622 inTryStatement = oldInTryStatement; 622 inTryStatement = oldInTryStatement;
623 } 623 }
624 } 624 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698