OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
6 import 'package:kernel/frontend/accessors.dart' | 6 import 'package:kernel/frontend/accessors.dart' |
7 show | 7 show |
8 Accessor, | 8 Accessor, |
9 IndexAccessor, | 9 IndexAccessor, |
10 NullAwarePropertyAccessor, | 10 NullAwarePropertyAccessor, |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1233 if (type.isGeneric) { | 1233 if (type.isGeneric) { |
1234 invoke.arguments.types.addAll(kernel.typesToIr(type.typeArguments)); | 1234 invoke.arguments.types.addAll(kernel.typesToIr(type.typeArguments)); |
1235 } | 1235 } |
1236 } | 1236 } |
1237 return invoke; | 1237 return invoke; |
1238 } | 1238 } |
1239 | 1239 |
1240 @override | 1240 @override |
1241 ir.InvocationExpression visitBoolFromEnvironmentConstructorInvoke( | 1241 ir.InvocationExpression visitBoolFromEnvironmentConstructorInvoke( |
1242 NewExpression node, BoolFromEnvironmentConstantExpression constant, _) { | 1242 NewExpression node, BoolFromEnvironmentConstantExpression constant, _) { |
1243 return buildConstructorInvoke(node, isConst: true); | 1243 return associateNode(buildConstructorInvoke(node, isConst: true), node); |
1244 } | 1244 } |
1245 | 1245 |
1246 ir.TypeLiteral buildTypeLiteral(TypeConstantExpression constant) { | 1246 ir.TypeLiteral buildTypeLiteral(TypeConstantExpression constant) { |
1247 return new ir.TypeLiteral(kernel.typeLiteralToIr(constant)); | 1247 return new ir.TypeLiteral(kernel.typeLiteralToIr(constant)); |
1248 } | 1248 } |
1249 | 1249 |
1250 @override | 1250 @override |
1251 ir.Expression visitClassTypeLiteralGet( | 1251 ir.Expression visitClassTypeLiteralGet( |
1252 Send node, ConstantExpression constant, _) { | 1252 Send node, ConstantExpression constant, _) { |
1253 var loadedCheckFunc = | 1253 var loadedCheckFunc = |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 | 1730 |
1731 @override | 1731 @override |
1732 IrFunction visitInstanceSetterDeclaration(FunctionExpression node, | 1732 IrFunction visitInstanceSetterDeclaration(FunctionExpression node, |
1733 MethodElement setter, NodeList parameters, Node body, _) { | 1733 MethodElement setter, NodeList parameters, Node body, _) { |
1734 return buildIrFunction(ir.ProcedureKind.Setter, setter, body); | 1734 return buildIrFunction(ir.ProcedureKind.Setter, setter, body); |
1735 } | 1735 } |
1736 | 1736 |
1737 @override | 1737 @override |
1738 ir.InvocationExpression visitIntFromEnvironmentConstructorInvoke( | 1738 ir.InvocationExpression visitIntFromEnvironmentConstructorInvoke( |
1739 NewExpression node, IntFromEnvironmentConstantExpression constant, _) { | 1739 NewExpression node, IntFromEnvironmentConstantExpression constant, _) { |
1740 return buildConstructorInvoke(node, isConst: true); | 1740 return associateNode(buildConstructorInvoke(node, isConst: true), node); |
1741 } | 1741 } |
1742 | 1742 |
1743 ir.IsExpression buildIs(Node expression, ResolutionDartType type) { | 1743 ir.IsExpression buildIs(Node expression, ResolutionDartType type) { |
1744 return new ir.IsExpression( | 1744 return new ir.IsExpression( |
1745 visitForValue(expression), kernel.typeToIr(type)); | 1745 visitForValue(expression), kernel.typeToIr(type)); |
1746 } | 1746 } |
1747 | 1747 |
1748 @override | 1748 @override |
1749 ir.IsExpression visitIs( | 1749 ir.IsExpression visitIs( |
1750 Send node, Node expression, ResolutionDartType type, _) { | 1750 Send node, Node expression, ResolutionDartType type, _) { |
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2345 @override | 2345 @override |
2346 ir.Expression handleStaticSetterSet( | 2346 ir.Expression handleStaticSetterSet( |
2347 SendSet node, FunctionElement setter, Node rhs, _) { | 2347 SendSet node, FunctionElement setter, Node rhs, _) { |
2348 return buildStaticAccessor(null, setter) | 2348 return buildStaticAccessor(null, setter) |
2349 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); | 2349 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); |
2350 } | 2350 } |
2351 | 2351 |
2352 @override | 2352 @override |
2353 ir.InvocationExpression visitStringFromEnvironmentConstructorInvoke( | 2353 ir.InvocationExpression visitStringFromEnvironmentConstructorInvoke( |
2354 NewExpression node, StringFromEnvironmentConstantExpression constant, _) { | 2354 NewExpression node, StringFromEnvironmentConstantExpression constant, _) { |
2355 return buildConstructorInvoke(node, isConst: true); | 2355 return associateNode(buildConstructorInvoke(node, isConst: true), node); |
2356 } | 2356 } |
2357 | 2357 |
2358 @override | 2358 @override |
2359 ir.SuperMethodInvocation visitSuperBinary(Send node, FunctionElement function, | 2359 ir.SuperMethodInvocation visitSuperBinary(Send node, FunctionElement function, |
2360 BinaryOperator operator, Node argument, _) { | 2360 BinaryOperator operator, Node argument, _) { |
2361 transformerFlags |= TransformerFlag.superCalls; | 2361 transformerFlags |= TransformerFlag.superCalls; |
2362 return new ir.SuperMethodInvocation( | 2362 return new ir.SuperMethodInvocation( |
2363 kernel.irName(operator.selectorName, currentElement), | 2363 kernel.irName(operator.selectorName, currentElement), |
2364 new ir.Arguments(<ir.Expression>[visitForValue(argument)]), | 2364 new ir.Arguments(<ir.Expression>[visitForValue(argument)]), |
2365 kernel.functionToIr(function)); | 2365 kernel.functionToIr(function)); |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2967 : this(null, true, node, initializers); | 2967 : this(null, true, node, initializers); |
2968 | 2968 |
2969 accept(ir.Visitor v) => throw "unsupported"; | 2969 accept(ir.Visitor v) => throw "unsupported"; |
2970 | 2970 |
2971 visitChildren(ir.Visitor v) => throw "unsupported"; | 2971 visitChildren(ir.Visitor v) => throw "unsupported"; |
2972 | 2972 |
2973 String toString() { | 2973 String toString() { |
2974 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2974 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
2975 } | 2975 } |
2976 } | 2976 } |
OLD | NEW |