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