| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 class World { | 7 class World { |
| 8 final Compiler compiler; | 8 final Compiler compiler; |
| 9 final FunctionSet allFunctions; | 9 final FunctionSet allFunctions; |
| 10 final Set<Element> functionsCalledInLoop = new Set<Element>(); | 10 final Set<Element> functionsCalledInLoop = new Set<Element>(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 World(Compiler compiler) | 53 World(Compiler compiler) |
| 54 : allFunctions = new FunctionSet(compiler), | 54 : allFunctions = new FunctionSet(compiler), |
| 55 this.compiler = compiler; | 55 this.compiler = compiler; |
| 56 | 56 |
| 57 void populate() { | 57 void populate() { |
| 58 void addSubtypes(ClassElement cls) { | 58 void addSubtypes(ClassElement cls) { |
| 59 assert(cls.isDeclaration); | 59 assert(cls.isDeclaration); |
| 60 if (cls.resolutionState != STATE_DONE) { | 60 if (cls.resolutionState != STATE_DONE) { |
| 61 compiler.internalErrorOnElement( | 61 compiler.internalError(cls, 'Class "${cls.name}" is not resolved.'); |
| 62 cls, 'Class "${cls.name}" is not resolved.'); | |
| 63 } | 62 } |
| 64 | 63 |
| 65 for (DartType type in cls.allSupertypes) { | 64 for (DartType type in cls.allSupertypes) { |
| 66 Set<Element> supertypesOfClass = | 65 Set<Element> supertypesOfClass = |
| 67 _supertypes.putIfAbsent(cls, () => new Set<ClassElement>()); | 66 _supertypes.putIfAbsent(cls, () => new Set<ClassElement>()); |
| 68 Set<Element> subtypesOfSupertype = | 67 Set<Element> subtypesOfSupertype = |
| 69 _subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); | 68 _subtypes.putIfAbsent(type.element, () => new Set<ClassElement>()); |
| 70 supertypesOfClass.add(type.element); | 69 supertypesOfClass.add(type.element); |
| 71 subtypesOfSupertype.add(cls); | 70 subtypesOfSupertype.add(cls); |
| 72 } | 71 } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 267 } |
| 269 | 268 |
| 270 void registerCannotThrow(Element element) { | 269 void registerCannotThrow(Element element) { |
| 271 elementsThatCannotThrow.add(element); | 270 elementsThatCannotThrow.add(element); |
| 272 } | 271 } |
| 273 | 272 |
| 274 bool getCannotThrow(Element element) { | 273 bool getCannotThrow(Element element) { |
| 275 return elementsThatCannotThrow.contains(element); | 274 return elementsThatCannotThrow.contains(element); |
| 276 } | 275 } |
| 277 } | 276 } |
| OLD | NEW |