| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 /// Uses indicate missing information in the model. | 199 /// Uses indicate missing information in the model. |
| 200 final Element element; | 200 final Element element; |
| 201 | 201 |
| 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 either call stubs for getters or | 209 /// Stub methods for this class that are call stubs for getters. |
| 210 final List<StubMethod> callStubs; |
| 211 |
| 210 /// noSuchMethod stubs in the special case that the class is Object. | 212 /// noSuchMethod stubs in the special case that the class is Object. |
| 211 final List<StubMethod> stubs; | 213 final List<StubMethod> noSuchMethodStubs; |
| 212 final List<Field> staticFieldsForReflection; | 214 final List<Field> staticFieldsForReflection; |
| 213 final bool onlyForRti; | 215 final bool onlyForRti; |
| 214 final bool isDirectlyInstantiated; | 216 final bool isDirectlyInstantiated; |
| 215 final bool isNative; | 217 final bool isNative; |
| 216 | 218 |
| 217 // If the class implements a function type, and the type is encoded in the | 219 // If the class implements a function type, and the type is encoded in the |
| 218 // metatada table, then this field contains the index into that field. | 220 // metatada table, then this field contains the index into that field. |
| 219 final int functionTypeIndex; | 221 final int functionTypeIndex; |
| 220 | 222 |
| 221 /// Whether the class must be evaluated eagerly. | 223 /// Whether the class must be evaluated eagerly. |
| 222 bool isEager = false; | 224 bool isEager = false; |
| 223 | 225 |
| 224 /// Data that must be emitted with the class for native interop. | 226 /// Data that must be emitted with the class for native interop. |
| 225 String nativeInfo; | 227 String nativeInfo; |
| 226 | 228 |
| 227 Class(this.element, this.name, this.holder, | 229 Class(this.element, this.name, this.holder, |
| 228 this.methods, | 230 this.methods, |
| 229 this.fields, | 231 this.fields, |
| 230 this.staticFieldsForReflection, | 232 this.staticFieldsForReflection, |
| 231 this.stubs, | 233 this.callStubs, |
| 234 this.noSuchMethodStubs, |
| 232 this.isChecks, | 235 this.isChecks, |
| 233 this.functionTypeIndex, | 236 this.functionTypeIndex, |
| 234 {this.onlyForRti, | 237 {this.onlyForRti, |
| 235 this.isDirectlyInstantiated, | 238 this.isDirectlyInstantiated, |
| 236 this.isNative}) { | 239 this.isNative}) { |
| 237 assert(onlyForRti != null); | 240 assert(onlyForRti != null); |
| 238 assert(isDirectlyInstantiated != null); | 241 assert(isDirectlyInstantiated != null); |
| 239 assert(isNative != null); | 242 assert(isNative != null); |
| 240 } | 243 } |
| 241 | 244 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 262 List<StubMethod> isChecks, | 265 List<StubMethod> isChecks, |
| 263 int functionTypeIndex, | 266 int functionTypeIndex, |
| 264 {bool onlyForRti, | 267 {bool onlyForRti, |
| 265 bool isDirectlyInstantiated}) | 268 bool isDirectlyInstantiated}) |
| 266 : super(element, | 269 : super(element, |
| 267 name, holder, | 270 name, holder, |
| 268 const <Method>[], | 271 const <Method>[], |
| 269 instanceFields, | 272 instanceFields, |
| 270 staticFieldsForReflection, | 273 staticFieldsForReflection, |
| 271 callStubs, | 274 callStubs, |
| 275 const <StubMethod>[], |
| 272 isChecks, functionTypeIndex, | 276 isChecks, functionTypeIndex, |
| 273 onlyForRti: onlyForRti, | 277 onlyForRti: onlyForRti, |
| 274 isDirectlyInstantiated: isDirectlyInstantiated, | 278 isDirectlyInstantiated: isDirectlyInstantiated, |
| 275 isNative: false); | 279 isNative: false); |
| 276 | 280 |
| 277 bool get isMixinApplication => true; | 281 bool get isMixinApplication => true; |
| 278 Class get mixinClass => _mixinClass; | 282 Class get mixinClass => _mixinClass; |
| 279 | 283 |
| 280 void setMixinClass(Class mixinClass) { | 284 void setMixinClass(Class mixinClass) { |
| 281 _mixinClass = mixinClass; | 285 _mixinClass = mixinClass; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 tearOffName : tearOffName, | 433 tearOffName : tearOffName, |
| 430 canBeApplied : canBeApplied, | 434 canBeApplied : canBeApplied, |
| 431 canBeReflected : canBeReflected); | 435 canBeReflected : canBeReflected); |
| 432 } | 436 } |
| 433 | 437 |
| 434 class StaticStubMethod extends StubMethod implements StaticMethod { | 438 class StaticStubMethod extends StubMethod implements StaticMethod { |
| 435 Holder holder; | 439 Holder holder; |
| 436 StaticStubMethod(String name, this.holder, js.Expression code) | 440 StaticStubMethod(String name, this.holder, js.Expression code) |
| 437 : super(name, code); | 441 : super(name, code); |
| 438 } | 442 } |
| OLD | NEW |