| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.new_js_emitter.model; | 5 library dart2js.new_js_emitter.model; |
| 6 | 6 |
| 7 import '../js/js.dart' as js show Expression; | 7 import '../js/js.dart' as js show Expression; |
| 8 import '../constants/values.dart' show ConstantValue; | 8 import '../constants/values.dart' show ConstantValue; |
| 9 | 9 |
| 10 import '../deferred_load.dart' show OutputUnit; | 10 import '../deferred_load.dart' show OutputUnit; |
| 11 | 11 |
| 12 import '../common.dart'; | 12 import '../common.dart'; |
| 13 | 13 |
| 14 class Program { | 14 class Program { |
| 15 final List<Fragment> fragments; | 15 final List<Fragment> fragments; |
| 16 final bool outputContainsConstantList; | 16 final bool outputContainsConstantList; |
| 17 final bool outputContainsNativeClasses; | 17 final bool outputContainsNativeClasses; |
| 18 /// A map from load id to the list of fragments that need to be loaded. | 18 /// A map from load id to the list of fragments that need to be loaded. |
| 19 final Map<String, List<Fragment>> loadMap; | 19 final Map<String, List<Fragment>> loadMap; |
| 20 | 20 |
| 21 // If this field is not `null` then its value must be emitted in the embedded |
| 22 // global `TYPE_TO_INTERCEPTOR_MAP`. The map references constants and classes. |
| 23 final js.Expression typeToInterceptorMap; |
| 24 |
| 21 Program(this.fragments, | 25 Program(this.fragments, |
| 22 this.loadMap, | 26 this.loadMap, |
| 27 this.typeToInterceptorMap, |
| 23 {this.outputContainsNativeClasses, | 28 {this.outputContainsNativeClasses, |
| 24 this.outputContainsConstantList}) { | 29 this.outputContainsConstantList}) { |
| 25 assert(outputContainsNativeClasses != null); | 30 assert(outputContainsNativeClasses != null); |
| 26 assert(outputContainsConstantList != null); | 31 assert(outputContainsConstantList != null); |
| 27 } | 32 } |
| 28 | 33 |
| 29 bool get isSplit => fragments.length > 1; | 34 bool get isSplit => fragments.length > 1; |
| 30 Iterable<Fragment> get deferredFragments => fragments.skip(1); | 35 Iterable<Fragment> get deferredFragments => fragments.skip(1); |
| 31 } | 36 } |
| 32 | 37 |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 StaticMethod(Element element, String name, this.holder, js.Expression code, | 323 StaticMethod(Element element, String name, this.holder, js.Expression code, |
| 319 {bool needsTearOff}) | 324 {bool needsTearOff}) |
| 320 : super(element, name, code, needsTearOff: needsTearOff); | 325 : super(element, name, code, needsTearOff: needsTearOff); |
| 321 } | 326 } |
| 322 | 327 |
| 323 class StaticStubMethod extends StaticMethod { | 328 class StaticStubMethod extends StaticMethod { |
| 324 StaticStubMethod(String name, Holder holder, js.Expression code, | 329 StaticStubMethod(String name, Holder holder, js.Expression code, |
| 325 {bool needsTearOff}) | 330 {bool needsTearOff}) |
| 326 : super(null, name, holder, code, needsTearOff: needsTearOff); | 331 : super(null, name, holder, code, needsTearOff: needsTearOff); |
| 327 } | 332 } |
| OLD | NEW |