Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend | 5 /// This file declares a "shadow hierarchy" of concrete classes which extend |
| 6 /// the kernel class hierarchy, adding methods and fields needed by the | 6 /// the kernel class hierarchy, adding methods and fields needed by the |
| 7 /// BodyBuilder. | 7 /// BodyBuilder. |
| 8 /// | 8 /// |
| 9 /// Instances of these classes may be created using the factory methods in | 9 /// Instances of these classes may be created using the factory methods in |
| 10 /// `ast_factory.dart`. | 10 /// `ast_factory.dart`. |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1266 KernelMethodInvocation(Expression receiver, Name name, Arguments arguments, | 1266 KernelMethodInvocation(Expression receiver, Name name, Arguments arguments, |
| 1267 {bool isImplicitCall: false, Member interfaceTarget}) | 1267 {bool isImplicitCall: false, Member interfaceTarget}) |
| 1268 : _isImplicitCall = isImplicitCall, | 1268 : _isImplicitCall = isImplicitCall, |
| 1269 super(receiver, name, arguments, interfaceTarget); | 1269 super(receiver, name, arguments, interfaceTarget); |
| 1270 | 1270 |
| 1271 @override | 1271 @override |
| 1272 void _collectDependencies(KernelDependencyCollector collector) { | 1272 void _collectDependencies(KernelDependencyCollector collector) { |
| 1273 // The inference dependencies are the inference dependencies of the | 1273 // The inference dependencies are the inference dependencies of the |
| 1274 // receiver. | 1274 // receiver. |
| 1275 collector.collectDependencies(receiver); | 1275 collector.collectDependencies(receiver); |
| 1276 if (name == '+' || name == '-' || name == '*' || name == '%') { | |
|
scheglov
2017/06/13 19:46:51
Is it unsafe to use identical() here?
Paul Berry
2017/06/13 20:06:39
Oops, I should have thought of that. identical()
| |
| 1277 collector.collectDependencies(arguments.positional[0]); | |
| 1278 } | |
| 1276 } | 1279 } |
| 1277 | 1280 |
| 1278 @override | 1281 @override |
| 1279 DartType _inferExpression( | 1282 DartType _inferExpression( |
| 1280 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 1283 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
| 1281 typeNeeded = inferrer.listener.methodInvocationEnter(this, typeContext) || | 1284 typeNeeded = inferrer.listener.methodInvocationEnter(this, typeContext) || |
| 1282 typeNeeded; | 1285 typeNeeded; |
| 1283 // First infer the receiver so we can look up the method that was invoked. | 1286 // First infer the receiver so we can look up the method that was invoked. |
| 1284 var receiverType = inferrer.inferExpression(receiver, null, true); | 1287 var receiverType = inferrer.inferExpression(receiver, null, true); |
| 1285 bool isOverloadedArithmeticOperator = false; | 1288 bool isOverloadedArithmeticOperator = false; |
| (...skipping 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2221 } | 2224 } |
| 2222 | 2225 |
| 2223 transformChildren(v) { | 2226 transformChildren(v) { |
| 2224 return internalError("Internal error: Unsupported operation."); | 2227 return internalError("Internal error: Unsupported operation."); |
| 2225 } | 2228 } |
| 2226 | 2229 |
| 2227 visitChildren(v) { | 2230 visitChildren(v) { |
| 2228 return internalError("Internal error: Unsupported operation."); | 2231 return internalError("Internal error: Unsupported operation."); |
| 2229 } | 2232 } |
| 2230 } | 2233 } |
| OLD | NEW |