| 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; | 5 library dart2js.ir_builder; |
| 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 2393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 value = buildThis(); | 2404 value = buildThis(); |
| 2405 } else if (field.local is closure.TypeVariableLocal) { | 2405 } else if (field.local is closure.TypeVariableLocal) { |
| 2406 closure.TypeVariableLocal variable = field.local; | 2406 closure.TypeVariableLocal variable = field.local; |
| 2407 value = buildTypeVariableAccess(variable.typeVariable); | 2407 value = buildTypeVariableAccess(variable.typeVariable); |
| 2408 } else { | 2408 } else { |
| 2409 value = environment.lookup(field.local); | 2409 value = environment.lookup(field.local); |
| 2410 } | 2410 } |
| 2411 arguments.add(value); | 2411 arguments.add(value); |
| 2412 } | 2412 } |
| 2413 return addPrimitive(new ir.CreateInstance( | 2413 return addPrimitive(new ir.CreateInstance( |
| 2414 classElement, arguments, const <ir.Primitive>[], sourceInformation)); | 2414 classElement.rawType, arguments, const <ir.Primitive>[], |
| 2415 sourceInformation)); |
| 2415 } | 2416 } |
| 2416 | 2417 |
| 2417 /// Create a read access of [local] function, variable, or parameter. | 2418 /// Create a read access of [local] function, variable, or parameter. |
| 2418 ir.Primitive buildLocalGet(LocalElement local) { | 2419 ir.Primitive buildLocalGet(LocalElement local) { |
| 2419 assert(isOpen); | 2420 assert(isOpen); |
| 2420 ClosureLocation location = state.boxedVariables[local]; | 2421 ClosureLocation location = state.boxedVariables[local]; |
| 2421 if (location != null) { | 2422 if (location != null) { |
| 2422 ir.Primitive result = new ir.GetField(environment.lookup(location.box), | 2423 ir.Primitive result = new ir.GetField(environment.lookup(location.box), |
| 2423 location.field); | 2424 location.field); |
| 2424 result.useElementAsHint(local); | 2425 result.useElementAsHint(local); |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2834 } | 2835 } |
| 2835 | 2836 |
| 2836 class SwitchCaseInfo { | 2837 class SwitchCaseInfo { |
| 2837 final List<ir.Primitive> constants = <ir.Primitive>[]; | 2838 final List<ir.Primitive> constants = <ir.Primitive>[]; |
| 2838 final SubbuildFunction buildBody; | 2839 final SubbuildFunction buildBody; |
| 2839 | 2840 |
| 2840 SwitchCaseInfo(this.buildBody); | 2841 SwitchCaseInfo(this.buildBody); |
| 2841 | 2842 |
| 2842 void addConstant(ir.Primitive constant) => constants.add(constant); | 2843 void addConstant(ir.Primitive constant) => constants.add(constant); |
| 2843 } | 2844 } |
| OLD | NEW |