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 /** | 7 /** |
8 * The [ConstantHandler] keeps track of compile-time constants, | 8 * The [ConstantHandler] keeps track of compile-time constants, |
9 * initializations of global and static fields, and default values of | 9 * initializations of global and static fields, and default values of |
10 * optional parameters. | 10 * optional parameters. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 registerInstantiatedType(interceptor.dispatchedType, elements); | 56 registerInstantiatedType(interceptor.dispatchedType, elements); |
57 } | 57 } |
58 compiledConstants.add(constant); | 58 compiledConstants.add(constant); |
59 } | 59 } |
60 | 60 |
61 void registerInstantiatedType(DartType type, TreeElements elements) { | 61 void registerInstantiatedType(DartType type, TreeElements elements) { |
62 if (isMetadata) return; | 62 if (isMetadata) return; |
63 compiler.enqueuer.codegen.registerInstantiatedType(type, elements); | 63 compiler.enqueuer.codegen.registerInstantiatedType(type, elements); |
64 if (type is InterfaceType && | 64 if (type is InterfaceType && |
65 !type.isRaw && | 65 !type.isRaw && |
66 compiler.backend.needsRti(type.element)) { | 66 compiler.backend.classNeedsRti(type.element)) { |
67 registerSetRuntimeTypeInfoFunction(); | 67 registerSetRuntimeTypeInfoFunction(); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 void registerStaticUse(Element element) { | 71 void registerStaticUse(Element element) { |
72 if (isMetadata) return; | 72 if (isMetadata) return; |
73 compiler.analyzeElement(element.declaration); | 73 compiler.analyzeElement(element.declaration); |
74 compiler.enqueuer.codegen.registerStaticUse(element); | 74 compiler.enqueuer.codegen.registerStaticUse(element); |
75 } | 75 } |
76 | 76 |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 if (fieldValue == null) { | 908 if (fieldValue == null) { |
909 // Use the default value. | 909 // Use the default value. |
910 fieldValue = handler.compileConstant(field); | 910 fieldValue = handler.compileConstant(field); |
911 } | 911 } |
912 jsNewArguments.add(fieldValue); | 912 jsNewArguments.add(fieldValue); |
913 }, | 913 }, |
914 includeSuperAndInjectedMembers: true); | 914 includeSuperAndInjectedMembers: true); |
915 return jsNewArguments; | 915 return jsNewArguments; |
916 } | 916 } |
917 } | 917 } |
OLD | NEW |