OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.js_helpers.impact; | 5 library dart2js.js_helpers.impact; |
6 | 6 |
7 import '../common/names.dart'; | 7 import '../common/names.dart'; |
8 import '../common_elements.dart' show CommonElements, ElementEnvironment; | 8 import '../common_elements.dart' show CommonElements, ElementEnvironment; |
9 import '../elements/types.dart' show InterfaceType; | 9 import '../elements/types.dart' show InterfaceType; |
10 import '../elements/entities.dart'; | 10 import '../elements/entities.dart'; |
11 import '../options.dart'; | 11 import '../options.dart'; |
12 import '../universe/selector.dart'; | 12 import '../universe/selector.dart'; |
13 import '../universe/world_impact.dart' | 13 import '../universe/world_impact.dart' |
14 show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl; | 14 show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl; |
15 import '../universe/use.dart'; | 15 import '../universe/use.dart'; |
16 import '../util/enumset.dart'; | 16 import '../util/enumset.dart'; |
17 import 'backend_helpers.dart'; | |
18 | 17 |
19 /// Backend specific features required by a backend impact. | 18 /// Backend specific features required by a backend impact. |
20 enum BackendFeature { | 19 enum BackendFeature { |
21 needToInitializeIsolateAffinityTag, | 20 needToInitializeIsolateAffinityTag, |
22 needToInitializeDispatchProperty, | 21 needToInitializeDispatchProperty, |
23 } | 22 } |
24 | 23 |
25 /// A set of JavaScript backend dependencies. | 24 /// A set of JavaScript backend dependencies. |
26 class BackendImpact { | 25 class BackendImpact { |
27 final List<FunctionEntity> staticUses; | 26 final List<FunctionEntity> staticUses; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 for (BackendImpact otherImpact in otherImpacts) { | 84 for (BackendImpact otherImpact in otherImpacts) { |
86 otherImpact.registerImpact(worldImpactBuilder, elementEnvironment); | 85 otherImpact.registerImpact(worldImpactBuilder, elementEnvironment); |
87 } | 86 } |
88 } | 87 } |
89 } | 88 } |
90 | 89 |
91 /// The JavaScript backend dependencies for various features. | 90 /// The JavaScript backend dependencies for various features. |
92 class BackendImpacts { | 91 class BackendImpacts { |
93 final CompilerOptions _options; | 92 final CompilerOptions _options; |
94 final CommonElements _commonElements; | 93 final CommonElements _commonElements; |
95 final BackendHelpers _helpers; | |
96 | 94 |
97 BackendImpacts(this._options, this._commonElements, this._helpers); | 95 BackendImpacts(this._options, this._commonElements); |
98 | 96 |
99 BackendImpact _getRuntimeTypeArgument; | 97 BackendImpact _getRuntimeTypeArgument; |
100 | 98 |
101 BackendImpact get getRuntimeTypeArgument { | 99 BackendImpact get getRuntimeTypeArgument { |
102 return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [ | 100 return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [ |
103 _helpers.getRuntimeTypeArgument, | 101 _commonElements.getRuntimeTypeArgument, |
104 _helpers.getTypeArgumentByIndex, | 102 _commonElements.getTypeArgumentByIndex, |
105 ]); | 103 ]); |
106 } | 104 } |
107 | 105 |
108 BackendImpact _computeSignature; | 106 BackendImpact _computeSignature; |
109 | 107 |
110 BackendImpact get computeSignature { | 108 BackendImpact get computeSignature { |
111 return _computeSignature ??= new BackendImpact(globalUses: [ | 109 return _computeSignature ??= new BackendImpact(globalUses: [ |
112 _helpers.setRuntimeTypeInfo, | 110 _commonElements.setRuntimeTypeInfo, |
113 _helpers.getRuntimeTypeInfo, | 111 _commonElements.getRuntimeTypeInfo, |
114 _helpers.computeSignature, | 112 _commonElements.computeSignature, |
115 _helpers.getRuntimeTypeArguments | 113 _commonElements.getRuntimeTypeArguments |
116 ], otherImpacts: [ | 114 ], otherImpacts: [ |
117 listValues | 115 listValues |
118 ]); | 116 ]); |
119 } | 117 } |
120 | 118 |
121 BackendImpact _mainWithArguments; | 119 BackendImpact _mainWithArguments; |
122 | 120 |
123 BackendImpact get mainWithArguments { | 121 BackendImpact get mainWithArguments { |
124 return _mainWithArguments ??= new BackendImpact( | 122 return _mainWithArguments ??= new BackendImpact(instantiatedClasses: [ |
125 instantiatedClasses: [_helpers.jsArrayClass, _helpers.jsStringClass]); | 123 _commonElements.jsArrayClass, |
| 124 _commonElements.jsStringClass |
| 125 ]); |
126 } | 126 } |
127 | 127 |
128 BackendImpact _asyncBody; | 128 BackendImpact _asyncBody; |
129 | 129 |
130 BackendImpact get asyncBody { | 130 BackendImpact get asyncBody { |
131 return _asyncBody ??= new BackendImpact(staticUses: [ | 131 return _asyncBody ??= new BackendImpact(staticUses: [ |
132 _helpers.asyncHelper, | 132 _commonElements.asyncHelper, |
133 _helpers.syncCompleterConstructor, | 133 _commonElements.syncCompleterConstructor, |
134 _helpers.streamIteratorConstructor, | 134 _commonElements.streamIteratorConstructor, |
135 _helpers.wrapBody | 135 _commonElements.wrapBody |
136 ]); | 136 ]); |
137 } | 137 } |
138 | 138 |
139 BackendImpact _syncStarBody; | 139 BackendImpact _syncStarBody; |
140 | 140 |
141 BackendImpact get syncStarBody { | 141 BackendImpact get syncStarBody { |
142 return _syncStarBody ??= new BackendImpact(staticUses: [ | 142 return _syncStarBody ??= new BackendImpact(staticUses: [ |
143 _helpers.syncStarIterableConstructor, | 143 _commonElements.syncStarIterableConstructor, |
144 _helpers.endOfIteration, | 144 _commonElements.endOfIteration, |
145 _helpers.yieldStar, | 145 _commonElements.yieldStar, |
146 _helpers.syncStarUncaughtError | 146 _commonElements.syncStarUncaughtError |
147 ], instantiatedClasses: [ | 147 ], instantiatedClasses: [ |
148 _helpers.syncStarIterable | 148 _commonElements.syncStarIterable |
149 ]); | 149 ]); |
150 } | 150 } |
151 | 151 |
152 BackendImpact _asyncStarBody; | 152 BackendImpact _asyncStarBody; |
153 | 153 |
154 BackendImpact get asyncStarBody { | 154 BackendImpact get asyncStarBody { |
155 return _asyncStarBody ??= new BackendImpact(staticUses: [ | 155 return _asyncStarBody ??= new BackendImpact(staticUses: [ |
156 _helpers.asyncStarHelper, | 156 _commonElements.asyncStarHelper, |
157 _helpers.streamOfController, | 157 _commonElements.streamOfController, |
158 _helpers.yieldSingle, | 158 _commonElements.yieldSingle, |
159 _helpers.yieldStar, | 159 _commonElements.yieldStar, |
160 _helpers.asyncStarControllerConstructor, | 160 _commonElements.asyncStarControllerConstructor, |
161 _helpers.streamIteratorConstructor, | 161 _commonElements.streamIteratorConstructor, |
162 _helpers.wrapBody | 162 _commonElements.wrapBody |
163 ], instantiatedClasses: [ | 163 ], instantiatedClasses: [ |
164 _helpers.asyncStarController | 164 _commonElements.asyncStarController |
165 ]); | 165 ]); |
166 } | 166 } |
167 | 167 |
168 BackendImpact _typeVariableBoundCheck; | 168 BackendImpact _typeVariableBoundCheck; |
169 | 169 |
170 BackendImpact get typeVariableBoundCheck { | 170 BackendImpact get typeVariableBoundCheck { |
171 return _typeVariableBoundCheck ??= new BackendImpact( | 171 return _typeVariableBoundCheck ??= new BackendImpact(staticUses: [ |
172 staticUses: [_helpers.throwTypeError, _helpers.assertIsSubtype]); | 172 _commonElements.throwTypeError, |
| 173 _commonElements.assertIsSubtype |
| 174 ]); |
173 } | 175 } |
174 | 176 |
175 BackendImpact _abstractClassInstantiation; | 177 BackendImpact _abstractClassInstantiation; |
176 | 178 |
177 BackendImpact get abstractClassInstantiation { | 179 BackendImpact get abstractClassInstantiation { |
178 return _abstractClassInstantiation ??= new BackendImpact( | 180 return _abstractClassInstantiation ??= new BackendImpact( |
179 staticUses: [_helpers.throwAbstractClassInstantiationError], | 181 staticUses: [_commonElements.throwAbstractClassInstantiationError], |
180 otherImpacts: [_needsString('Needed to encode the message.')]); | 182 otherImpacts: [_needsString('Needed to encode the message.')]); |
181 } | 183 } |
182 | 184 |
183 BackendImpact _fallThroughError; | 185 BackendImpact _fallThroughError; |
184 | 186 |
185 BackendImpact get fallThroughError { | 187 BackendImpact get fallThroughError { |
186 return _fallThroughError ??= | 188 return _fallThroughError ??= |
187 new BackendImpact(staticUses: [_helpers.fallThroughError]); | 189 new BackendImpact(staticUses: [_commonElements.fallThroughError]); |
188 } | 190 } |
189 | 191 |
190 BackendImpact _asCheck; | 192 BackendImpact _asCheck; |
191 | 193 |
192 BackendImpact get asCheck { | 194 BackendImpact get asCheck { |
193 return _asCheck ??= | 195 return _asCheck ??= |
194 new BackendImpact(staticUses: [_helpers.throwRuntimeError]); | 196 new BackendImpact(staticUses: [_commonElements.throwRuntimeError]); |
195 } | 197 } |
196 | 198 |
197 BackendImpact _throwNoSuchMethod; | 199 BackendImpact _throwNoSuchMethod; |
198 | 200 |
199 BackendImpact get throwNoSuchMethod { | 201 BackendImpact get throwNoSuchMethod { |
200 return _throwNoSuchMethod ??= new BackendImpact( | 202 return _throwNoSuchMethod ??= new BackendImpact( |
201 instantiatedClasses: _options.useKernel | 203 instantiatedClasses: _options.useKernel |
202 ? [ | 204 ? [ |
203 _commonElements.symbolClass, | 205 _commonElements.symbolClass, |
204 ] | 206 ] |
205 : [], | 207 : [], |
206 staticUses: _options.useKernel | 208 staticUses: _options.useKernel |
207 ? [ | 209 ? [ |
208 _helpers.genericNoSuchMethod, | 210 _commonElements.genericNoSuchMethod, |
209 _helpers.unresolvedConstructorError, | 211 _commonElements.unresolvedConstructorError, |
210 _helpers.unresolvedStaticMethodError, | 212 _commonElements.unresolvedStaticMethodError, |
211 _helpers.unresolvedStaticGetterError, | 213 _commonElements.unresolvedStaticGetterError, |
212 _helpers.unresolvedStaticSetterError, | 214 _commonElements.unresolvedStaticSetterError, |
213 _helpers.unresolvedTopLevelMethodError, | 215 _commonElements.unresolvedTopLevelMethodError, |
214 _helpers.unresolvedTopLevelGetterError, | 216 _commonElements.unresolvedTopLevelGetterError, |
215 _helpers.unresolvedTopLevelSetterError, | 217 _commonElements.unresolvedTopLevelSetterError, |
216 _commonElements.symbolConstructor, | 218 _commonElements.symbolConstructor, |
217 ] | 219 ] |
218 : [ | 220 : [ |
219 _helpers.throwNoSuchMethod, | 221 _commonElements.throwNoSuchMethod, |
220 ], | 222 ], |
221 otherImpacts: [ | 223 otherImpacts: [ |
222 // Also register the types of the arguments passed to this method. | 224 // Also register the types of the arguments passed to this method. |
223 _needsList( | 225 _needsList( |
224 'Needed to encode the arguments for throw NoSuchMethodError.'), | 226 'Needed to encode the arguments for throw NoSuchMethodError.'), |
225 _needsString('Needed to encode the name for throw NoSuchMethodError.') | 227 _needsString('Needed to encode the name for throw NoSuchMethodError.') |
226 ]); | 228 ]); |
227 } | 229 } |
228 | 230 |
229 BackendImpact _stringValues; | 231 BackendImpact _stringValues; |
230 | 232 |
231 BackendImpact get stringValues { | 233 BackendImpact get stringValues { |
232 return _stringValues ??= | 234 return _stringValues ??= |
233 new BackendImpact(instantiatedClasses: [_helpers.jsStringClass]); | 235 new BackendImpact(instantiatedClasses: [_commonElements.jsStringClass]); |
234 } | 236 } |
235 | 237 |
236 BackendImpact _numValues; | 238 BackendImpact _numValues; |
237 | 239 |
238 BackendImpact get numValues { | 240 BackendImpact get numValues { |
239 return _numValues ??= new BackendImpact(instantiatedClasses: [ | 241 return _numValues ??= new BackendImpact(instantiatedClasses: [ |
240 _helpers.jsIntClass, | 242 _commonElements.jsIntClass, |
241 _helpers.jsPositiveIntClass, | 243 _commonElements.jsPositiveIntClass, |
242 _helpers.jsUInt32Class, | 244 _commonElements.jsUInt32Class, |
243 _helpers.jsUInt31Class, | 245 _commonElements.jsUInt31Class, |
244 _helpers.jsNumberClass, | 246 _commonElements.jsNumberClass, |
245 _helpers.jsDoubleClass | 247 _commonElements.jsDoubleClass |
246 ]); | 248 ]); |
247 } | 249 } |
248 | 250 |
249 BackendImpact get intValues => numValues; | 251 BackendImpact get intValues => numValues; |
250 | 252 |
251 BackendImpact get doubleValues => numValues; | 253 BackendImpact get doubleValues => numValues; |
252 | 254 |
253 BackendImpact _boolValues; | 255 BackendImpact _boolValues; |
254 | 256 |
255 BackendImpact get boolValues { | 257 BackendImpact get boolValues { |
256 return _boolValues ??= | 258 return _boolValues ??= |
257 new BackendImpact(instantiatedClasses: [_helpers.jsBoolClass]); | 259 new BackendImpact(instantiatedClasses: [_commonElements.jsBoolClass]); |
258 } | 260 } |
259 | 261 |
260 BackendImpact _nullValue; | 262 BackendImpact _nullValue; |
261 | 263 |
262 BackendImpact get nullValue { | 264 BackendImpact get nullValue { |
263 return _nullValue ??= | 265 return _nullValue ??= |
264 new BackendImpact(instantiatedClasses: [_helpers.jsNullClass]); | 266 new BackendImpact(instantiatedClasses: [_commonElements.jsNullClass]); |
265 } | 267 } |
266 | 268 |
267 BackendImpact _listValues; | 269 BackendImpact _listValues; |
268 | 270 |
269 BackendImpact get listValues { | 271 BackendImpact get listValues { |
270 return _listValues ??= new BackendImpact(globalClasses: [ | 272 return _listValues ??= new BackendImpact(globalClasses: [ |
271 _helpers.jsArrayClass, | 273 _commonElements.jsArrayClass, |
272 _helpers.jsMutableArrayClass, | 274 _commonElements.jsMutableArrayClass, |
273 _helpers.jsFixedArrayClass, | 275 _commonElements.jsFixedArrayClass, |
274 _helpers.jsExtendableArrayClass, | 276 _commonElements.jsExtendableArrayClass, |
275 _helpers.jsUnmodifiableArrayClass | 277 _commonElements.jsUnmodifiableArrayClass |
276 ]); | 278 ]); |
277 } | 279 } |
278 | 280 |
279 BackendImpact _throwRuntimeError; | 281 BackendImpact _throwRuntimeError; |
280 | 282 |
281 BackendImpact get throwRuntimeError { | 283 BackendImpact get throwRuntimeError { |
282 return _throwRuntimeError ??= new BackendImpact( | 284 return _throwRuntimeError ??= new BackendImpact( |
283 staticUses: _options.useKernel | 285 staticUses: _options.useKernel |
284 ? [ | 286 ? [ |
285 // TODO(sra): Refactor impacts so that we know which of these | 287 // TODO(sra): Refactor impacts so that we know which of these |
286 // are called. | 288 // are called. |
287 _helpers.malformedTypeError, | 289 _commonElements.malformedTypeError, |
288 _helpers.throwRuntimeError, | 290 _commonElements.throwRuntimeError, |
289 ] | 291 ] |
290 : [ | 292 : [ |
291 _helpers.throwRuntimeError, | 293 _commonElements.throwRuntimeError, |
292 ], | 294 ], |
293 otherImpacts: [ | 295 otherImpacts: [ |
294 // Also register the types of the arguments passed to this method. | 296 // Also register the types of the arguments passed to this method. |
295 stringValues | 297 stringValues |
296 ]); | 298 ]); |
297 } | 299 } |
298 | 300 |
299 BackendImpact _superNoSuchMethod; | 301 BackendImpact _superNoSuchMethod; |
300 | 302 |
301 BackendImpact get superNoSuchMethod { | 303 BackendImpact get superNoSuchMethod { |
302 return _superNoSuchMethod ??= new BackendImpact(staticUses: [ | 304 return _superNoSuchMethod ??= new BackendImpact(staticUses: [ |
303 _helpers.createInvocationMirror, | 305 _commonElements.createInvocationMirror, |
304 _helpers.objectNoSuchMethod | 306 _commonElements.objectNoSuchMethod |
305 ], otherImpacts: [ | 307 ], otherImpacts: [ |
306 _needsInt('Needed to encode the invocation kind of super.noSuchMethod.'), | 308 _needsInt('Needed to encode the invocation kind of super.noSuchMethod.'), |
307 _needsList('Needed to encode the arguments of super.noSuchMethod.'), | 309 _needsList('Needed to encode the arguments of super.noSuchMethod.'), |
308 _needsString('Needed to encode the name of super.noSuchMethod.') | 310 _needsString('Needed to encode the name of super.noSuchMethod.') |
309 ]); | 311 ]); |
310 } | 312 } |
311 | 313 |
312 BackendImpact _constantMapLiteral; | 314 BackendImpact _constantMapLiteral; |
313 | 315 |
314 BackendImpact get constantMapLiteral { | 316 BackendImpact get constantMapLiteral { |
315 return _constantMapLiteral ??= new BackendImpact(instantiatedClasses: [ | 317 return _constantMapLiteral ??= new BackendImpact(instantiatedClasses: [ |
316 _helpers.constantMapClass, | 318 _commonElements.constantMapClass, |
317 _helpers.constantProtoMapClass, | 319 _commonElements.constantProtoMapClass, |
318 _helpers.constantStringMapClass, | 320 _commonElements.constantStringMapClass, |
319 _helpers.generalConstantMapClass, | 321 _commonElements.generalConstantMapClass, |
320 ]); | 322 ]); |
321 } | 323 } |
322 | 324 |
323 BackendImpact _symbolConstructor; | 325 BackendImpact _symbolConstructor; |
324 | 326 |
325 BackendImpact get symbolConstructor { | 327 BackendImpact get symbolConstructor { |
326 return _symbolConstructor ??= | 328 return _symbolConstructor ??= new BackendImpact( |
327 new BackendImpact(staticUses: [_helpers.symbolValidatedConstructor]); | 329 staticUses: [_commonElements.symbolValidatedConstructor]); |
328 } | 330 } |
329 | 331 |
330 BackendImpact _constSymbol; | 332 BackendImpact _constSymbol; |
331 | 333 |
332 BackendImpact get constSymbol { | 334 BackendImpact get constSymbol { |
333 return _constSymbol ??= new BackendImpact( | 335 return _constSymbol ??= new BackendImpact( |
334 instantiatedClasses: [_commonElements.symbolClass], | 336 instantiatedClasses: [_commonElements.symbolClass], |
335 staticUses: [_commonElements.symbolConstructor]); | 337 staticUses: [_commonElements.symbolConstructor]); |
336 } | 338 } |
337 | 339 |
(...skipping 12 matching lines...) Expand all Loading... |
350 /// Helper for registering that `String` is needed. | 352 /// Helper for registering that `String` is needed. |
351 BackendImpact _needsString(String reason) { | 353 BackendImpact _needsString(String reason) { |
352 // TODO(johnniwinther): Register [reason] for use in dump-info. | 354 // TODO(johnniwinther): Register [reason] for use in dump-info. |
353 return stringValues; | 355 return stringValues; |
354 } | 356 } |
355 | 357 |
356 BackendImpact _assertWithoutMessage; | 358 BackendImpact _assertWithoutMessage; |
357 | 359 |
358 BackendImpact get assertWithoutMessage { | 360 BackendImpact get assertWithoutMessage { |
359 return _assertWithoutMessage ??= | 361 return _assertWithoutMessage ??= |
360 new BackendImpact(staticUses: [_helpers.assertHelper]); | 362 new BackendImpact(staticUses: [_commonElements.assertHelper]); |
361 } | 363 } |
362 | 364 |
363 BackendImpact _assertWithMessage; | 365 BackendImpact _assertWithMessage; |
364 | 366 |
365 BackendImpact get assertWithMessage { | 367 BackendImpact get assertWithMessage { |
366 return _assertWithMessage ??= new BackendImpact( | 368 return _assertWithMessage ??= new BackendImpact( |
367 staticUses: [_helpers.assertTest, _helpers.assertThrow]); | 369 staticUses: [_commonElements.assertTest, _commonElements.assertThrow]); |
368 } | 370 } |
369 | 371 |
370 BackendImpact _asyncForIn; | 372 BackendImpact _asyncForIn; |
371 | 373 |
372 BackendImpact get asyncForIn { | 374 BackendImpact get asyncForIn { |
373 return _asyncForIn ??= | 375 return _asyncForIn ??= new BackendImpact( |
374 new BackendImpact(staticUses: [_helpers.streamIteratorConstructor]); | 376 staticUses: [_commonElements.streamIteratorConstructor]); |
375 } | 377 } |
376 | 378 |
377 BackendImpact _stringInterpolation; | 379 BackendImpact _stringInterpolation; |
378 | 380 |
379 BackendImpact get stringInterpolation { | 381 BackendImpact get stringInterpolation { |
380 return _stringInterpolation ??= new BackendImpact( | 382 return _stringInterpolation ??= new BackendImpact( |
381 dynamicUses: [Selectors.toString_], | 383 dynamicUses: [Selectors.toString_], |
382 staticUses: [_helpers.stringInterpolationHelper], | 384 staticUses: [_commonElements.stringInterpolationHelper], |
383 otherImpacts: [_needsString('Strings are created.')]); | 385 otherImpacts: [_needsString('Strings are created.')]); |
384 } | 386 } |
385 | 387 |
386 BackendImpact _stringJuxtaposition; | 388 BackendImpact _stringJuxtaposition; |
387 | 389 |
388 BackendImpact get stringJuxtaposition { | 390 BackendImpact get stringJuxtaposition { |
389 return _stringJuxtaposition ??= _needsString('String.concat is used.'); | 391 return _stringJuxtaposition ??= _needsString('String.concat is used.'); |
390 } | 392 } |
391 | 393 |
392 BackendImpact get nullLiteral => nullValue; | 394 BackendImpact get nullLiteral => nullValue; |
393 | 395 |
394 BackendImpact get boolLiteral => boolValues; | 396 BackendImpact get boolLiteral => boolValues; |
395 | 397 |
396 BackendImpact get intLiteral => intValues; | 398 BackendImpact get intLiteral => intValues; |
397 | 399 |
398 BackendImpact get doubleLiteral => doubleValues; | 400 BackendImpact get doubleLiteral => doubleValues; |
399 | 401 |
400 BackendImpact get stringLiteral => stringValues; | 402 BackendImpact get stringLiteral => stringValues; |
401 | 403 |
402 BackendImpact _catchStatement; | 404 BackendImpact _catchStatement; |
403 | 405 |
404 BackendImpact get catchStatement { | 406 BackendImpact get catchStatement { |
405 return _catchStatement ??= new BackendImpact(staticUses: [ | 407 return _catchStatement ??= new BackendImpact(staticUses: [ |
406 _helpers.exceptionUnwrapper | 408 _commonElements.exceptionUnwrapper |
407 ], instantiatedClasses: [ | 409 ], instantiatedClasses: [ |
408 _helpers.jsPlainJavaScriptObjectClass, | 410 _commonElements.jsPlainJavaScriptObjectClass, |
409 _helpers.jsUnknownJavaScriptObjectClass | 411 _commonElements.jsUnknownJavaScriptObjectClass |
410 ]); | 412 ]); |
411 } | 413 } |
412 | 414 |
413 BackendImpact _throwExpression; | 415 BackendImpact _throwExpression; |
414 | 416 |
415 BackendImpact get throwExpression { | 417 BackendImpact get throwExpression { |
416 return _throwExpression ??= new BackendImpact( | 418 return _throwExpression ??= new BackendImpact( |
417 // We don't know ahead of time whether we will need the throw in a | 419 // We don't know ahead of time whether we will need the throw in a |
418 // statement context or an expression context, so we register both | 420 // statement context or an expression context, so we register both |
419 // here, even though we may not need the throwExpression helper. | 421 // here, even though we may not need the throwExpression helper. |
420 staticUses: [ | 422 staticUses: [ |
421 _helpers.wrapExceptionHelper, | 423 _commonElements.wrapExceptionHelper, |
422 _helpers.throwExpressionHelper | 424 _commonElements.throwExpressionHelper |
423 ]); | 425 ]); |
424 } | 426 } |
425 | 427 |
426 BackendImpact _lazyField; | 428 BackendImpact _lazyField; |
427 | 429 |
428 BackendImpact get lazyField { | 430 BackendImpact get lazyField { |
429 return _lazyField ??= | 431 return _lazyField ??= |
430 new BackendImpact(staticUses: [_helpers.cyclicThrowHelper]); | 432 new BackendImpact(staticUses: [_commonElements.cyclicThrowHelper]); |
431 } | 433 } |
432 | 434 |
433 BackendImpact _typeLiteral; | 435 BackendImpact _typeLiteral; |
434 | 436 |
435 BackendImpact get typeLiteral { | 437 BackendImpact get typeLiteral { |
436 return _typeLiteral ??= new BackendImpact( | 438 return _typeLiteral ??= new BackendImpact( |
437 instantiatedClasses: [_helpers.typeLiteralClass], | 439 instantiatedClasses: [_commonElements.typeLiteralClass], |
438 staticUses: [_helpers.createRuntimeType]); | 440 staticUses: [_commonElements.createRuntimeType]); |
439 } | 441 } |
440 | 442 |
441 BackendImpact _stackTraceInCatch; | 443 BackendImpact _stackTraceInCatch; |
442 | 444 |
443 BackendImpact get stackTraceInCatch { | 445 BackendImpact get stackTraceInCatch { |
444 return _stackTraceInCatch ??= new BackendImpact( | 446 return _stackTraceInCatch ??= new BackendImpact( |
445 instantiatedClasses: [_helpers.stackTraceClass], | 447 instantiatedClasses: [_commonElements.stackTraceHelperClass], |
446 staticUses: [_helpers.traceFromException]); | 448 staticUses: [_commonElements.traceFromException]); |
447 } | 449 } |
448 | 450 |
449 BackendImpact _syncForIn; | 451 BackendImpact _syncForIn; |
450 | 452 |
451 BackendImpact get syncForIn { | 453 BackendImpact get syncForIn { |
452 return _syncForIn ??= new BackendImpact( | 454 return _syncForIn ??= new BackendImpact( |
453 // The SSA builder recognizes certain for-in loops and can generate | 455 // The SSA builder recognizes certain for-in loops and can generate |
454 // calls to throwConcurrentModificationError. | 456 // calls to throwConcurrentModificationError. |
455 staticUses: [_helpers.checkConcurrentModificationError]); | 457 staticUses: [_commonElements.checkConcurrentModificationError]); |
456 } | 458 } |
457 | 459 |
458 BackendImpact _typeVariableExpression; | 460 BackendImpact _typeVariableExpression; |
459 | 461 |
460 BackendImpact get typeVariableExpression { | 462 BackendImpact get typeVariableExpression { |
461 return _typeVariableExpression ??= new BackendImpact(staticUses: [ | 463 return _typeVariableExpression ??= new BackendImpact(staticUses: [ |
462 _helpers.setRuntimeTypeInfo, | 464 _commonElements.setRuntimeTypeInfo, |
463 _helpers.getRuntimeTypeInfo, | 465 _commonElements.getRuntimeTypeInfo, |
464 _helpers.runtimeTypeToString, | 466 _commonElements.runtimeTypeToString, |
465 _helpers.createRuntimeType | 467 _commonElements.createRuntimeType |
466 ], otherImpacts: [ | 468 ], otherImpacts: [ |
467 listValues, | 469 listValues, |
468 getRuntimeTypeArgument, | 470 getRuntimeTypeArgument, |
469 _needsInt('Needed for accessing a type variable literal on this.') | 471 _needsInt('Needed for accessing a type variable literal on this.') |
470 ]); | 472 ]); |
471 } | 473 } |
472 | 474 |
473 BackendImpact _typeCheck; | 475 BackendImpact _typeCheck; |
474 | 476 |
475 BackendImpact get typeCheck { | 477 BackendImpact get typeCheck { |
476 return _typeCheck ??= new BackendImpact(otherImpacts: [boolValues]); | 478 return _typeCheck ??= new BackendImpact(otherImpacts: [boolValues]); |
477 } | 479 } |
478 | 480 |
479 BackendImpact _checkedModeTypeCheck; | 481 BackendImpact _checkedModeTypeCheck; |
480 | 482 |
481 BackendImpact get checkedModeTypeCheck { | 483 BackendImpact get checkedModeTypeCheck { |
482 return _checkedModeTypeCheck ??= | 484 return _checkedModeTypeCheck ??= |
483 new BackendImpact(staticUses: [_helpers.throwRuntimeError]); | 485 new BackendImpact(staticUses: [_commonElements.throwRuntimeError]); |
484 } | 486 } |
485 | 487 |
486 BackendImpact _malformedTypeCheck; | 488 BackendImpact _malformedTypeCheck; |
487 | 489 |
488 BackendImpact get malformedTypeCheck { | 490 BackendImpact get malformedTypeCheck { |
489 return _malformedTypeCheck ??= new BackendImpact( | 491 return _malformedTypeCheck ??= new BackendImpact( |
490 staticUses: _options.useKernel | 492 staticUses: _options.useKernel |
491 ? [ | 493 ? [ |
492 _helpers.malformedTypeError, | 494 _commonElements.malformedTypeError, |
493 ] | 495 ] |
494 : [ | 496 : [ |
495 _helpers.throwTypeError, | 497 _commonElements.throwTypeError, |
496 ]); | 498 ]); |
497 } | 499 } |
498 | 500 |
499 BackendImpact _genericTypeCheck; | 501 BackendImpact _genericTypeCheck; |
500 | 502 |
501 BackendImpact get genericTypeCheck { | 503 BackendImpact get genericTypeCheck { |
502 return _genericTypeCheck ??= new BackendImpact(staticUses: [ | 504 return _genericTypeCheck ??= new BackendImpact(staticUses: [ |
503 _helpers.checkSubtype, | 505 _commonElements.checkSubtype, |
504 // TODO(johnniwinther): Investigate why this is needed. | 506 // TODO(johnniwinther): Investigate why this is needed. |
505 _helpers.setRuntimeTypeInfo, | 507 _commonElements.setRuntimeTypeInfo, |
506 _helpers.getRuntimeTypeInfo | 508 _commonElements.getRuntimeTypeInfo |
507 ], otherImpacts: [ | 509 ], otherImpacts: [ |
508 listValues, | 510 listValues, |
509 getRuntimeTypeArgument | 511 getRuntimeTypeArgument |
510 ]); | 512 ]); |
511 } | 513 } |
512 | 514 |
513 BackendImpact _genericIsCheck; | 515 BackendImpact _genericIsCheck; |
514 | 516 |
515 BackendImpact get genericIsCheck { | 517 BackendImpact get genericIsCheck { |
516 return _genericIsCheck ??= new BackendImpact(otherImpacts: [intValues]); | 518 return _genericIsCheck ??= new BackendImpact(otherImpacts: [intValues]); |
517 } | 519 } |
518 | 520 |
519 BackendImpact _genericCheckedModeTypeCheck; | 521 BackendImpact _genericCheckedModeTypeCheck; |
520 | 522 |
521 BackendImpact get genericCheckedModeTypeCheck { | 523 BackendImpact get genericCheckedModeTypeCheck { |
522 return _genericCheckedModeTypeCheck ??= | 524 return _genericCheckedModeTypeCheck ??= |
523 new BackendImpact(staticUses: [_helpers.assertSubtype]); | 525 new BackendImpact(staticUses: [_commonElements.assertSubtype]); |
524 } | 526 } |
525 | 527 |
526 BackendImpact _typeVariableTypeCheck; | 528 BackendImpact _typeVariableTypeCheck; |
527 | 529 |
528 BackendImpact get typeVariableTypeCheck { | 530 BackendImpact get typeVariableTypeCheck { |
529 return _typeVariableTypeCheck ??= | 531 return _typeVariableTypeCheck ??= new BackendImpact( |
530 new BackendImpact(staticUses: [_helpers.checkSubtypeOfRuntimeType]); | 532 staticUses: [_commonElements.checkSubtypeOfRuntimeType]); |
531 } | 533 } |
532 | 534 |
533 BackendImpact _typeVariableCheckedModeTypeCheck; | 535 BackendImpact _typeVariableCheckedModeTypeCheck; |
534 | 536 |
535 BackendImpact get typeVariableCheckedModeTypeCheck { | 537 BackendImpact get typeVariableCheckedModeTypeCheck { |
536 return _typeVariableCheckedModeTypeCheck ??= | 538 return _typeVariableCheckedModeTypeCheck ??= new BackendImpact( |
537 new BackendImpact(staticUses: [_helpers.assertSubtypeOfRuntimeType]); | 539 staticUses: [_commonElements.assertSubtypeOfRuntimeType]); |
538 } | 540 } |
539 | 541 |
540 BackendImpact _functionTypeCheck; | 542 BackendImpact _functionTypeCheck; |
541 | 543 |
542 BackendImpact get functionTypeCheck { | 544 BackendImpact get functionTypeCheck { |
543 return _functionTypeCheck ??= | 545 return _functionTypeCheck ??= |
544 new BackendImpact(staticUses: [/*helpers.functionTypeTestMetaHelper*/]); | 546 new BackendImpact(staticUses: [/*helpers.functionTypeTestMetaHelper*/]); |
545 } | 547 } |
546 | 548 |
547 BackendImpact _nativeTypeCheck; | 549 BackendImpact _nativeTypeCheck; |
548 | 550 |
549 BackendImpact get nativeTypeCheck { | 551 BackendImpact get nativeTypeCheck { |
550 return _nativeTypeCheck ??= new BackendImpact(staticUses: [ | 552 return _nativeTypeCheck ??= new BackendImpact(staticUses: [ |
551 // We will neeed to add the "$is" and "$as" properties on the | 553 // We will neeed to add the "$is" and "$as" properties on the |
552 // JavaScript object prototype, so we make sure | 554 // JavaScript object prototype, so we make sure |
553 // [:defineProperty:] is compiled. | 555 // [:defineProperty:] is compiled. |
554 _helpers.defineProperty | 556 _commonElements.defineProperty |
555 ]); | 557 ]); |
556 } | 558 } |
557 | 559 |
558 BackendImpact _closure; | 560 BackendImpact _closure; |
559 | 561 |
560 BackendImpact get closure { | 562 BackendImpact get closure { |
561 return _closure ??= | 563 return _closure ??= |
562 new BackendImpact(instantiatedClasses: [_commonElements.functionClass]); | 564 new BackendImpact(instantiatedClasses: [_commonElements.functionClass]); |
563 } | 565 } |
564 | 566 |
565 BackendImpact _interceptorUse; | 567 BackendImpact _interceptorUse; |
566 | 568 |
567 BackendImpact get interceptorUse { | 569 BackendImpact get interceptorUse { |
568 return _interceptorUse ??= new BackendImpact( | 570 return _interceptorUse ??= new BackendImpact( |
569 staticUses: [ | 571 staticUses: [ |
570 _helpers.getNativeInterceptorMethod | 572 _commonElements.getNativeInterceptorMethod |
571 ], | 573 ], |
572 instantiatedClasses: [ | 574 instantiatedClasses: [ |
573 _helpers.jsJavaScriptObjectClass, | 575 _commonElements.jsJavaScriptObjectClass, |
574 _helpers.jsPlainJavaScriptObjectClass, | 576 _commonElements.jsPlainJavaScriptObjectClass, |
575 _helpers.jsJavaScriptFunctionClass | 577 _commonElements.jsJavaScriptFunctionClass |
576 ], | 578 ], |
577 features: new EnumSet<BackendFeature>.fromValues([ | 579 features: new EnumSet<BackendFeature>.fromValues([ |
578 BackendFeature.needToInitializeDispatchProperty, | 580 BackendFeature.needToInitializeDispatchProperty, |
579 BackendFeature.needToInitializeIsolateAffinityTag | 581 BackendFeature.needToInitializeIsolateAffinityTag |
580 ], fixed: true)); | 582 ], fixed: true)); |
581 } | 583 } |
582 | 584 |
583 BackendImpact _numClasses; | 585 BackendImpact _numClasses; |
584 | 586 |
585 BackendImpact get numClasses { | 587 BackendImpact get numClasses { |
586 return _numClasses ??= new BackendImpact( | 588 return _numClasses ??= new BackendImpact( |
587 // The backend will try to optimize number operations and use the | 589 // The backend will try to optimize number operations and use the |
588 // `iae` helper directly. | 590 // `iae` helper directly. |
589 globalUses: [_helpers.throwIllegalArgumentException]); | 591 globalUses: [_commonElements.throwIllegalArgumentException]); |
590 } | 592 } |
591 | 593 |
592 BackendImpact _listOrStringClasses; | 594 BackendImpact _listOrStringClasses; |
593 | 595 |
594 BackendImpact get listOrStringClasses { | 596 BackendImpact get listOrStringClasses { |
595 return _listOrStringClasses ??= new BackendImpact( | 597 return _listOrStringClasses ??= new BackendImpact( |
596 // The backend will try to optimize array and string access and use the | 598 // The backend will try to optimize array and string access and use the |
597 // `ioore` and `iae` _helpers directly. | 599 // `ioore` and `iae` _commonElements directly. |
598 globalUses: [ | 600 globalUses: [ |
599 _helpers.throwIndexOutOfRangeException, | 601 _commonElements.throwIndexOutOfRangeException, |
600 _helpers.throwIllegalArgumentException | 602 _commonElements.throwIllegalArgumentException |
601 ]); | 603 ]); |
602 } | 604 } |
603 | 605 |
604 BackendImpact _functionClass; | 606 BackendImpact _functionClass; |
605 | 607 |
606 BackendImpact get functionClass { | 608 BackendImpact get functionClass { |
607 return _functionClass ??= | 609 return _functionClass ??= |
608 new BackendImpact(globalClasses: [_helpers.closureClass]); | 610 new BackendImpact(globalClasses: [_commonElements.closureClass]); |
609 } | 611 } |
610 | 612 |
611 BackendImpact _mapClass; | 613 BackendImpact _mapClass; |
612 | 614 |
613 BackendImpact get mapClass { | 615 BackendImpact get mapClass { |
614 return _mapClass ??= new BackendImpact( | 616 return _mapClass ??= new BackendImpact( |
615 // The backend will use a literal list to initialize the entries | 617 // The backend will use a literal list to initialize the entries |
616 // of the map. | 618 // of the map. |
617 globalClasses: [_commonElements.listClass, _helpers.mapLiteralClass]); | 619 globalClasses: [ |
| 620 _commonElements.listClass, |
| 621 _commonElements.mapLiteralClass |
| 622 ]); |
618 } | 623 } |
619 | 624 |
620 BackendImpact _boundClosureClass; | 625 BackendImpact _boundClosureClass; |
621 | 626 |
622 BackendImpact get boundClosureClass { | 627 BackendImpact get boundClosureClass { |
623 return _boundClosureClass ??= | 628 return _boundClosureClass ??= |
624 new BackendImpact(globalClasses: [_helpers.boundClosureClass]); | 629 new BackendImpact(globalClasses: [_commonElements.boundClosureClass]); |
625 } | 630 } |
626 | 631 |
627 BackendImpact _nativeOrExtendsClass; | 632 BackendImpact _nativeOrExtendsClass; |
628 | 633 |
629 BackendImpact get nativeOrExtendsClass { | 634 BackendImpact get nativeOrExtendsClass { |
630 return _nativeOrExtendsClass ??= new BackendImpact(globalUses: [ | 635 return _nativeOrExtendsClass ??= new BackendImpact(globalUses: [ |
631 _helpers.getNativeInterceptorMethod | 636 _commonElements.getNativeInterceptorMethod |
632 ], globalClasses: [ | 637 ], globalClasses: [ |
633 _helpers.jsInterceptorClass, | 638 _commonElements.jsInterceptorClass, |
634 _helpers.jsJavaScriptObjectClass, | 639 _commonElements.jsJavaScriptObjectClass, |
635 _helpers.jsPlainJavaScriptObjectClass, | 640 _commonElements.jsPlainJavaScriptObjectClass, |
636 _helpers.jsJavaScriptFunctionClass | 641 _commonElements.jsJavaScriptFunctionClass |
637 ]); | 642 ]); |
638 } | 643 } |
639 | 644 |
640 BackendImpact _mapLiteralClass; | 645 BackendImpact _mapLiteralClass; |
641 | 646 |
642 BackendImpact get mapLiteralClass { | 647 BackendImpact get mapLiteralClass { |
643 return _mapLiteralClass ??= new BackendImpact(globalUses: [ | 648 return _mapLiteralClass ??= new BackendImpact(globalUses: [ |
644 _helpers.mapLiteralConstructor, | 649 _commonElements.mapLiteralConstructor, |
645 _helpers.mapLiteralConstructorEmpty, | 650 _commonElements.mapLiteralConstructorEmpty, |
646 _helpers.mapLiteralUntypedMaker, | 651 _commonElements.mapLiteralUntypedMaker, |
647 _helpers.mapLiteralUntypedEmptyMaker | 652 _commonElements.mapLiteralUntypedEmptyMaker |
648 ]); | 653 ]); |
649 } | 654 } |
650 | 655 |
651 BackendImpact _closureClass; | 656 BackendImpact _closureClass; |
652 | 657 |
653 BackendImpact get closureClass { | 658 BackendImpact get closureClass { |
654 return _closureClass ??= | 659 return _closureClass ??= |
655 new BackendImpact(globalUses: [_helpers.closureFromTearOff]); | 660 new BackendImpact(globalUses: [_commonElements.closureFromTearOff]); |
656 } | 661 } |
657 | 662 |
658 BackendImpact _listClasses; | 663 BackendImpact _listClasses; |
659 | 664 |
660 BackendImpact get listClasses { | 665 BackendImpact get listClasses { |
661 return _listClasses ??= new BackendImpact( | 666 return _listClasses ??= new BackendImpact( |
662 // Literal lists can be translated into calls to these functions: | 667 // Literal lists can be translated into calls to these functions: |
663 globalUses: [ | 668 globalUses: [ |
664 _helpers.jsArrayTypedConstructor, | 669 _commonElements.jsArrayTypedConstructor, |
665 _helpers.setRuntimeTypeInfo, | 670 _commonElements.setRuntimeTypeInfo, |
666 _helpers.getTypeArgumentByIndex | 671 _commonElements.getTypeArgumentByIndex |
667 ]); | 672 ]); |
668 } | 673 } |
669 | 674 |
670 BackendImpact _jsIndexingBehavior; | 675 BackendImpact _jsIndexingBehavior; |
671 | 676 |
672 BackendImpact get jsIndexingBehavior { | 677 BackendImpact get jsIndexingBehavior { |
673 return _jsIndexingBehavior ??= new BackendImpact( | 678 return _jsIndexingBehavior ??= new BackendImpact( |
674 // These two _helpers are used by the emitter and the codegen. | 679 // These two _commonElements are used by the emitter and the codegen. |
675 // Because we cannot enqueue elements at the time of emission, | 680 // Because we cannot enqueue elements at the time of emission, |
676 // we make sure they are always generated. | 681 // we make sure they are always generated. |
677 globalUses: [_helpers.isJsIndexable]); | 682 globalUses: [_commonElements.isJsIndexable]); |
678 } | 683 } |
679 | 684 |
680 BackendImpact _enableTypeAssertions; | 685 BackendImpact _enableTypeAssertions; |
681 | 686 |
682 BackendImpact get enableTypeAssertions { | 687 BackendImpact get enableTypeAssertions { |
683 return _enableTypeAssertions ??= new BackendImpact( | 688 return _enableTypeAssertions ??= new BackendImpact( |
684 // Register the helper that checks if the expression in an if/while/for | 689 // Register the helper that checks if the expression in an if/while/for |
685 // is a boolean. | 690 // is a boolean. |
686 // TODO(johnniwinther): Should this be registered through a [Feature] | 691 // TODO(johnniwinther): Should this be registered through a [Feature] |
687 // instead? | 692 // instead? |
688 globalUses: [_helpers.boolConversionCheck]); | 693 globalUses: [_commonElements.boolConversionCheck]); |
689 } | 694 } |
690 | 695 |
691 BackendImpact _traceHelper; | 696 BackendImpact _traceHelper; |
692 | 697 |
693 BackendImpact get traceHelper { | 698 BackendImpact get traceHelper { |
694 return _traceHelper ??= | 699 return _traceHelper ??= |
695 new BackendImpact(globalUses: [_helpers.traceHelper]); | 700 new BackendImpact(globalUses: [_commonElements.traceHelper]); |
696 } | 701 } |
697 | 702 |
698 BackendImpact _assertUnreachable; | 703 BackendImpact _assertUnreachable; |
699 | 704 |
700 BackendImpact get assertUnreachable { | 705 BackendImpact get assertUnreachable { |
701 return _assertUnreachable ??= | 706 return _assertUnreachable ??= new BackendImpact( |
702 new BackendImpact(globalUses: [_helpers.assertUnreachableMethod]); | 707 globalUses: [_commonElements.assertUnreachableMethod]); |
703 } | 708 } |
704 | 709 |
705 BackendImpact _runtimeTypeSupport; | 710 BackendImpact _runtimeTypeSupport; |
706 | 711 |
707 BackendImpact get runtimeTypeSupport { | 712 BackendImpact get runtimeTypeSupport { |
708 return _runtimeTypeSupport ??= new BackendImpact( | 713 return _runtimeTypeSupport ??= new BackendImpact(globalClasses: [ |
709 globalClasses: [_commonElements.listClass], | 714 _commonElements.listClass |
710 globalUses: [_helpers.setRuntimeTypeInfo, _helpers.getRuntimeTypeInfo], | 715 ], globalUses: [ |
711 otherImpacts: [getRuntimeTypeArgument, computeSignature]); | 716 _commonElements.setRuntimeTypeInfo, |
| 717 _commonElements.getRuntimeTypeInfo |
| 718 ], otherImpacts: [ |
| 719 getRuntimeTypeArgument, |
| 720 computeSignature |
| 721 ]); |
712 } | 722 } |
713 | 723 |
714 BackendImpact _deferredLoading; | 724 BackendImpact _deferredLoading; |
715 | 725 |
716 BackendImpact get deferredLoading { | 726 BackendImpact get deferredLoading { |
717 return _deferredLoading ??= | 727 return _deferredLoading ??= |
718 new BackendImpact(globalUses: [_helpers.checkDeferredIsLoaded], | 728 new BackendImpact(globalUses: [_commonElements.checkDeferredIsLoaded], |
719 // Also register the types of the arguments passed to this method. | 729 // Also register the types of the arguments passed to this method. |
720 globalClasses: [_commonElements.stringClass]); | 730 globalClasses: [_commonElements.stringClass]); |
721 } | 731 } |
722 | 732 |
723 BackendImpact _noSuchMethodSupport; | 733 BackendImpact _noSuchMethodSupport; |
724 | 734 |
725 BackendImpact get noSuchMethodSupport { | 735 BackendImpact get noSuchMethodSupport { |
726 return _noSuchMethodSupport ??= new BackendImpact( | 736 return _noSuchMethodSupport ??= new BackendImpact( |
727 staticUses: [_helpers.createInvocationMirror], | 737 staticUses: [_commonElements.createInvocationMirror], |
728 dynamicUses: [Selectors.noSuchMethod_]); | 738 dynamicUses: [Selectors.noSuchMethod_]); |
729 } | 739 } |
730 | 740 |
731 BackendImpact _isolateSupport; | 741 BackendImpact _isolateSupport; |
732 | 742 |
733 /// Backend impact for isolate support. | 743 /// Backend impact for isolate support. |
734 BackendImpact get isolateSupport { | 744 BackendImpact get isolateSupport { |
735 return _isolateSupport ??= | 745 return _isolateSupport ??= |
736 new BackendImpact(globalUses: [_helpers.startRootIsolate]); | 746 new BackendImpact(globalUses: [_commonElements.startRootIsolate]); |
737 } | 747 } |
738 | 748 |
739 BackendImpact _isolateSupportForResolution; | 749 BackendImpact _isolateSupportForResolution; |
740 | 750 |
741 /// Additional backend impact for isolate support in resolution. | 751 /// Additional backend impact for isolate support in resolution. |
742 BackendImpact get isolateSupportForResolution { | 752 BackendImpact get isolateSupportForResolution { |
743 return _isolateSupportForResolution ??= new BackendImpact( | 753 return _isolateSupportForResolution ??= new BackendImpact(globalUses: [ |
744 globalUses: [_helpers.currentIsolate, _helpers.callInIsolate]); | 754 _commonElements.currentIsolate, |
| 755 _commonElements.callInIsolate |
| 756 ]); |
745 } | 757 } |
746 | 758 |
747 BackendImpact _loadLibrary; | 759 BackendImpact _loadLibrary; |
748 | 760 |
749 /// Backend impact for accessing a `loadLibrary` function on a deferred | 761 /// Backend impact for accessing a `loadLibrary` function on a deferred |
750 /// prefix. | 762 /// prefix. |
751 BackendImpact get loadLibrary { | 763 BackendImpact get loadLibrary { |
752 return _loadLibrary ??= | 764 return _loadLibrary ??= |
753 new BackendImpact(globalUses: [_helpers.loadLibraryWrapper]); | 765 new BackendImpact(globalUses: [_commonElements.loadLibraryWrapper]); |
754 } | 766 } |
755 | 767 |
756 BackendImpact _memberClosure; | 768 BackendImpact _memberClosure; |
757 | 769 |
758 /// Backend impact for performing member closurization. | 770 /// Backend impact for performing member closurization. |
759 BackendImpact get memberClosure { | 771 BackendImpact get memberClosure { |
760 return _memberClosure ??= | 772 return _memberClosure ??= |
761 new BackendImpact(globalClasses: [_helpers.boundClosureClass]); | 773 new BackendImpact(globalClasses: [_commonElements.boundClosureClass]); |
762 } | 774 } |
763 | 775 |
764 BackendImpact _staticClosure; | 776 BackendImpact _staticClosure; |
765 | 777 |
766 /// Backend impact for performing closurization of a top-level or static | 778 /// Backend impact for performing closurization of a top-level or static |
767 /// function. | 779 /// function. |
768 BackendImpact get staticClosure { | 780 BackendImpact get staticClosure { |
769 return _staticClosure ??= | 781 return _staticClosure ??= |
770 new BackendImpact(globalClasses: [_helpers.closureClass]); | 782 new BackendImpact(globalClasses: [_commonElements.closureClass]); |
771 } | 783 } |
772 | 784 |
773 BackendImpact _typeVariableMirror; | 785 BackendImpact _typeVariableMirror; |
774 | 786 |
775 /// Backend impact for type variables through mirrors. | 787 /// Backend impact for type variables through mirrors. |
776 BackendImpact get typeVariableMirror { | 788 BackendImpact get typeVariableMirror { |
777 return _typeVariableMirror ??= new BackendImpact(staticUses: [ | 789 return _typeVariableMirror ??= new BackendImpact(staticUses: [ |
778 _helpers.typeVariableConstructor, | 790 _commonElements.typeVariableConstructor, |
779 _helpers.createRuntimeType | 791 _commonElements.createRuntimeType |
780 ], instantiatedClasses: [ | 792 ], instantiatedClasses: [ |
781 _helpers.typeVariableClass | 793 _commonElements.typeVariableClass |
782 ]); | 794 ]); |
783 } | 795 } |
784 } | 796 } |
OLD | NEW |