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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 Iterable<Holder> nonStaticStateHolders = | 464 Iterable<Holder> nonStaticStateHolders = |
465 program.holders.where((Holder holder) => !holder.isStaticStateHolder); | 465 program.holders.where((Holder holder) => !holder.isStaticStateHolder); |
466 | 466 |
467 return js.js.statement(mainBoilerplate, { | 467 return js.js.statement(mainBoilerplate, { |
468 'directAccessTestExpression': js.js(directAccessTestExpression), | 468 'directAccessTestExpression': js.js(directAccessTestExpression), |
469 'typeNameProperty': js.string(ModelEmitter.typeNameProperty), | 469 'typeNameProperty': js.string(ModelEmitter.typeNameProperty), |
470 'cyclicThrow': backend.emitter | 470 'cyclicThrow': backend.emitter |
471 .staticFunctionAccess(compiler.commonElements.cyclicThrowHelper), | 471 .staticFunctionAccess(compiler.commonElements.cyclicThrowHelper), |
472 'operatorIsPrefix': js.string(namer.operatorIsPrefix), | 472 'operatorIsPrefix': js.string(namer.operatorIsPrefix), |
473 'tearOffCode': new js.Block(buildTearOffCode(backend)), | 473 'tearOffCode': new js.Block(buildTearOffCode(compiler.options, |
| 474 backend.emitter.emitter, backend.namer, compiler.commonElements)), |
474 'embeddedTypes': generateEmbeddedGlobalAccess(TYPES), | 475 'embeddedTypes': generateEmbeddedGlobalAccess(TYPES), |
475 'embeddedInterceptorTags': | 476 'embeddedInterceptorTags': |
476 generateEmbeddedGlobalAccess(INTERCEPTORS_BY_TAG), | 477 generateEmbeddedGlobalAccess(INTERCEPTORS_BY_TAG), |
477 'embeddedLeafTags': generateEmbeddedGlobalAccess(LEAF_TAGS), | 478 'embeddedLeafTags': generateEmbeddedGlobalAccess(LEAF_TAGS), |
478 'embeddedGlobalsObject': js.js("init"), | 479 'embeddedGlobalsObject': js.js("init"), |
479 'holdersList': new js.ArrayInitializer(nonStaticStateHolders | 480 'holdersList': new js.ArrayInitializer(nonStaticStateHolders |
480 .map((holder) => js.js("#", holder.name)) | 481 .map((holder) => js.js("#", holder.name)) |
481 .toList(growable: false)), | 482 .toList(growable: false)), |
482 'staticStateDeclaration': new js.VariableDeclaration( | 483 'staticStateDeclaration': new js.VariableDeclaration( |
483 namer.staticStateHolder, | 484 namer.staticStateHolder, |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 } | 1434 } |
1434 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1435 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
1435 js.objectLiteral(interceptorsByTag))); | 1436 js.objectLiteral(interceptorsByTag))); |
1436 statements.add( | 1437 statements.add( |
1437 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1438 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
1438 statements.addAll(subclassAssignments); | 1439 statements.addAll(subclassAssignments); |
1439 | 1440 |
1440 return wrapPhase('nativeSupport', new js.Block(statements)); | 1441 return wrapPhase('nativeSupport', new js.Block(statements)); |
1441 } | 1442 } |
1442 } | 1443 } |
OLD | NEW |