| 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 closurelib; | 7 import '../closure.dart' as closurelib; |
| 8 import '../closure.dart' hide ClosureScope; | 8 import '../closure.dart' hide ClosureScope; |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 translateDynamicArguments(arguments, callStructure)); | 1050 translateDynamicArguments(arguments, callStructure)); |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 @override | 1053 @override |
| 1054 ir.Primitive handleStaticFieldInvoke( | 1054 ir.Primitive handleStaticFieldInvoke( |
| 1055 ast.Send node, | 1055 ast.Send node, |
| 1056 FieldElement field, | 1056 FieldElement field, |
| 1057 ast.NodeList arguments, | 1057 ast.NodeList arguments, |
| 1058 CallStructure callStructure, | 1058 CallStructure callStructure, |
| 1059 _) { | 1059 _) { |
| 1060 return irBuilder.buildStaticFieldInvocation(field, callStructure, | 1060 ir.Primitive target = irBuilder.buildStaticFieldGet(field); |
| 1061 return irBuilder.buildCallInvocation(target, |
| 1062 callStructure, |
| 1061 translateDynamicArguments(arguments, callStructure)); | 1063 translateDynamicArguments(arguments, callStructure)); |
| 1062 } | 1064 } |
| 1063 | 1065 |
| 1064 @override | 1066 @override |
| 1065 ir.Primitive handleStaticFunctionInvoke( | 1067 ir.Primitive handleStaticFunctionInvoke( |
| 1066 ast.Send node, | 1068 ast.Send node, |
| 1067 MethodElement function, | 1069 MethodElement function, |
| 1068 ast.NodeList arguments, | 1070 ast.NodeList arguments, |
| 1069 CallStructure callStructure, | 1071 CallStructure callStructure, |
| 1070 _) { | 1072 _) { |
| 1071 // TODO(karlklose): support foreign functions. | 1073 // TODO(karlklose): support foreign functions. |
| 1072 if (function.isForeign(compiler.backend)) { | 1074 if (function.isForeign(compiler.backend)) { |
| 1073 return giveup(node, 'handleStaticFunctionInvoke: foreign: $function'); | 1075 return giveup(node, 'handleStaticFunctionInvoke: foreign: $function'); |
| 1074 } | 1076 } |
| 1075 return irBuilder.buildStaticFunctionInvocation(function, callStructure, | 1077 return irBuilder.buildStaticFunctionInvocation(function, callStructure, |
| 1076 translateStaticArguments(arguments, function, callStructure), | 1078 translateStaticArguments(arguments, function, callStructure), |
| 1077 sourceInformation: sourceInformationBuilder.buildCall(node)); | 1079 sourceInformation: sourceInformationBuilder.buildCall(node)); |
| 1078 } | 1080 } |
| 1079 | 1081 |
| 1080 @override | 1082 @override |
| 1081 ir.Primitive handleStaticGetterInvoke( | 1083 ir.Primitive handleStaticGetterInvoke( |
| 1082 ast.Send node, | 1084 ast.Send node, |
| 1083 FunctionElement getter, | 1085 FunctionElement getter, |
| 1084 ast.NodeList arguments, | 1086 ast.NodeList arguments, |
| 1085 CallStructure callStructure, | 1087 CallStructure callStructure, |
| 1086 _) { | 1088 _) { |
| 1087 return irBuilder.buildStaticGetterInvocation(getter, callStructure, | 1089 ir.Primitive target = irBuilder.buildStaticGetterGet(getter); |
| 1090 return irBuilder.buildCallInvocation(target, |
| 1091 callStructure, |
| 1088 translateDynamicArguments(arguments, callStructure)); | 1092 translateDynamicArguments(arguments, callStructure)); |
| 1089 } | 1093 } |
| 1090 | 1094 |
| 1091 @override | 1095 @override |
| 1092 ir.Primitive visitSuperFieldInvoke( | 1096 ir.Primitive visitSuperFieldInvoke( |
| 1093 ast.Send node, | 1097 ast.Send node, |
| 1094 FieldElement field, | 1098 FieldElement field, |
| 1095 ast.NodeList arguments, | 1099 ast.NodeList arguments, |
| 1096 CallStructure callStructure, | 1100 CallStructure callStructure, |
| 1097 _) { | 1101 _) { |
| 1098 return irBuilder.buildSuperFieldInvocation(field, callStructure, | 1102 ir.Primitive target = irBuilder.buildSuperFieldGet(field); |
| 1103 return irBuilder.buildCallInvocation(target, |
| 1104 callStructure, |
| 1099 translateDynamicArguments(arguments, callStructure)); | 1105 translateDynamicArguments(arguments, callStructure)); |
| 1100 } | 1106 } |
| 1101 | 1107 |
| 1102 @override | 1108 @override |
| 1103 ir.Primitive visitSuperGetterInvoke( | 1109 ir.Primitive visitSuperGetterInvoke( |
| 1104 ast.Send node, | 1110 ast.Send node, |
| 1105 FunctionElement getter, | 1111 FunctionElement getter, |
| 1106 ast.NodeList arguments, | 1112 ast.NodeList arguments, |
| 1107 CallStructure callStructure, | 1113 CallStructure callStructure, |
| 1108 _) { | 1114 _) { |
| 1109 return irBuilder.buildSuperGetterInvocation(getter, callStructure, | 1115 ir.Primitive target = irBuilder.buildSuperGetterGet(getter); |
| 1116 return irBuilder.buildCallInvocation(target, |
| 1117 callStructure, |
| 1110 translateDynamicArguments(arguments, callStructure)); | 1118 translateDynamicArguments(arguments, callStructure)); |
| 1111 } | 1119 } |
| 1112 | 1120 |
| 1113 @override | 1121 @override |
| 1114 ir.Primitive visitSuperMethodInvoke( | 1122 ir.Primitive visitSuperMethodInvoke( |
| 1115 ast.Send node, | 1123 ast.Send node, |
| 1116 MethodElement method, | 1124 MethodElement method, |
| 1117 ast.NodeList arguments, | 1125 ast.NodeList arguments, |
| 1118 CallStructure callStructure, | 1126 CallStructure callStructure, |
| 1119 _) { | 1127 _) { |
| (...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2757 SourceInformation buildCall(ast.Node node) { | 2765 SourceInformation buildCall(ast.Node node) { |
| 2758 return new PositionSourceInformation( | 2766 return new PositionSourceInformation( |
| 2759 new TokenSourceLocation(sourceFile, node.getBeginToken(), name)); | 2767 new TokenSourceLocation(sourceFile, node.getBeginToken(), name)); |
| 2760 } | 2768 } |
| 2761 | 2769 |
| 2762 @override | 2770 @override |
| 2763 SourceInformationBuilder forContext(AstElement element) { | 2771 SourceInformationBuilder forContext(AstElement element) { |
| 2764 return new PositionSourceInformationBuilder(element); | 2772 return new PositionSourceInformationBuilder(element); |
| 2765 } | 2773 } |
| 2766 } | 2774 } |
| OLD | NEW |