| 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 abstract class ClassWorld { | 7 abstract class ClassWorld { |
| 8 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. | 8 // TODO(johnniwinther): Refine this into a `BackendClasses` interface. |
| 9 Backend get backend; | 9 Backend get backend; |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 class World implements ClassWorld { | 105 class World implements ClassWorld { |
| 106 ClassElement get objectClass => compiler.objectClass; | 106 ClassElement get objectClass => compiler.objectClass; |
| 107 ClassElement get functionClass => compiler.functionClass; | 107 ClassElement get functionClass => compiler.functionClass; |
| 108 ClassElement get boolClass => compiler.boolClass; | 108 ClassElement get boolClass => compiler.boolClass; |
| 109 ClassElement get numClass => compiler.numClass; | 109 ClassElement get numClass => compiler.numClass; |
| 110 ClassElement get intClass => compiler.intClass; | 110 ClassElement get intClass => compiler.intClass; |
| 111 ClassElement get doubleClass => compiler.doubleClass; | 111 ClassElement get doubleClass => compiler.doubleClass; |
| 112 ClassElement get stringClass => compiler.stringClass; | 112 ClassElement get stringClass => compiler.stringClass; |
| 113 | 113 |
| 114 Map<Selector, Map<ti.TypeMask, TypedSelector>> canonicalizedValues = |
| 115 new Map<Selector, Map<ti.TypeMask, TypedSelector>>(); |
| 116 |
| 114 bool checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) { | 117 bool checkInvariants(ClassElement cls, {bool mustBeInstantiated: true}) { |
| 115 return | 118 return |
| 116 invariant(cls, cls.isDeclaration, | 119 invariant(cls, cls.isDeclaration, |
| 117 message: '$cls must be the declaration.') && | 120 message: '$cls must be the declaration.') && |
| 118 invariant(cls, cls.isResolved, | 121 invariant(cls, cls.isResolved, |
| 119 message: '$cls must be resolved.') && | 122 message: '$cls must be resolved.') && |
| 120 (!mustBeInstantiated || | 123 (!mustBeInstantiated || |
| 121 invariant(cls, isInstantiated(cls), | 124 invariant(cls, isInstantiated(cls), |
| 122 message: '$cls is not instantiated.')); | 125 message: '$cls is not instantiated.')); |
| 123 } | 126 } |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 // function expressions's element. | 524 // function expressions's element. |
| 522 // TODO(herhut): Generate classes for function expressions earlier. | 525 // TODO(herhut): Generate classes for function expressions earlier. |
| 523 if (element is closureMapping.SynthesizedCallMethodElementX) { | 526 if (element is closureMapping.SynthesizedCallMethodElementX) { |
| 524 return getMightBePassedToApply(element.expression); | 527 return getMightBePassedToApply(element.expression); |
| 525 } | 528 } |
| 526 return functionsThatMightBePassedToApply.contains(element); | 529 return functionsThatMightBePassedToApply.contains(element); |
| 527 } | 530 } |
| 528 | 531 |
| 529 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; | 532 bool get hasClosedWorldAssumption => !compiler.hasIncrementalSupport; |
| 530 } | 533 } |
| OLD | NEW |