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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 * loaded dynamically when a deferred library is loaded. | 436 * loaded dynamically when a deferred library is loaded. |
437 * | 437 * |
438 * This class is stateless and can be reused for different fragments. | 438 * This class is stateless and can be reused for different fragments. |
439 */ | 439 */ |
440 class FragmentEmitter { | 440 class FragmentEmitter { |
441 final Compiler compiler; | 441 final Compiler compiler; |
442 final Namer namer; | 442 final Namer namer; |
443 final JavaScriptBackend backend; | 443 final JavaScriptBackend backend; |
444 final ConstantEmitter constantEmitter; | 444 final ConstantEmitter constantEmitter; |
445 final ModelEmitter modelEmitter; | 445 final ModelEmitter modelEmitter; |
| 446 final InterceptorData _interceptorData; |
446 | 447 |
447 FragmentEmitter(this.compiler, this.namer, this.backend, this.constantEmitter, | 448 FragmentEmitter(this.compiler, this.namer, this.backend, this.constantEmitter, |
448 this.modelEmitter); | 449 this.modelEmitter, this._interceptorData); |
449 | |
450 InterceptorData get _interceptorData => | |
451 // TODO(johnniwinther): Pass [InterceptorData] directly? | |
452 modelEmitter.nativeEmitter.interceptorData; | |
453 | 450 |
454 js.Expression generateEmbeddedGlobalAccess(String global) => | 451 js.Expression generateEmbeddedGlobalAccess(String global) => |
455 modelEmitter.generateEmbeddedGlobalAccess(global); | 452 modelEmitter.generateEmbeddedGlobalAccess(global); |
456 | 453 |
457 js.Expression generateConstantReference(ConstantValue value) => | 454 js.Expression generateConstantReference(ConstantValue value) => |
458 modelEmitter.generateConstantReference(value); | 455 modelEmitter.generateConstantReference(value); |
459 | 456 |
460 js.Expression classReference(Class cls) { | 457 js.Expression classReference(Class cls) { |
461 return js.js('#.#', [cls.holder.name, cls.name]); | 458 return js.js('#.#', [cls.holder.name, cls.name]); |
462 } | 459 } |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 } | 1468 } |
1472 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", | 1469 statements.add(js.js.statement("setOrUpdateInterceptorsByTag(#);", |
1473 js.objectLiteral(interceptorsByTag))); | 1470 js.objectLiteral(interceptorsByTag))); |
1474 statements.add( | 1471 statements.add( |
1475 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); | 1472 js.js.statement("setOrUpdateLeafTags(#);", js.objectLiteral(leafTags))); |
1476 statements.addAll(subclassAssignments); | 1473 statements.addAll(subclassAssignments); |
1477 | 1474 |
1478 return wrapPhase('nativeSupport', statements); | 1475 return wrapPhase('nativeSupport', statements); |
1479 } | 1476 } |
1480 } | 1477 } |
OLD | NEW |