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 js_backend; | 5 part of js_backend; |
6 | 6 |
7 const VERBOSE_OPTIMIZER_HINTS = false; | 7 const VERBOSE_OPTIMIZER_HINTS = false; |
8 | 8 |
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { | 9 class JavaScriptItemCompilationContext extends ItemCompilationContext { |
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); | 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 | 1178 |
1179 void registerClosureWithFreeTypeVariables( | 1179 void registerClosureWithFreeTypeVariables( |
1180 Element closure, | 1180 Element closure, |
1181 Enqueuer enqueuer, | 1181 Enqueuer enqueuer, |
1182 Registry registry) { | 1182 Registry registry) { |
1183 if (enqueuer.isResolutionQueue || methodNeedsRti(closure)) { | 1183 if (enqueuer.isResolutionQueue || methodNeedsRti(closure)) { |
1184 registerComputeSignature(enqueuer, registry); | 1184 registerComputeSignature(enqueuer, registry); |
1185 } | 1185 } |
1186 } | 1186 } |
1187 | 1187 |
| 1188 /// Call during codegen if an instance of [closure] is being created. |
| 1189 void registerInstantiatedClosure(LocalFunctionElement closure, |
| 1190 CodegenRegistry registry) { |
| 1191 if (methodNeedsRti(closure)) { |
| 1192 registerComputeSignature(compiler.enqueuer.codegen, registry); |
| 1193 } |
| 1194 } |
| 1195 |
1188 void registerBoundClosure(Enqueuer enqueuer) { | 1196 void registerBoundClosure(Enqueuer enqueuer) { |
1189 boundClosureClass.ensureResolved(compiler); | 1197 boundClosureClass.ensureResolved(compiler); |
1190 enqueuer.registerInstantiatedType( | 1198 enqueuer.registerInstantiatedType( |
1191 boundClosureClass.rawType, | 1199 boundClosureClass.rawType, |
1192 // Precise dependency is not important here. | 1200 // Precise dependency is not important here. |
1193 compiler.globalDependencies); | 1201 compiler.globalDependencies); |
1194 } | 1202 } |
1195 | 1203 |
1196 void registerGetOfStaticFunction(Enqueuer enqueuer) { | 1204 void registerGetOfStaticFunction(Enqueuer enqueuer) { |
1197 closureClass.ensureResolved(compiler); | 1205 closureClass.ensureResolved(compiler); |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 } | 2983 } |
2976 } | 2984 } |
2977 | 2985 |
2978 /// Records that [constant] is used by the element behind [registry]. | 2986 /// Records that [constant] is used by the element behind [registry]. |
2979 class Dependency { | 2987 class Dependency { |
2980 final ConstantValue constant; | 2988 final ConstantValue constant; |
2981 final Element annotatedElement; | 2989 final Element annotatedElement; |
2982 | 2990 |
2983 const Dependency(this.constant, this.annotatedElement); | 2991 const Dependency(this.constant, this.annotatedElement); |
2984 } | 2992 } |
OLD | NEW |