| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 classElement.typeVariables.forEach((TypeVariableType variable) { | 403 classElement.typeVariables.forEach((TypeVariableType variable) { |
| 404 irBuilder.declareTypeVariable(variable, const DynamicType()); | 404 irBuilder.declareTypeVariable(variable, const DynamicType()); |
| 405 }); | 405 }); |
| 406 } | 406 } |
| 407 | 407 |
| 408 // Create IR parameters and setup the environment. | 408 // Create IR parameters and setup the environment. |
| 409 List<ir.Parameter> irParameters = builder.buildFunctionHeader(parameters, | 409 List<ir.Parameter> irParameters = builder.buildFunctionHeader(parameters, |
| 410 closureScope: getClosureScopeForFunction(constructor)); | 410 closureScope: getClosureScopeForFunction(constructor)); |
| 411 | 411 |
| 412 // Create a list of the values of all type argument parameters, if any. | 412 // Create a list of the values of all type argument parameters, if any. |
| 413 List<ir.Primitive> typeInformation; | 413 ir.Primitive typeInformation; |
| 414 if (requiresTypeInformation) { | 414 if (requiresTypeInformation) { |
| 415 typeInformation = irParameters.sublist(firstTypeArgumentParameterIndex); | 415 typeInformation = new ir.TypeExpression( |
| 416 classElement.thisType, |
| 417 irParameters.sublist(firstTypeArgumentParameterIndex), |
| 418 true); |
| 419 irBuilder.add(new ir.LetPrim(typeInformation)); |
| 416 } else { | 420 } else { |
| 417 typeInformation = const <ir.Primitive>[]; | 421 typeInformation = null; |
| 418 } | 422 } |
| 419 | 423 |
| 420 // -- Load values for type variables declared on super classes -- | 424 // -- Load values for type variables declared on super classes -- |
| 421 // Field initializers for super classes can reference these, so they | 425 // Field initializers for super classes can reference these, so they |
| 422 // must be available before evaluating field initializers. | 426 // must be available before evaluating field initializers. |
| 423 // This could be interleaved with field initialization, but we choose do | 427 // This could be interleaved with field initialization, but we choose do |
| 424 // 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. |
| 425 loadTypeVariablesForSuperClasses(classElement); | 429 loadTypeVariablesForSuperClasses(classElement); |
| 426 | 430 |
| 427 /// 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. |
| (...skipping 3165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3593 } | 3597 } |
| 3594 | 3598 |
| 3595 Element get closureConverter { | 3599 Element get closureConverter { |
| 3596 return _backend.helpers.closureConverter; | 3600 return _backend.helpers.closureConverter; |
| 3597 } | 3601 } |
| 3598 | 3602 |
| 3599 void addNativeMethod(FunctionElement function) { | 3603 void addNativeMethod(FunctionElement function) { |
| 3600 _backend.emitter.nativeEmitter.nativeMethods.add(function); | 3604 _backend.emitter.nativeEmitter.nativeMethods.add(function); |
| 3601 } | 3605 } |
| 3602 } | 3606 } |
| OLD | NEW |