| 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 part of dart2js.js_emitter.startup_emitter.model_emitter; | 5 part of dart2js.js_emitter.startup_emitter.model_emitter; |
| 6 | 6 |
| 7 /// The name of the property that stores the tear-off getter on a static | 7 /// The name of the property that stores the tear-off getter on a static |
| 8 /// function. | 8 /// function. |
| 9 /// | 9 /// |
| 10 /// This property is only used when isolates are used. | 10 /// This property is only used when isolates are used. |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // Creates lazy getters for statics that must run initializers on first access. | 338 // Creates lazy getters for statics that must run initializers on first access. |
| 339 #lazyStatics; | 339 #lazyStatics; |
| 340 | 340 |
| 341 // Emits the embedded globals. | 341 // Emits the embedded globals. |
| 342 #embeddedGlobals; | 342 #embeddedGlobals; |
| 343 | 343 |
| 344 // Sets up the native support. | 344 // Sets up the native support. |
| 345 // Native-support uses setOrUpdateInterceptorsByTag and setOrUpdateLeafTags. | 345 // Native-support uses setOrUpdateInterceptorsByTag and setOrUpdateLeafTags. |
| 346 #nativeSupport; | 346 #nativeSupport; |
| 347 | 347 |
| 348 // Sets up the js-interop support. |
| 349 #jsInteropSupport; |
| 350 |
| 348 // Invokes main (making sure that it records the 'current-script' value). | 351 // Invokes main (making sure that it records the 'current-script' value). |
| 349 #invokeMain; | 352 #invokeMain; |
| 350 })() | 353 })() |
| 351 '''; | 354 '''; |
| 352 | 355 |
| 353 /// An expression that returns `true` if `__proto__` can be assigned to stitch | 356 /// An expression that returns `true` if `__proto__` can be assigned to stitch |
| 354 /// together a prototype chain, and the performance is good. | 357 /// together a prototype chain, and the performance is good. |
| 355 const String directAccessTestExpression = r''' | 358 const String directAccessTestExpression = r''' |
| 356 (function () { | 359 (function () { |
| 357 var cls = function () {}; | 360 var cls = function () {}; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 'inheritance': emitInheritance(fragment), | 493 'inheritance': emitInheritance(fragment), |
| 491 'aliases': emitInstanceMethodAliases(fragment), | 494 'aliases': emitInstanceMethodAliases(fragment), |
| 492 'tearOffs': emitInstallTearOffs(fragment), | 495 'tearOffs': emitInstallTearOffs(fragment), |
| 493 'constants': emitConstants(fragment), | 496 'constants': emitConstants(fragment), |
| 494 'staticNonFinalFields': emitStaticNonFinalFields(fragment), | 497 'staticNonFinalFields': emitStaticNonFinalFields(fragment), |
| 495 'lazyStatics': emitLazilyInitializedStatics(fragment), | 498 'lazyStatics': emitLazilyInitializedStatics(fragment), |
| 496 'embeddedGlobals': emitEmbeddedGlobals(program, deferredLoadHashes), | 499 'embeddedGlobals': emitEmbeddedGlobals(program, deferredLoadHashes), |
| 497 'nativeSupport': program.needsNativeSupport | 500 'nativeSupport': program.needsNativeSupport |
| 498 ? emitNativeSupport(fragment) | 501 ? emitNativeSupport(fragment) |
| 499 : new js.EmptyStatement(), | 502 : new js.EmptyStatement(), |
| 503 'jsInteropSupport': backend.jsInteropAnalysis.enabledJsInterop |
| 504 ? backend.jsInteropAnalysis.buildJsInteropBootstrap() |
| 505 : new js.EmptyStatement(), |
| 500 'invokeMain': fragment.invokeMain, | 506 'invokeMain': fragment.invokeMain, |
| 501 }); | 507 }); |
| 502 } | 508 } |
| 503 | 509 |
| 504 js.Expression emitDeferredFragment(DeferredFragment fragment, | 510 js.Expression emitDeferredFragment(DeferredFragment fragment, |
| 505 js.Expression deferredTypes, List<Holder> holders) { | 511 js.Expression deferredTypes, List<Holder> holders) { |
| 506 List<Holder> nonStaticStateHolders = holders | 512 List<Holder> nonStaticStateHolders = holders |
| 507 .where((Holder holder) => !holder.isStaticStateHolder) | 513 .where((Holder holder) => !holder.isStaticStateHolder) |
| 508 .toList(growable: false); | 514 .toList(growable: false); |
| 509 | 515 |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1359 } | 1365 } |
| 1360 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1366 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
| 1361 js.objectLiteral(interceptorsByTag))); | 1367 js.objectLiteral(interceptorsByTag))); |
| 1362 statements.add( | 1368 statements.add( |
| 1363 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1369 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
| 1364 statements.add(subclassAssignment); | 1370 statements.add(subclassAssignment); |
| 1365 | 1371 |
| 1366 return new js.Block(statements); | 1372 return new js.Block(statements); |
| 1367 } | 1373 } |
| 1368 } | 1374 } |
| OLD | NEW |