| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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.ir_builder_task; | 5 library dart2js.ir_builder_task; |
| 6 | 6 |
| 7 import '../closure.dart' as closure; | 7 import '../closure.dart' as closure; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/names.dart' show | 9 import '../common/names.dart' show |
| 10 Names, | 10 Names, |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 423 |
| 424 // -- Load values for type variables declared on super classes -- | 424 // -- Load values for type variables declared on super classes -- |
| 425 // Field initializers for super classes can reference these, so they | 425 // Field initializers for super classes can reference these, so they |
| 426 // must be available before evaluating field initializers. | 426 // must be available before evaluating field initializers. |
| 427 // This could be interleaved with field initialization, but we choose do | 427 // This could be interleaved with field initialization, but we choose do |
| 428 // get it out of the way here to avoid complications with mixins. | 428 // get it out of the way here to avoid complications with mixins. |
| 429 loadTypeVariablesForSuperClasses(classElement); | 429 loadTypeVariablesForSuperClasses(classElement); |
| 430 | 430 |
| 431 /// Maps each field from this class or a superclass to its initial value. | 431 /// Maps each field from this class or a superclass to its initial value. |
| 432 Map<FieldElement, ir.Primitive> fieldValues = | 432 Map<FieldElement, ir.Primitive> fieldValues = |
| 433 <FieldElement, ir.Primitive>{}; | 433 <FieldElement, ir.Primitive>{}; |
| 434 | 434 |
| 435 // -- Evaluate field initializers --- | 435 // -- Evaluate field initializers --- |
| 436 // Evaluate field initializers in constructor and super constructors. | 436 // Evaluate field initializers in constructor and super constructors. |
| 437 List<ConstructorElement> constructorList = <ConstructorElement>[]; | 437 List<ConstructorElement> constructorList = <ConstructorElement>[]; |
| 438 evaluateConstructorFieldInitializers( | 438 evaluateConstructorFieldInitializers( |
| 439 constructor, constructorList, fieldValues); | 439 constructor, constructorList, fieldValues); |
| 440 | 440 |
| 441 // All parameters in all constructors are now bound in the environment. | 441 // All parameters in all constructors are now bound in the environment. |
| 442 // BoxLocals for captured parameters are also in the environment. | 442 // BoxLocals for captured parameters are also in the environment. |
| 443 // The initial value of all fields are now bound in [fieldValues]. | 443 // The initial value of all fields are now bound in [fieldValues]. |
| (...skipping 3456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3900 } | 3900 } |
| 3901 | 3901 |
| 3902 Element get closureConverter { | 3902 Element get closureConverter { |
| 3903 return _backend.helpers.closureConverter; | 3903 return _backend.helpers.closureConverter; |
| 3904 } | 3904 } |
| 3905 | 3905 |
| 3906 void addNativeMethod(FunctionElement function) { | 3906 void addNativeMethod(FunctionElement function) { |
| 3907 _backend.emitter.nativeEmitter.nativeMethods.add(function); | 3907 _backend.emitter.nativeEmitter.nativeMethods.add(function); |
| 3908 } | 3908 } |
| 3909 } | 3909 } |
| OLD | NEW |