Chromium Code Reviews| 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 /// Additional properties that have to be added to classes. | |
| 22 final Map<Class, Map<String, js.Expression>> additionalProperties; | |
| 23 | |
| 24 Program(this.fragments, | 21 Program(this.fragments, |
| 25 this.additionalProperties, | |
| 26 this.loadMap, | 22 this.loadMap, |
| 27 {this.outputContainsNativeClasses, | 23 {this.outputContainsNativeClasses, |
| 28 this.outputContainsConstantList}) { | 24 this.outputContainsConstantList}) { |
| 29 assert(outputContainsNativeClasses != null); | 25 assert(outputContainsNativeClasses != null); |
| 30 assert(outputContainsConstantList != null); | 26 assert(outputContainsConstantList != null); |
| 31 } | 27 } |
| 32 | 28 |
| 33 bool get isSplit => fragments.length > 1; | 29 bool get isSplit => fragments.length > 1; |
| 34 Iterable<Fragment> get deferredFragments => fragments.skip(1); | 30 Iterable<Fragment> get deferredFragments => fragments.skip(1); |
| 35 } | 31 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 final bool isDirectlyInstantiated; | 187 final bool isDirectlyInstantiated; |
| 192 final bool isNative; | 188 final bool isNative; |
| 193 | 189 |
| 194 // If the class implements a function type, and the type is encoded in the | 190 // If the class implements a function type, and the type is encoded in the |
| 195 // metatada table, then this field contains the index into that field. | 191 // metatada table, then this field contains the index into that field. |
| 196 final int functionTypeIndex; | 192 final int functionTypeIndex; |
| 197 | 193 |
| 198 /// Whether the class must be evaluated eagerly. | 194 /// Whether the class must be evaluated eagerly. |
| 199 bool isEager = false; | 195 bool isEager = false; |
| 200 | 196 |
| 197 /// Data that must be emitted with the class for native interop. | |
| 198 String nativeBlob; | |
|
herhut
2015/01/26 14:58:22
For me, a BLOB is a Binary Large OBject. How about
floitsch
2015/01/26 18:02:26
My fault. I thought it was just referring to opaqu
floitsch
2015/01/27 12:58:59
Renamed to NativeInfo.
| |
| 199 | |
| 201 Class(this.element, this.name, this.holder, | 200 Class(this.element, this.name, this.holder, |
| 202 this.methods, | 201 this.methods, |
| 203 this.fields, | 202 this.fields, |
| 204 this.staticFieldsForReflection, | 203 this.staticFieldsForReflection, |
| 205 this.callStubs, | 204 this.callStubs, |
| 206 this.isChecks, | 205 this.isChecks, |
| 207 this.functionTypeIndex, | 206 this.functionTypeIndex, |
| 208 {this.onlyForRti, | 207 {this.onlyForRti, |
| 209 this.isDirectlyInstantiated, | 208 this.isDirectlyInstantiated, |
| 210 this.isNative}) { | 209 this.isNative}) { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 StaticMethod(Element element, String name, this.holder, js.Expression code, | 318 StaticMethod(Element element, String name, this.holder, js.Expression code, |
| 320 {bool needsTearOff}) | 319 {bool needsTearOff}) |
| 321 : super(element, name, code, needsTearOff: needsTearOff); | 320 : super(element, name, code, needsTearOff: needsTearOff); |
| 322 } | 321 } |
| 323 | 322 |
| 324 class StaticStubMethod extends StaticMethod { | 323 class StaticStubMethod extends StaticMethod { |
| 325 StaticStubMethod(String name, Holder holder, js.Expression code, | 324 StaticStubMethod(String name, Holder holder, js.Expression code, |
| 326 {bool needsTearOff}) | 325 {bool needsTearOff}) |
| 327 : super(null, name, holder, code, needsTearOff: needsTearOff); | 326 : super(null, name, holder, code, needsTearOff: needsTearOff); |
| 328 } | 327 } |
| OLD | NEW |