| 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, Statement, Name, Literal, | 7 import '../js/js.dart' as js show Expression, Statement, Name, Literal, |
| 8 TokenFinalizer; | 8 TokenFinalizer; |
| 9 import '../constants/values.dart' show ConstantValue; | 9 import '../constants/values.dart' show ConstantValue; |
| 10 | 10 |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 /// The element should only be used during the transition to the new model. | 219 /// The element should only be used during the transition to the new model. |
| 220 /// Uses indicate missing information in the model. | 220 /// Uses indicate missing information in the model. |
| 221 final Element element; | 221 final Element element; |
| 222 | 222 |
| 223 final js.Name name; | 223 final js.Name name; |
| 224 final Holder holder; | 224 final Holder holder; |
| 225 Class _superclass; | 225 Class _superclass; |
| 226 final List<Method> methods; | 226 final List<Method> methods; |
| 227 final List<Field> fields; | 227 final List<Field> fields; |
| 228 final List<StubMethod> isChecks; | 228 final List<StubMethod> isChecks; |
| 229 final List<StubMethod> checkedSetters; |
| 229 | 230 |
| 230 /// Stub methods for this class that are call stubs for getters. | 231 /// Stub methods for this class that are call stubs for getters. |
| 231 final List<StubMethod> callStubs; | 232 final List<StubMethod> callStubs; |
| 232 | 233 |
| 233 /// Stub methods for this class handling reads to type variables. | 234 /// Stub methods for this class handling reads to type variables. |
| 234 final List<StubMethod> typeVariableReaderStubs; | 235 final List<StubMethod> typeVariableReaderStubs; |
| 235 | 236 |
| 236 /// noSuchMethod stubs in the special case that the class is Object. | 237 /// noSuchMethod stubs in the special case that the class is Object. |
| 237 final List<StubMethod> noSuchMethodStubs; | 238 final List<StubMethod> noSuchMethodStubs; |
| 238 final List<Field> staticFieldsForReflection; | 239 final List<Field> staticFieldsForReflection; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 256 /// Native extensions. See [NativeEmitter.prepareNativeClasses]. | 257 /// Native extensions. See [NativeEmitter.prepareNativeClasses]. |
| 257 List<Class> nativeExtensions; | 258 List<Class> nativeExtensions; |
| 258 | 259 |
| 259 Class(this.element, this.name, this.holder, | 260 Class(this.element, this.name, this.holder, |
| 260 this.methods, | 261 this.methods, |
| 261 this.fields, | 262 this.fields, |
| 262 this.staticFieldsForReflection, | 263 this.staticFieldsForReflection, |
| 263 this.callStubs, | 264 this.callStubs, |
| 264 this.typeVariableReaderStubs, | 265 this.typeVariableReaderStubs, |
| 265 this.noSuchMethodStubs, | 266 this.noSuchMethodStubs, |
| 267 this.checkedSetters, |
| 266 this.isChecks, | 268 this.isChecks, |
| 267 this.functionTypeIndex, | 269 this.functionTypeIndex, |
| 268 {this.onlyForRti, | 270 {this.onlyForRti, |
| 269 this.isDirectlyInstantiated, | 271 this.isDirectlyInstantiated, |
| 270 this.isNative}) { | 272 this.isNative}) { |
| 271 assert(onlyForRti != null); | 273 assert(onlyForRti != null); |
| 272 assert(isDirectlyInstantiated != null); | 274 assert(isDirectlyInstantiated != null); |
| 273 assert(isNative != null); | 275 assert(isNative != null); |
| 274 } | 276 } |
| 275 | 277 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 288 } | 290 } |
| 289 | 291 |
| 290 class MixinApplication extends Class { | 292 class MixinApplication extends Class { |
| 291 Class _mixinClass; | 293 Class _mixinClass; |
| 292 | 294 |
| 293 MixinApplication(Element element, js.Name name, Holder holder, | 295 MixinApplication(Element element, js.Name name, Holder holder, |
| 294 List<Field> instanceFields, | 296 List<Field> instanceFields, |
| 295 List<Field> staticFieldsForReflection, | 297 List<Field> staticFieldsForReflection, |
| 296 List<StubMethod> callStubs, | 298 List<StubMethod> callStubs, |
| 297 List<StubMethod> typeVariableReaderStubs, | 299 List<StubMethod> typeVariableReaderStubs, |
| 300 List<StubMethod> checkedSetters, |
| 298 List<StubMethod> isChecks, | 301 List<StubMethod> isChecks, |
| 299 js.Expression functionTypeIndex, | 302 js.Expression functionTypeIndex, |
| 300 {bool onlyForRti, | 303 {bool onlyForRti, |
| 301 bool isDirectlyInstantiated}) | 304 bool isDirectlyInstantiated}) |
| 302 : super(element, | 305 : super(element, |
| 303 name, holder, | 306 name, holder, |
| 304 const <Method>[], | 307 const <Method>[], |
| 305 instanceFields, | 308 instanceFields, |
| 306 staticFieldsForReflection, | 309 staticFieldsForReflection, |
| 307 callStubs, | 310 callStubs, |
| 308 typeVariableReaderStubs, | 311 typeVariableReaderStubs, |
| 309 const <StubMethod>[], | 312 const <StubMethod>[], |
| 310 isChecks, functionTypeIndex, | 313 checkedSetters, |
| 314 isChecks, |
| 315 functionTypeIndex, |
| 311 onlyForRti: onlyForRti, | 316 onlyForRti: onlyForRti, |
| 312 isDirectlyInstantiated: isDirectlyInstantiated, | 317 isDirectlyInstantiated: isDirectlyInstantiated, |
| 313 isNative: false); | 318 isNative: false); |
| 314 | 319 |
| 315 bool get isMixinApplication => true; | 320 bool get isMixinApplication => true; |
| 316 Class get mixinClass => _mixinClass; | 321 Class get mixinClass => _mixinClass; |
| 317 | 322 |
| 318 void setMixinClass(Class mixinClass) { | 323 void setMixinClass(Class mixinClass) { |
| 319 _mixinClass = mixinClass; | 324 _mixinClass = mixinClass; |
| 320 } | 325 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 requiredParameterCount: requiredParameterCount, | 500 requiredParameterCount: requiredParameterCount, |
| 496 optionalParameterDefaultValues: optionalParameterDefaultValues, | 501 optionalParameterDefaultValues: optionalParameterDefaultValues, |
| 497 functionType: functionType); | 502 functionType: functionType); |
| 498 } | 503 } |
| 499 | 504 |
| 500 class StaticStubMethod extends StubMethod implements StaticMethod { | 505 class StaticStubMethod extends StubMethod implements StaticMethod { |
| 501 Holder holder; | 506 Holder holder; |
| 502 StaticStubMethod(js.Name name, this.holder, js.Expression code) | 507 StaticStubMethod(js.Name name, this.holder, js.Expression code) |
| 503 : super(name, code); | 508 : super(name, code); |
| 504 } | 509 } |
| OLD | NEW |