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 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // TODO(ahe,karlklose): rename this? | 122 // TODO(ahe,karlklose): rename this? |
123 void dumpInferredTypes() {} | 123 void dumpInferredTypes() {} |
124 | 124 |
125 ItemCompilationContext createItemCompilationContext() { | 125 ItemCompilationContext createItemCompilationContext() { |
126 return new ItemCompilationContext(); | 126 return new ItemCompilationContext(); |
127 } | 127 } |
128 | 128 |
129 bool classNeedsRti(ClassElement cls); | 129 bool classNeedsRti(ClassElement cls); |
130 bool methodNeedsRti(FunctionElement function); | 130 bool methodNeedsRti(FunctionElement function); |
131 | 131 |
132 // The following methods are hooks for the backend to register its | 132 /// Called during resolution to notify to the backend that a class is |
133 // helper methods. | 133 /// being instantiated. |
134 void registerInstantiatedClass(ClassElement cls, | 134 void registerInstantiatedClass(ClassElement cls, |
135 Enqueuer enqueuer, | 135 Enqueuer enqueuer, |
136 TreeElements elements) {} | 136 TreeElements elements) {} |
| 137 |
| 138 /// Called during resolution to notify to the backend that the |
| 139 /// program uses string interpolation. |
137 void registerStringInterpolation(TreeElements elements) {} | 140 void registerStringInterpolation(TreeElements elements) {} |
| 141 |
| 142 /// Called during resolution to notify to the backend that the |
| 143 /// program has a catch statement. |
138 void registerCatchStatement(Enqueuer enqueuer, | 144 void registerCatchStatement(Enqueuer enqueuer, |
139 TreeElements elements) {} | 145 TreeElements elements) {} |
140 void registerWrapException(TreeElements elements) {} | 146 |
| 147 /// Called during resolution to notify to the backend that the |
| 148 /// program explicitly throws an exception. |
141 void registerThrowExpression(TreeElements elements) {} | 149 void registerThrowExpression(TreeElements elements) {} |
| 150 |
| 151 /// Called during resolution to notify to the backend that the |
| 152 /// program has a global variable with a lazy initializer. |
142 void registerLazyField(TreeElements elements) {} | 153 void registerLazyField(TreeElements elements) {} |
| 154 |
| 155 /// Called during resolution to notify to the backend that the |
| 156 /// program uses a type variable as an expression. |
143 void registerTypeVariableExpression(TreeElements elements) {} | 157 void registerTypeVariableExpression(TreeElements elements) {} |
| 158 |
| 159 /// Called during resolution to notify to the backend that the |
| 160 /// program uses a type literal. |
144 void registerTypeLiteral(Element element, TreeElements elements) {} | 161 void registerTypeLiteral(Element element, TreeElements elements) {} |
| 162 |
| 163 /// Called during resolution to notify to the backend that the |
| 164 /// program has a catch statement with a stack trace. |
145 void registerStackTraceInCatch(TreeElements elements) {} | 165 void registerStackTraceInCatch(TreeElements elements) {} |
| 166 |
| 167 /// Register an is check to the backend. |
146 void registerIsCheck(DartType type, | 168 void registerIsCheck(DartType type, |
147 Enqueuer enqueuer, | 169 Enqueuer enqueuer, |
148 TreeElements elements) {} | 170 TreeElements elements) {} |
| 171 |
| 172 /// Register an as check to the backend. |
149 void registerAsCheck(DartType type, TreeElements elements) {} | 173 void registerAsCheck(DartType type, TreeElements elements) {} |
| 174 |
| 175 /// Register that the application may throw a [NoSuchMethodError]. |
150 void registerThrowNoSuchMethod(TreeElements elements) {} | 176 void registerThrowNoSuchMethod(TreeElements elements) {} |
| 177 |
| 178 /// Register that the application may throw a [RuntimeError]. |
151 void registerThrowRuntimeError(TreeElements elements) {} | 179 void registerThrowRuntimeError(TreeElements elements) {} |
| 180 |
| 181 /// Register that the application may throw an |
| 182 /// [AbstractClassInstantiationError]. |
152 void registerAbstractClassInstantiation(TreeElements elements) {} | 183 void registerAbstractClassInstantiation(TreeElements elements) {} |
| 184 |
| 185 /// Register that the application may throw a [FallThroughError]. |
153 void registerFallThroughError(TreeElements elements) {} | 186 void registerFallThroughError(TreeElements elements) {} |
| 187 |
| 188 /// Register that a super call will end up calling |
| 189 /// [: super.noSuchMethod :]. |
154 void registerSuperNoSuchMethod(TreeElements elements) {} | 190 void registerSuperNoSuchMethod(TreeElements elements) {} |
| 191 |
| 192 /// Register that the application creates a constant map. |
155 void registerConstantMap(TreeElements elements) {} | 193 void registerConstantMap(TreeElements elements) {} |
| 194 |
156 /** | 195 /** |
157 * Call this to register that an instantiated generic class has a call | 196 * Call this to register that an instantiated generic class has a call |
158 * method. | 197 * method. |
159 */ | 198 */ |
160 void registerGenericCallMethod(Element callMethod, | 199 void registerGenericCallMethod(Element callMethod, |
161 Enqueuer enqueuer, | 200 Enqueuer enqueuer, |
162 TreeElements elements) {} | 201 TreeElements elements) {} |
163 /** | 202 /** |
164 * Call this to register that a getter exists for a function on an | 203 * Call this to register that a getter exists for a function on an |
165 * instantiated generic class. | 204 * instantiated generic class. |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 | 1525 |
1487 void close() {} | 1526 void close() {} |
1488 | 1527 |
1489 toString() => name; | 1528 toString() => name; |
1490 | 1529 |
1491 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1530 /// Convenience method for getting an [api.CompilerOutputProvider]. |
1492 static NullSink outputProvider(String name, String extension) { | 1531 static NullSink outputProvider(String name, String extension) { |
1493 return new NullSink('$name.$extension'); | 1532 return new NullSink('$name.$extension'); |
1494 } | 1533 } |
1495 } | 1534 } |
OLD | NEW |