| OLD | NEW |
| 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("leg.dart"); | 8 #import("leg.dart"); |
| 9 #import("scanner/scannerlib.dart"); | 9 #import("scanner/scannerlib.dart"); |
| 10 #import("tree/tree.dart"); | 10 #import("tree/tree.dart"); |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 void analyzeTypeVariables(DartType type) { | 366 void analyzeTypeVariables(DartType type) { |
| 367 if (type is TypeVariableType) { | 367 if (type is TypeVariableType) { |
| 368 useLocal(type.element); | 368 useLocal(type.element); |
| 369 } else if (type is InterfaceType) { | 369 } else if (type is InterfaceType) { |
| 370 InterfaceType ifcType = type; | 370 InterfaceType ifcType = type; |
| 371 for (DartType argument in ifcType.arguments) { | 371 for (DartType argument in ifcType.arguments) { |
| 372 analyzeTypeVariables(argument); | 372 analyzeTypeVariables(argument); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 if (outermostFunctionElement.isMember() && |
| 377 if (outermostFunctionElement.isMember() | 377 compiler.world.needsRti(outermostFunctionElement.getEnclosingClass())) { |
| 378 && compiler.world.needsRti(outermostFunctionElement.enclosingElement)) { | |
| 379 if (outermostFunctionElement.isInstanceMember() | 378 if (outermostFunctionElement.isInstanceMember() |
| 380 || outermostFunctionElement.isGenerativeConstructor()) { | 379 || outermostFunctionElement.isGenerativeConstructor()) { |
| 381 if (hasTypeVariable(type)) useLocal(closureData.thisElement); | 380 if (hasTypeVariable(type)) useLocal(closureData.thisElement); |
| 382 } else if (outermostFunctionElement.isFactoryConstructor()) { | 381 } else if (outermostFunctionElement.isFactoryConstructor()) { |
| 383 analyzeTypeVariables(type); | 382 analyzeTypeVariables(type); |
| 384 } | 383 } |
| 385 } | 384 } |
| 386 | 385 |
| 387 node.visitChildren(this); | 386 node.visitChildren(this); |
| 388 } | 387 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 } | 597 } |
| 599 | 598 |
| 600 visitTryStatement(TryStatement node) { | 599 visitTryStatement(TryStatement node) { |
| 601 // TODO(ngeoffray): implement finer grain state. | 600 // TODO(ngeoffray): implement finer grain state. |
| 602 bool oldInTryStatement = inTryStatement; | 601 bool oldInTryStatement = inTryStatement; |
| 603 inTryStatement = true; | 602 inTryStatement = true; |
| 604 node.visitChildren(this); | 603 node.visitChildren(this); |
| 605 inTryStatement = oldInTryStatement; | 604 inTryStatement = oldInTryStatement; |
| 606 } | 605 } |
| 607 } | 606 } |
| OLD | NEW |