| 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; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 final String name; | 202 final String name; |
| 203 final Holder holder; | 203 final Holder holder; |
| 204 Class _superclass; | 204 Class _superclass; |
| 205 final List<Method> methods; | 205 final List<Method> methods; |
| 206 final List<Field> fields; | 206 final List<Field> fields; |
| 207 final List<StubMethod> isChecks; | 207 final List<StubMethod> isChecks; |
| 208 | 208 |
| 209 /// Stub methods for this class that are call stubs for getters. | 209 /// Stub methods for this class that are call stubs for getters. |
| 210 final List<StubMethod> callStubs; | 210 final List<StubMethod> callStubs; |
| 211 | 211 |
| 212 /// Stub methods for this class handling reads to type variables. |
| 213 final List<StubMethod> typeVariableReaderStubs; |
| 214 |
| 212 /// noSuchMethod stubs in the special case that the class is Object. | 215 /// noSuchMethod stubs in the special case that the class is Object. |
| 213 final List<StubMethod> noSuchMethodStubs; | 216 final List<StubMethod> noSuchMethodStubs; |
| 214 final List<Field> staticFieldsForReflection; | 217 final List<Field> staticFieldsForReflection; |
| 215 final bool onlyForRti; | 218 final bool onlyForRti; |
| 216 final bool isDirectlyInstantiated; | 219 final bool isDirectlyInstantiated; |
| 217 final bool isNative; | 220 final bool isNative; |
| 218 | 221 |
| 219 // If the class implements a function type, and the type is encoded in the | 222 // If the class implements a function type, and the type is encoded in the |
| 220 // metatada table, then this field contains the index into that field. | 223 // metatada table, then this field contains the index into that field. |
| 221 final int functionTypeIndex; | 224 final int functionTypeIndex; |
| 222 | 225 |
| 223 /// Whether the class must be evaluated eagerly. | 226 /// Whether the class must be evaluated eagerly. |
| 224 bool isEager = false; | 227 bool isEager = false; |
| 225 | 228 |
| 226 /// Data that must be emitted with the class for native interop. | 229 /// Data that must be emitted with the class for native interop. |
| 227 String nativeInfo; | 230 String nativeInfo; |
| 228 | 231 |
| 229 Class(this.element, this.name, this.holder, | 232 Class(this.element, this.name, this.holder, |
| 230 this.methods, | 233 this.methods, |
| 231 this.fields, | 234 this.fields, |
| 232 this.staticFieldsForReflection, | 235 this.staticFieldsForReflection, |
| 233 this.callStubs, | 236 this.callStubs, |
| 237 this.typeVariableReaderStubs, |
| 234 this.noSuchMethodStubs, | 238 this.noSuchMethodStubs, |
| 235 this.isChecks, | 239 this.isChecks, |
| 236 this.functionTypeIndex, | 240 this.functionTypeIndex, |
| 237 {this.onlyForRti, | 241 {this.onlyForRti, |
| 238 this.isDirectlyInstantiated, | 242 this.isDirectlyInstantiated, |
| 239 this.isNative}) { | 243 this.isNative}) { |
| 240 assert(onlyForRti != null); | 244 assert(onlyForRti != null); |
| 241 assert(isDirectlyInstantiated != null); | 245 assert(isDirectlyInstantiated != null); |
| 242 assert(isNative != null); | 246 assert(isNative != null); |
| 243 } | 247 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 255 => (superclass == null) ? 0 : superclass.holder.index; | 259 => (superclass == null) ? 0 : superclass.holder.index; |
| 256 } | 260 } |
| 257 | 261 |
| 258 class MixinApplication extends Class { | 262 class MixinApplication extends Class { |
| 259 Class _mixinClass; | 263 Class _mixinClass; |
| 260 | 264 |
| 261 MixinApplication(Element element, String name, Holder holder, | 265 MixinApplication(Element element, String name, Holder holder, |
| 262 List<Field> instanceFields, | 266 List<Field> instanceFields, |
| 263 List<Field> staticFieldsForReflection, | 267 List<Field> staticFieldsForReflection, |
| 264 List<StubMethod> callStubs, | 268 List<StubMethod> callStubs, |
| 269 List<StubMethod> typeVariableReaderStubs, |
| 265 List<StubMethod> isChecks, | 270 List<StubMethod> isChecks, |
| 266 int functionTypeIndex, | 271 int functionTypeIndex, |
| 267 {bool onlyForRti, | 272 {bool onlyForRti, |
| 268 bool isDirectlyInstantiated}) | 273 bool isDirectlyInstantiated}) |
| 269 : super(element, | 274 : super(element, |
| 270 name, holder, | 275 name, holder, |
| 271 const <Method>[], | 276 const <Method>[], |
| 272 instanceFields, | 277 instanceFields, |
| 273 staticFieldsForReflection, | 278 staticFieldsForReflection, |
| 274 callStubs, | 279 callStubs, |
| 280 typeVariableReaderStubs, |
| 275 const <StubMethod>[], | 281 const <StubMethod>[], |
| 276 isChecks, functionTypeIndex, | 282 isChecks, functionTypeIndex, |
| 277 onlyForRti: onlyForRti, | 283 onlyForRti: onlyForRti, |
| 278 isDirectlyInstantiated: isDirectlyInstantiated, | 284 isDirectlyInstantiated: isDirectlyInstantiated, |
| 279 isNative: false); | 285 isNative: false); |
| 280 | 286 |
| 281 bool get isMixinApplication => true; | 287 bool get isMixinApplication => true; |
| 282 Class get mixinClass => _mixinClass; | 288 Class get mixinClass => _mixinClass; |
| 283 | 289 |
| 284 void setMixinClass(Class mixinClass) { | 290 void setMixinClass(Class mixinClass) { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 tearOffName : tearOffName, | 440 tearOffName : tearOffName, |
| 435 canBeApplied : canBeApplied, | 441 canBeApplied : canBeApplied, |
| 436 canBeReflected : canBeReflected); | 442 canBeReflected : canBeReflected); |
| 437 } | 443 } |
| 438 | 444 |
| 439 class StaticStubMethod extends StubMethod implements StaticMethod { | 445 class StaticStubMethod extends StubMethod implements StaticMethod { |
| 440 Holder holder; | 446 Holder holder; |
| 441 StaticStubMethod(String name, this.holder, js.Expression code) | 447 StaticStubMethod(String name, this.holder, js.Expression code) |
| 442 : super(name, code); | 448 : super(name, code); |
| 443 } | 449 } |
| OLD | NEW |