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 '../constants/values.dart' show ConstantValue; | 7 import '../constants/values.dart' show ConstantValue; |
8 import '../deferred_load.dart' show OutputUnit; | 8 import '../deferred_load.dart' show OutputUnit; |
9 import '../elements/entities.dart'; | 9 import '../elements/entities.dart'; |
10 import '../js/js.dart' as js show Expression, Name, Statement, TokenFinalizer; | 10 import '../js/js.dart' as js show Expression, Name, Statement, TokenFinalizer; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 /// Stub methods for this class that are call stubs for getters. | 223 /// Stub methods for this class that are call stubs for getters. |
224 final List<StubMethod> callStubs; | 224 final List<StubMethod> callStubs; |
225 | 225 |
226 /// noSuchMethod stubs in the special case that the class is Object. | 226 /// noSuchMethod stubs in the special case that the class is Object. |
227 final List<StubMethod> noSuchMethodStubs; | 227 final List<StubMethod> noSuchMethodStubs; |
228 final List<Field> staticFieldsForReflection; | 228 final List<Field> staticFieldsForReflection; |
229 final bool hasRtiField; // Per-instance runtime type information pseudo-field. | 229 final bool hasRtiField; // Per-instance runtime type information pseudo-field. |
230 final bool onlyForRti; | 230 final bool onlyForRti; |
231 final bool isDirectlyInstantiated; | 231 final bool isDirectlyInstantiated; |
232 final bool isNative; | 232 final bool isNative; |
| 233 final bool isClosureBaseClass; // Common base class for closures. |
233 | 234 |
234 // If the class implements a function type, and the type is encoded in the | 235 // If the class implements a function type, and the type is encoded in the |
235 // metatada table, then this field contains the index into that field. | 236 // metatada table, then this field contains the index into that field. |
236 final js.Expression functionTypeIndex; | 237 final js.Expression functionTypeIndex; |
237 | 238 |
238 /// Whether the class must be evaluated eagerly. | 239 /// Whether the class must be evaluated eagerly. |
239 bool isEager = false; | 240 bool isEager = false; |
240 | 241 |
241 /// Leaf tags. See [NativeEmitter.prepareNativeClasses]. | 242 /// Leaf tags. See [NativeEmitter.prepareNativeClasses]. |
242 List<String> nativeLeafTags; | 243 List<String> nativeLeafTags; |
(...skipping 12 matching lines...) Expand all Loading... |
255 this.fields, | 256 this.fields, |
256 this.staticFieldsForReflection, | 257 this.staticFieldsForReflection, |
257 this.callStubs, | 258 this.callStubs, |
258 this.noSuchMethodStubs, | 259 this.noSuchMethodStubs, |
259 this.checkedSetters, | 260 this.checkedSetters, |
260 this.isChecks, | 261 this.isChecks, |
261 this.functionTypeIndex, | 262 this.functionTypeIndex, |
262 {this.hasRtiField, | 263 {this.hasRtiField, |
263 this.onlyForRti, | 264 this.onlyForRti, |
264 this.isDirectlyInstantiated, | 265 this.isDirectlyInstantiated, |
265 this.isNative}) { | 266 this.isNative, |
| 267 this.isClosureBaseClass}) { |
266 assert(onlyForRti != null); | 268 assert(onlyForRti != null); |
267 assert(isDirectlyInstantiated != null); | 269 assert(isDirectlyInstantiated != null); |
268 assert(isNative != null); | 270 assert(isNative != null); |
| 271 assert(isClosureBaseClass != null); |
269 } | 272 } |
270 | 273 |
271 bool get isMixinApplication => false; | 274 bool get isMixinApplication => false; |
272 Class get superclass => _superclass; | 275 Class get superclass => _superclass; |
273 | 276 |
274 void setSuperclass(Class superclass) { | 277 void setSuperclass(Class superclass) { |
275 _superclass = superclass; | 278 _superclass = superclass; |
276 } | 279 } |
277 | 280 |
278 js.Name get superclassName => superclass == null ? null : superclass.name; | 281 js.Name get superclassName => superclass == null ? null : superclass.name; |
(...skipping 26 matching lines...) Expand all Loading... |
305 instanceFields, | 308 instanceFields, |
306 staticFieldsForReflection, | 309 staticFieldsForReflection, |
307 callStubs, | 310 callStubs, |
308 const <StubMethod>[], | 311 const <StubMethod>[], |
309 checkedSetters, | 312 checkedSetters, |
310 isChecks, | 313 isChecks, |
311 functionTypeIndex, | 314 functionTypeIndex, |
312 hasRtiField: hasRtiField, | 315 hasRtiField: hasRtiField, |
313 onlyForRti: onlyForRti, | 316 onlyForRti: onlyForRti, |
314 isDirectlyInstantiated: isDirectlyInstantiated, | 317 isDirectlyInstantiated: isDirectlyInstantiated, |
315 isNative: false); | 318 isNative: false, |
| 319 isClosureBaseClass: false); |
316 | 320 |
317 bool get isMixinApplication => true; | 321 bool get isMixinApplication => true; |
318 Class get mixinClass => _mixinClass; | 322 Class get mixinClass => _mixinClass; |
319 | 323 |
320 void setMixinClass(Class mixinClass) { | 324 void setMixinClass(Class mixinClass) { |
321 _mixinClass = mixinClass; | 325 _mixinClass = mixinClass; |
322 } | 326 } |
323 } | 327 } |
324 | 328 |
325 /// A field. | 329 /// A field. |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 functionType: functionType); | 527 functionType: functionType); |
524 | 528 |
525 bool get isStatic => true; | 529 bool get isStatic => true; |
526 } | 530 } |
527 | 531 |
528 class StaticStubMethod extends StubMethod implements StaticMethod { | 532 class StaticStubMethod extends StubMethod implements StaticMethod { |
529 Holder holder; | 533 Holder holder; |
530 StaticStubMethod(js.Name name, this.holder, js.Expression code) | 534 StaticStubMethod(js.Name name, this.holder, js.Expression code) |
531 : super(name, code); | 535 : super(name, code); |
532 } | 536 } |
OLD | NEW |