| 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 if (element == null) { | 469 if (element == null) { |
| 470 Send send = node.declaredIdentifier.asSend(); | 470 Send send = node.declaredIdentifier.asSend(); |
| 471 if (send == null) { | 471 if (send == null) { |
| 472 return buildStaticAccessor(null); | 472 return buildStaticAccessor(null); |
| 473 } | 473 } |
| 474 // This should be the situation where `node.declaredIdentifier` is | 474 // This should be the situation where `node.declaredIdentifier` is |
| 475 // unresolved, but in an instance method context. If it is some different | 475 // unresolved, but in an instance method context. If it is some different |
| 476 // situation, the assignment to [ir.PropertyGet] should act as an | 476 // situation, the assignment to [ir.PropertyGet] should act as an |
| 477 // assertion. | 477 // assertion. |
| 478 ir.PropertyGet expression = visitForValue(send); | 478 ir.PropertyGet expression = visitForValue(send); |
| 479 return PropertyAccessor.make(expression.receiver, expression.name); | 479 return PropertyAccessor.make( |
| 480 expression.receiver, expression.name, null, null); |
| 480 } else if (kernel.isSyntheticError(element)) { | 481 } else if (kernel.isSyntheticError(element)) { |
| 481 return buildStaticAccessor(null); | 482 return buildStaticAccessor(null); |
| 482 } else if (element.isGetter) { | 483 } else if (element.isGetter) { |
| 483 if (element.isInstanceMember) { | 484 if (element.isInstanceMember) { |
| 484 return new ThisPropertyAccessor(kernel.irName(element.name, element)); | 485 return new ThisPropertyAccessor( |
| 486 kernel.irName(element.name, element), null, null); |
| 485 } else { | 487 } else { |
| 486 GetterElement getter = element; | 488 GetterElement getter = element; |
| 487 Element setter = getter.setter; | 489 Element setter = getter.setter; |
| 488 return buildStaticAccessor(getter, setter); | 490 return buildStaticAccessor(getter, setter); |
| 489 } | 491 } |
| 490 } else if (element.isLocal) { | 492 } else if (element.isLocal) { |
| 491 return new VariableAccessor(getLocal(element)); | 493 return new VariableAccessor(getLocal(element)); |
| 492 } else if (element.isField) { | 494 } else if (element.isField) { |
| 493 return buildStaticAccessor(element); | 495 return buildStaticAccessor(element); |
| 494 } else { | 496 } else { |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 return buildInvokeSelector( | 1254 return buildInvokeSelector( |
| 1253 visitForValue(receiver), selector, buildArguments(arguments)); | 1255 visitForValue(receiver), selector, buildArguments(arguments)); |
| 1254 } | 1256 } |
| 1255 | 1257 |
| 1256 @override | 1258 @override |
| 1257 ir.Expression handleDynamicCompounds( | 1259 ir.Expression handleDynamicCompounds( |
| 1258 Send node, Node receiver, Name name, CompoundRhs rhs, _) { | 1260 Send node, Node receiver, Name name, CompoundRhs rhs, _) { |
| 1259 ir.Expression receiverNode = | 1261 ir.Expression receiverNode = |
| 1260 receiver == null ? new ir.ThisExpression() : visitForValue(receiver); | 1262 receiver == null ? new ir.ThisExpression() : visitForValue(receiver); |
| 1261 return buildCompound( | 1263 return buildCompound( |
| 1262 PropertyAccessor.make(receiverNode, nameToIrName(name)), rhs); | 1264 PropertyAccessor.make(receiverNode, nameToIrName(name), null, null), |
| 1265 rhs); |
| 1263 } | 1266 } |
| 1264 | 1267 |
| 1265 @override | 1268 @override |
| 1266 ir.PropertySet visitDynamicPropertySet( | 1269 ir.PropertySet visitDynamicPropertySet( |
| 1267 SendSet node, Node receiver, Name name, Node rhs, _) { | 1270 SendSet node, Node receiver, Name name, Node rhs, _) { |
| 1268 ir.Expression value = visitForValue(rhs); | 1271 ir.Expression value = visitForValue(rhs); |
| 1269 return new ir.PropertySet( | 1272 return new ir.PropertySet( |
| 1270 visitForValue(receiver), nameToIrName(name), value); | 1273 visitForValue(receiver), nameToIrName(name), value); |
| 1271 } | 1274 } |
| 1272 | 1275 |
| 1273 @override | 1276 @override |
| 1274 ir.Expression handleDynamicSetIfNulls( | 1277 ir.Expression handleDynamicSetIfNulls( |
| 1275 Send node, Node receiver, Name name, Node rhs, _) { | 1278 Send node, Node receiver, Name name, Node rhs, _) { |
| 1276 ir.Name irName = nameToIrName(name); | 1279 ir.Name irName = nameToIrName(name); |
| 1277 Accessor accessor = (receiver == null) | 1280 Accessor accessor = (receiver == null) |
| 1278 ? new ThisPropertyAccessor(irName) | 1281 ? new ThisPropertyAccessor(irName, null, null) |
| 1279 : PropertyAccessor.make(visitForValue(receiver), irName); | 1282 : PropertyAccessor.make(visitForValue(receiver), irName, null, null); |
| 1280 return accessor.buildNullAwareAssignment(visitForValue(rhs), | 1283 return accessor.buildNullAwareAssignment(visitForValue(rhs), |
| 1281 voidContext: isVoidContext); | 1284 voidContext: isVoidContext); |
| 1282 } | 1285 } |
| 1283 | 1286 |
| 1284 @override | 1287 @override |
| 1285 ir.TypeLiteral visitDynamicTypeLiteralGet( | 1288 ir.TypeLiteral visitDynamicTypeLiteralGet( |
| 1286 Send node, ConstantExpression constant, _) { | 1289 Send node, ConstantExpression constant, _) { |
| 1287 return buildTypeLiteral(constant); | 1290 return buildTypeLiteral(constant); |
| 1288 } | 1291 } |
| 1289 | 1292 |
| 1290 @override | 1293 @override |
| 1291 ir.MethodInvocation visitDynamicTypeLiteralInvoke( | 1294 ir.MethodInvocation visitDynamicTypeLiteralInvoke( |
| 1292 Send node, | 1295 Send node, |
| 1293 ConstantExpression constant, | 1296 ConstantExpression constant, |
| 1294 NodeList arguments, | 1297 NodeList arguments, |
| 1295 CallStructure callStructure, | 1298 CallStructure callStructure, |
| 1296 _) { | 1299 _) { |
| 1297 return buildCall(buildTypeLiteral(constant), callStructure, arguments); | 1300 return buildCall(buildTypeLiteral(constant), callStructure, arguments); |
| 1298 } | 1301 } |
| 1299 | 1302 |
| 1300 @override | 1303 @override |
| 1301 ir.Expression visitDynamicTypeLiteralSet( | 1304 ir.Expression visitDynamicTypeLiteralSet( |
| 1302 SendSet node, ConstantExpression constant, Node rhs, _) { | 1305 SendSet node, ConstantExpression constant, Node rhs, _) { |
| 1303 return buildTypeLiteralSet(constant, rhs); | 1306 return buildTypeLiteralSet(constant, rhs); |
| 1304 } | 1307 } |
| 1305 | 1308 |
| 1306 ir.MethodInvocation buildBinaryOperator( | 1309 ir.MethodInvocation buildBinaryOperator( |
| 1307 Node left, String operator, Node right) { | 1310 Node left, String operator, Node right) { |
| 1308 ir.Name name = kernel.irName(operator, currentElement); | 1311 ir.Name name = kernel.irName(operator, currentElement); |
| 1309 return makeBinary(visitForValue(left), name, visitForValue(right)); | 1312 return makeBinary(visitForValue(left), name, null, visitForValue(right)); |
| 1310 } | 1313 } |
| 1311 | 1314 |
| 1312 @override | 1315 @override |
| 1313 ir.MethodInvocation visitEquals(Send node, Node left, Node right, _) { | 1316 ir.MethodInvocation visitEquals(Send node, Node left, Node right, _) { |
| 1314 return buildBinaryOperator(left, '==', right); | 1317 return buildBinaryOperator(left, '==', right); |
| 1315 } | 1318 } |
| 1316 | 1319 |
| 1317 @override | 1320 @override |
| 1318 ir.MethodInvocation visitExpressionInvoke(Send node, Node expression, | 1321 ir.MethodInvocation visitExpressionInvoke(Send node, Node expression, |
| 1319 NodeList arguments, CallStructure callStructure, _) { | 1322 NodeList arguments, CallStructure callStructure, _) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 ConstructorElement constructor, | 1482 ConstructorElement constructor, |
| 1480 InterfaceType type, | 1483 InterfaceType type, |
| 1481 NodeList arguments, | 1484 NodeList arguments, |
| 1482 CallStructure callStructure, | 1485 CallStructure callStructure, |
| 1483 _) { | 1486 _) { |
| 1484 return buildConstructorInvoke(node, isConst: false); | 1487 return buildConstructorInvoke(node, isConst: false); |
| 1485 } | 1488 } |
| 1486 | 1489 |
| 1487 Accessor buildNullAwarePropertyAccessor(Node receiver, Name name) { | 1490 Accessor buildNullAwarePropertyAccessor(Node receiver, Name name) { |
| 1488 return new NullAwarePropertyAccessor( | 1491 return new NullAwarePropertyAccessor( |
| 1489 visitForValue(receiver), nameToIrName(name)); | 1492 visitForValue(receiver), nameToIrName(name), null, null); |
| 1490 } | 1493 } |
| 1491 | 1494 |
| 1492 @override | 1495 @override |
| 1493 ir.Expression visitIfNotNullDynamicPropertyGet( | 1496 ir.Expression visitIfNotNullDynamicPropertyGet( |
| 1494 Send node, Node receiver, Name name, _) { | 1497 Send node, Node receiver, Name name, _) { |
| 1495 return buildNullAwarePropertyAccessor(receiver, name).buildSimpleRead(); | 1498 return buildNullAwarePropertyAccessor(receiver, name).buildSimpleRead(); |
| 1496 } | 1499 } |
| 1497 | 1500 |
| 1498 @override | 1501 @override |
| 1499 ir.Let visitIfNotNullDynamicPropertyInvoke( | 1502 ir.Let visitIfNotNullDynamicPropertyInvoke( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1540 ConstructorElement superConstructor, InterfaceType type, _) { | 1543 ConstructorElement superConstructor, InterfaceType type, _) { |
| 1541 if (superConstructor == null) { | 1544 if (superConstructor == null) { |
| 1542 // TODO(ahe): Semantic visitor shouldn't call this. | 1545 // TODO(ahe): Semantic visitor shouldn't call this. |
| 1543 return new ir.InvalidInitializer(); | 1546 return new ir.InvalidInitializer(); |
| 1544 } | 1547 } |
| 1545 return new ir.SuperInitializer( | 1548 return new ir.SuperInitializer( |
| 1546 kernel.functionToIr(superConstructor), new ir.Arguments.empty()); | 1549 kernel.functionToIr(superConstructor), new ir.Arguments.empty()); |
| 1547 } | 1550 } |
| 1548 | 1551 |
| 1549 Accessor buildIndexAccessor(Node receiver, Node index) { | 1552 Accessor buildIndexAccessor(Node receiver, Node index) { |
| 1550 return IndexAccessor.make(visitForValue(receiver), visitForValue(index)); | 1553 return IndexAccessor.make( |
| 1554 visitForValue(receiver), visitForValue(index), null, null); |
| 1551 } | 1555 } |
| 1552 | 1556 |
| 1553 @override | 1557 @override |
| 1554 ir.Expression visitIndex(Send node, Node receiver, Node index, _) { | 1558 ir.Expression visitIndex(Send node, Node receiver, Node index, _) { |
| 1555 return buildIndexAccessor(receiver, index).buildSimpleRead(); | 1559 return buildIndexAccessor(receiver, index).buildSimpleRead(); |
| 1556 } | 1560 } |
| 1557 | 1561 |
| 1558 ir.Expression buildIndexPostfix(Accessor accessor, IncDecOperator operator) { | 1562 ir.Expression buildIndexPostfix(Accessor accessor, IncDecOperator operator) { |
| 1559 ir.Name name = kernel.irName(operator.selectorName, currentElement); | 1563 ir.Name name = kernel.irName(operator.selectorName, currentElement); |
| 1560 return accessor.buildPostfixIncrement(name, voidContext: isVoidContext); | 1564 return accessor.buildPostfixIncrement(name, voidContext: isVoidContext); |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2140 | 2144 |
| 2141 @override | 2145 @override |
| 2142 ir.InvocationExpression visitStringFromEnvironmentConstructorInvoke( | 2146 ir.InvocationExpression visitStringFromEnvironmentConstructorInvoke( |
| 2143 NewExpression node, StringFromEnvironmentConstantExpression constant, _) { | 2147 NewExpression node, StringFromEnvironmentConstantExpression constant, _) { |
| 2144 return buildConstructorInvoke(node, isConst: true); | 2148 return buildConstructorInvoke(node, isConst: true); |
| 2145 } | 2149 } |
| 2146 | 2150 |
| 2147 @override | 2151 @override |
| 2148 ir.SuperMethodInvocation visitSuperBinary(Send node, FunctionElement function, | 2152 ir.SuperMethodInvocation visitSuperBinary(Send node, FunctionElement function, |
| 2149 BinaryOperator operator, Node argument, _) { | 2153 BinaryOperator operator, Node argument, _) { |
| 2150 return new ir.SuperMethodInvocation(kernel.functionToIr(function), | 2154 return new ir.SuperMethodInvocation( |
| 2151 new ir.Arguments(<ir.Expression>[visitForValue(argument)])); | 2155 kernel.irName(operator.selectorName, currentElement), |
| 2156 new ir.Arguments(<ir.Expression>[visitForValue(argument)]), |
| 2157 kernel.functionToIr(function)); |
| 2152 } | 2158 } |
| 2153 | 2159 |
| 2154 @override | 2160 @override |
| 2155 ir.Expression visitSuperCompoundIndexSet( | 2161 ir.Expression visitSuperCompoundIndexSet( |
| 2156 SendSet node, | 2162 SendSet node, |
| 2157 MethodElement getter, | 2163 MethodElement getter, |
| 2158 MethodElement setter, | 2164 MethodElement setter, |
| 2159 Node index, | 2165 Node index, |
| 2160 AssignmentOperator operator, | 2166 AssignmentOperator operator, |
| 2161 Node rhs, | 2167 Node rhs, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 2179 // TODO(ahe): Semantic visitor shouldn't call in this case. | 2185 // TODO(ahe): Semantic visitor shouldn't call in this case. |
| 2180 return new ir.InvalidInitializer(); | 2186 return new ir.InvalidInitializer(); |
| 2181 } | 2187 } |
| 2182 return new ir.SuperInitializer( | 2188 return new ir.SuperInitializer( |
| 2183 kernel.functionToIr(superConstructor), buildArguments(arguments)); | 2189 kernel.functionToIr(superConstructor), buildArguments(arguments)); |
| 2184 } | 2190 } |
| 2185 | 2191 |
| 2186 ir.SuperMethodInvocation buildSuperEquals( | 2192 ir.SuperMethodInvocation buildSuperEquals( |
| 2187 FunctionElement function, Node argument) { | 2193 FunctionElement function, Node argument) { |
| 2188 return new ir.SuperMethodInvocation( | 2194 return new ir.SuperMethodInvocation( |
| 2189 kernel.functionToIr(function), | 2195 kernel.irName(function.name, function), |
| 2190 new ir.Arguments(<ir.Expression>[visitForValue(argument)], | 2196 new ir.Arguments(<ir.Expression>[visitForValue(argument)], |
| 2191 types: null, named: null)); | 2197 types: null, named: null), |
| 2198 kernel.functionToIr(function)); |
| 2192 } | 2199 } |
| 2193 | 2200 |
| 2194 @override | 2201 @override |
| 2195 ir.SuperMethodInvocation visitSuperEquals( | 2202 ir.SuperMethodInvocation visitSuperEquals( |
| 2196 Send node, FunctionElement function, Node argument, _) { | 2203 Send node, FunctionElement function, Node argument, _) { |
| 2197 return buildSuperEquals(function, argument); | 2204 return buildSuperEquals(function, argument); |
| 2198 } | 2205 } |
| 2199 | 2206 |
| 2200 @override | 2207 @override |
| 2201 ir.Expression handleSuperCompounds( | 2208 ir.Expression handleSuperCompounds( |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2262 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); | 2269 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); |
| 2263 } | 2270 } |
| 2264 | 2271 |
| 2265 Accessor buildSuperPropertyAccessor(Element getter, [Element setter]) { | 2272 Accessor buildSuperPropertyAccessor(Element getter, [Element setter]) { |
| 2266 if (setter == null && | 2273 if (setter == null && |
| 2267 getter.isField && | 2274 getter.isField && |
| 2268 !getter.isFinal && | 2275 !getter.isFinal && |
| 2269 !getter.isConst) { | 2276 !getter.isConst) { |
| 2270 setter = getter; | 2277 setter = getter; |
| 2271 } | 2278 } |
| 2279 Element element = getter ?? setter; |
| 2272 return new SuperPropertyAccessor( | 2280 return new SuperPropertyAccessor( |
| 2281 kernel.irName(element.name, element), |
| 2273 (getter == null) ? null : kernel.elementToIr(getter), | 2282 (getter == null) ? null : kernel.elementToIr(getter), |
| 2274 (setter == null) ? null : kernel.elementToIr(setter)); | 2283 (setter == null) ? null : kernel.elementToIr(setter)); |
| 2275 } | 2284 } |
| 2276 | 2285 |
| 2277 Accessor buildSuperIndexAccessor(Expression index, Element getter, | 2286 Accessor buildSuperIndexAccessor(Expression index, Element getter, |
| 2278 [Element setter]) { | 2287 [Element setter]) { |
| 2279 if (setter == null && | 2288 if (setter == null && |
| 2280 getter.isField && | 2289 getter.isField && |
| 2281 !getter.isFinal && | 2290 !getter.isFinal && |
| 2282 !getter.isConst) { | 2291 !getter.isConst) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); | 2363 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); |
| 2355 } | 2364 } |
| 2356 | 2365 |
| 2357 @override | 2366 @override |
| 2358 ir.Expression visitSuperMethodGet(Send node, MethodElement method, _) { | 2367 ir.Expression visitSuperMethodGet(Send node, MethodElement method, _) { |
| 2359 return buildSuperPropertyAccessor(method).buildSimpleRead(); | 2368 return buildSuperPropertyAccessor(method).buildSimpleRead(); |
| 2360 } | 2369 } |
| 2361 | 2370 |
| 2362 ir.SuperMethodInvocation buildSuperMethodInvoke( | 2371 ir.SuperMethodInvocation buildSuperMethodInvoke( |
| 2363 MethodElement method, NodeList arguments) { | 2372 MethodElement method, NodeList arguments) { |
| 2364 return new ir.SuperMethodInvocation( | 2373 return new ir.SuperMethodInvocation(kernel.irName(method.name, method), |
| 2365 kernel.functionToIr(method), buildArguments(arguments)); | 2374 buildArguments(arguments), kernel.functionToIr(method)); |
| 2366 } | 2375 } |
| 2367 | 2376 |
| 2368 @override | 2377 @override |
| 2369 ir.SuperMethodInvocation visitSuperMethodIncompatibleInvoke( | 2378 ir.SuperMethodInvocation visitSuperMethodIncompatibleInvoke( |
| 2370 Send node, | 2379 Send node, |
| 2371 MethodElement method, | 2380 MethodElement method, |
| 2372 NodeList arguments, | 2381 NodeList arguments, |
| 2373 CallStructure callStructure, | 2382 CallStructure callStructure, |
| 2374 _) { | 2383 _) { |
| 2375 return buildSuperMethodInvoke(method, arguments); | 2384 return buildSuperMethodInvoke(method, arguments); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 @override | 2422 @override |
| 2414 ir.Expression visitSuperSetterSet( | 2423 ir.Expression visitSuperSetterSet( |
| 2415 SendSet node, FunctionElement setter, Node rhs, _) { | 2424 SendSet node, FunctionElement setter, Node rhs, _) { |
| 2416 return buildSuperPropertyAccessor(null, setter) | 2425 return buildSuperPropertyAccessor(null, setter) |
| 2417 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); | 2426 .buildAssignment(visitForValue(rhs), voidContext: isVoidContext); |
| 2418 } | 2427 } |
| 2419 | 2428 |
| 2420 @override | 2429 @override |
| 2421 ir.SuperMethodInvocation visitSuperUnary( | 2430 ir.SuperMethodInvocation visitSuperUnary( |
| 2422 Send node, UnaryOperator operator, FunctionElement function, _) { | 2431 Send node, UnaryOperator operator, FunctionElement function, _) { |
| 2423 return new ir.SuperMethodInvocation( | 2432 return new ir.SuperMethodInvocation(kernel.irName(function.name, function), |
| 2424 kernel.functionToIr(function), new ir.Arguments.empty()); | 2433 new ir.Arguments.empty(), kernel.functionToIr(function)); |
| 2425 } | 2434 } |
| 2426 | 2435 |
| 2427 @override | 2436 @override |
| 2428 ir.Initializer visitThisConstructorInvoke( | 2437 ir.Initializer visitThisConstructorInvoke( |
| 2429 Send node, | 2438 Send node, |
| 2430 ConstructorElement thisConstructor, | 2439 ConstructorElement thisConstructor, |
| 2431 NodeList arguments, | 2440 NodeList arguments, |
| 2432 CallStructure callStructure, | 2441 CallStructure callStructure, |
| 2433 _) { | 2442 _) { |
| 2434 if (kernel.isSyntheticError(thisConstructor)) { | 2443 if (kernel.isSyntheticError(thisConstructor)) { |
| 2435 return new ir.InvalidInitializer(); | 2444 return new ir.InvalidInitializer(); |
| 2436 } else { | 2445 } else { |
| 2437 return new ir.RedirectingInitializer( | 2446 return new ir.RedirectingInitializer( |
| 2438 kernel.functionToIr(thisConstructor), buildArguments(arguments)); | 2447 kernel.functionToIr(thisConstructor), buildArguments(arguments)); |
| 2439 } | 2448 } |
| 2440 } | 2449 } |
| 2441 | 2450 |
| 2442 @override | 2451 @override |
| 2443 ir.ThisExpression visitThisGet(Identifier node, _) { | 2452 ir.ThisExpression visitThisGet(Identifier node, _) { |
| 2444 return new ir.ThisExpression(); | 2453 return new ir.ThisExpression(); |
| 2445 } | 2454 } |
| 2446 | 2455 |
| 2447 @override | 2456 @override |
| 2448 ir.MethodInvocation visitThisInvoke( | 2457 ir.MethodInvocation visitThisInvoke( |
| 2449 Send node, NodeList arguments, CallStructure callStructure, _) { | 2458 Send node, NodeList arguments, CallStructure callStructure, _) { |
| 2450 return buildCall(new ir.ThisExpression(), callStructure, arguments); | 2459 return buildCall(new ir.ThisExpression(), callStructure, arguments); |
| 2451 } | 2460 } |
| 2452 | 2461 |
| 2453 Accessor buildThisPropertyAccessor(Name name) { | 2462 Accessor buildThisPropertyAccessor(Name name) { |
| 2454 return new ThisPropertyAccessor(nameToIrName(name)); | 2463 return new ThisPropertyAccessor(nameToIrName(name), null, null); |
| 2455 } | 2464 } |
| 2456 | 2465 |
| 2457 @override | 2466 @override |
| 2458 ir.Expression visitThisPropertyGet(Send node, Name name, _) { | 2467 ir.Expression visitThisPropertyGet(Send node, Name name, _) { |
| 2459 return buildThisPropertyAccessor(name).buildSimpleRead(); | 2468 return buildThisPropertyAccessor(name).buildSimpleRead(); |
| 2460 } | 2469 } |
| 2461 | 2470 |
| 2462 @override | 2471 @override |
| 2463 ir.MethodInvocation visitThisPropertyInvoke( | 2472 ir.MethodInvocation visitThisPropertyInvoke( |
| 2464 Send node, NodeList arguments, Selector selector, _) { | 2473 Send node, NodeList arguments, Selector selector, _) { |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2710 : this(null, true, node, initializers); | 2719 : this(null, true, node, initializers); |
| 2711 | 2720 |
| 2712 accept(ir.Visitor v) => throw "unsupported"; | 2721 accept(ir.Visitor v) => throw "unsupported"; |
| 2713 | 2722 |
| 2714 visitChildren(ir.Visitor v) => throw "unsupported"; | 2723 visitChildren(ir.Visitor v) => throw "unsupported"; |
| 2715 | 2724 |
| 2716 String toString() { | 2725 String toString() { |
| 2717 return "IrFunction($kind, $isConstructor, $node, $initializers)"; | 2726 return "IrFunction($kind, $isConstructor, $node, $initializers)"; |
| 2718 } | 2727 } |
| 2719 } | 2728 } |
| OLD | NEW |