| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 add(new ir.InvokeContinuation(state.returnContinuation, [constant])); | 848 add(new ir.InvokeContinuation(state.returnContinuation, [constant])); |
| 849 _current = null; | 849 _current = null; |
| 850 } | 850 } |
| 851 | 851 |
| 852 /// Create a [ir.FunctionDefinition] using [root] as the body. | 852 /// Create a [ir.FunctionDefinition] using [root] as the body. |
| 853 /// | 853 /// |
| 854 /// The protocol for building a function is: | 854 /// The protocol for building a function is: |
| 855 /// 1. Call [buildFunctionHeader]. | 855 /// 1. Call [buildFunctionHeader]. |
| 856 /// 2. Call `buildXXX` methods to build the body. | 856 /// 2. Call `buildXXX` methods to build the body. |
| 857 /// 3. Call [makeFunctionDefinition] to finish. | 857 /// 3. Call [makeFunctionDefinition] to finish. |
| 858 ir.FunctionDefinition makeFunctionDefinition() { | 858 ir.FunctionDefinition makeFunctionDefinition( |
| 859 SourceInformation sourceInformation) { |
| 859 _ensureReturn(); | 860 _ensureReturn(); |
| 860 return new ir.FunctionDefinition( | 861 return new ir.FunctionDefinition( |
| 861 state.currentElement, | 862 state.currentElement, |
| 862 state.thisParameter, | 863 state.thisParameter, |
| 863 state.functionParameters, | 864 state.functionParameters, |
| 864 state.returnContinuation, | 865 state.returnContinuation, |
| 865 root); | 866 root, |
| 867 sourceInformation: sourceInformation); |
| 866 } | 868 } |
| 867 | 869 |
| 868 /// Create a invocation of the [method] on the super class where the call | 870 /// Create a invocation of the [method] on the super class where the call |
| 869 /// structure is defined [callStructure] and the argument values are defined | 871 /// structure is defined [callStructure] and the argument values are defined |
| 870 /// by [arguments]. | 872 /// by [arguments]. |
| 871 ir.Primitive buildSuperMethodInvocation( | 873 ir.Primitive buildSuperMethodInvocation( |
| 872 MethodElement method, | 874 MethodElement method, |
| 873 CallStructure callStructure, | 875 CallStructure callStructure, |
| 874 List<ir.Primitive> arguments, | 876 List<ir.Primitive> arguments, |
| 875 {SourceInformation sourceInformation}) { | 877 {SourceInformation sourceInformation}) { |
| (...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2937 this.stackTraceVariable, | 2939 this.stackTraceVariable, |
| 2938 this.buildCatchBlock}); | 2940 this.buildCatchBlock}); |
| 2939 } | 2941 } |
| 2940 | 2942 |
| 2941 class SwitchCaseInfo { | 2943 class SwitchCaseInfo { |
| 2942 final SubbuildFunction buildCondition; | 2944 final SubbuildFunction buildCondition; |
| 2943 final SubbuildFunction buildBody; | 2945 final SubbuildFunction buildBody; |
| 2944 | 2946 |
| 2945 SwitchCaseInfo(this.buildCondition, this.buildBody); | 2947 SwitchCaseInfo(this.buildCondition, this.buildBody); |
| 2946 } | 2948 } |
| OLD | NEW |