| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 cps_ir.optimization.inline; | 5 library cps_ir.optimization.inline; |
| 6 | 6 |
| 7 import 'cps_fragment.dart'; | 7 import 'cps_fragment.dart'; |
| 8 import 'cps_ir_builder.dart' show ThisParameterLocal; | 8 import 'cps_ir_builder.dart' show ThisParameterLocal; |
| 9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
| 10 import 'optimizers.dart'; | 10 import 'optimizers.dart'; |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 }); | 367 }); |
| 368 newCallStructure = new CallStructure(signature.parameterCount); | 368 newCallStructure = new CallStructure(signature.parameterCount); |
| 369 } | 369 } |
| 370 | 370 |
| 371 Selector newSelector = | 371 Selector newSelector = |
| 372 new Selector(node.selector.kind, node.selector.memberName, | 372 new Selector(node.selector.kind, node.selector.memberName, |
| 373 newCallStructure); | 373 newCallStructure); |
| 374 Primitive result = cps.invokeMethod(thisParameter, newSelector, node.mask, | 374 Primitive result = cps.invokeMethod(thisParameter, newSelector, node.mask, |
| 375 arguments, node.callingConvention); | 375 arguments, node.callingConvention); |
| 376 result.type = typeSystem.getInvokeReturnType(node.selector, node.mask); | 376 result.type = typeSystem.getInvokeReturnType(node.selector, node.mask); |
| 377 returnContinuation.parameters.single.type = result.type; |
| 377 cps.invokeContinuation(returnContinuation, <Primitive>[result]); | 378 cps.invokeContinuation(returnContinuation, <Primitive>[result]); |
| 378 return new FunctionDefinition(target, thisParameter, parameters, | 379 return new FunctionDefinition(target, thisParameter, parameters, |
| 379 returnContinuation, | 380 returnContinuation, |
| 380 cps.root); | 381 cps.root); |
| 381 } | 382 } |
| 382 | 383 |
| 383 // Given an invocation and a known target, possibly perform inlining. | 384 // Given an invocation and a known target, possibly perform inlining. |
| 384 // | 385 // |
| 385 // An optional call structure indicates a dynamic call. Calls that are | 386 // An optional call structure indicates a dynamic call. Calls that are |
| 386 // already resolved statically have a null call structure. | 387 // already resolved statically have a null call structure. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 if (target.isOperator && | 593 if (target.isOperator && |
| 593 (enclosingClass == backend.helpers.jsNumberClass || | 594 (enclosingClass == backend.helpers.jsNumberClass || |
| 594 enclosingClass == backend.helpers.jsDoubleClass || | 595 enclosingClass == backend.helpers.jsDoubleClass || |
| 595 enclosingClass == backend.helpers.jsIntClass)) { | 596 enclosingClass == backend.helpers.jsIntClass)) { |
| 596 // These should be handled by operator specialization. | 597 // These should be handled by operator specialization. |
| 597 return true; | 598 return true; |
| 598 } | 599 } |
| 599 return false; | 600 return false; |
| 600 } | 601 } |
| 601 } | 602 } |
| OLD | NEW |