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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 Registry registry) { | 1018 Registry registry) { |
1019 assert(registry.isForResolution); | 1019 assert(registry.isForResolution); |
1020 ConstantValue constant = constants.getConstantValueForMetadata(metadata); | 1020 ConstantValue constant = constants.getConstantValueForMetadata(metadata); |
1021 registerCompileTimeConstant(constant, registry, addForEmission: false); | 1021 registerCompileTimeConstant(constant, registry, addForEmission: false); |
1022 metadataConstants.add(new Dependency(constant, annotatedElement)); | 1022 metadataConstants.add(new Dependency(constant, annotatedElement)); |
1023 } | 1023 } |
1024 | 1024 |
1025 void registerInstantiatedClass(ClassElement cls, | 1025 void registerInstantiatedClass(ClassElement cls, |
1026 Enqueuer enqueuer, | 1026 Enqueuer enqueuer, |
1027 Registry registry) { | 1027 Registry registry) { |
| 1028 _processClass(cls, enqueuer, registry); |
| 1029 } |
| 1030 |
| 1031 void registerImplementedClass(ClassElement cls, |
| 1032 Enqueuer enqueuer, |
| 1033 Registry registry) { |
| 1034 _processClass(cls, enqueuer, registry); |
| 1035 } |
| 1036 |
| 1037 void _processClass(ClassElement cls, |
| 1038 Enqueuer enqueuer, |
| 1039 Registry registry) { |
1028 if (!cls.typeVariables.isEmpty) { | 1040 if (!cls.typeVariables.isEmpty) { |
1029 typeVariableHandler.registerClassWithTypeVariables(cls, enqueuer, | 1041 typeVariableHandler.registerClassWithTypeVariables(cls, enqueuer, |
1030 registry); | 1042 registry); |
1031 } | 1043 } |
1032 | 1044 |
1033 // Register any helper that will be needed by the backend. | 1045 // Register any helper that will be needed by the backend. |
1034 if (enqueuer.isResolutionQueue) { | 1046 if (enqueuer.isResolutionQueue) { |
1035 if (cls == compiler.intClass | 1047 if (cls == compiler.intClass |
1036 || cls == compiler.doubleClass | 1048 || cls == compiler.doubleClass |
1037 || cls == compiler.numClass) { | 1049 || cls == compiler.numClass) { |
(...skipping 2125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3163 } | 3175 } |
3164 } | 3176 } |
3165 | 3177 |
3166 /// Records that [constant] is used by the element behind [registry]. | 3178 /// Records that [constant] is used by the element behind [registry]. |
3167 class Dependency { | 3179 class Dependency { |
3168 final ConstantValue constant; | 3180 final ConstantValue constant; |
3169 final Element annotatedElement; | 3181 final Element annotatedElement; |
3170 | 3182 |
3171 const Dependency(this.constant, this.annotatedElement); | 3183 const Dependency(this.constant, this.annotatedElement); |
3172 } | 3184 } |
OLD | NEW |