| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { |
| 8 String get name; | 8 String get name; |
| 9 void visitGraph(HGraph graph); | 9 void visitGraph(HGraph graph); |
| 10 } | 10 } |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 // declaration has to be truthful. | 430 // declaration has to be truthful. |
| 431 | 431 |
| 432 // The call site might omit optional arguments. The inlined code must | 432 // The call site might omit optional arguments. The inlined code must |
| 433 // preserve the number of arguments, so check only the actual arguments. | 433 // preserve the number of arguments, so check only the actual arguments. |
| 434 | 434 |
| 435 List<HInstruction> inputs = node.inputs.sublist(1); | 435 List<HInstruction> inputs = node.inputs.sublist(1); |
| 436 int inputPosition = 1; // Skip receiver. | 436 int inputPosition = 1; // Skip receiver. |
| 437 bool canInline = true; | 437 bool canInline = true; |
| 438 signature.forEachParameter((ParameterElement element) { | 438 signature.forEachParameter((ParameterElement element) { |
| 439 if (inputPosition++ < inputs.length && canInline) { | 439 if (inputPosition++ < inputs.length && canInline) { |
| 440 DartType type = element.type.unalias(compiler); | 440 DartType type = element.type.unalias(compiler.resolution); |
| 441 if (type is FunctionType) { | 441 if (type is FunctionType) { |
| 442 canInline = false; | 442 canInline = false; |
| 443 } | 443 } |
| 444 if (compiler.enableTypeAssertions) { | 444 if (compiler.enableTypeAssertions) { |
| 445 // TODO(sra): Check if [input] is guaranteed to pass the parameter | 445 // TODO(sra): Check if [input] is guaranteed to pass the parameter |
| 446 // type check. Consider using a strengthened type check to avoid | 446 // type check. Consider using a strengthened type check to avoid |
| 447 // passing `null` to primitive types since the native methods usually | 447 // passing `null` to primitive types since the native methods usually |
| 448 // have non-nullable primitive parameter types. | 448 // have non-nullable primitive parameter types. |
| 449 canInline = false; | 449 canInline = false; |
| 450 } | 450 } |
| (...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2359 | 2359 |
| 2360 keyedValues.forEach((receiver, values) { | 2360 keyedValues.forEach((receiver, values) { |
| 2361 result.keyedValues[receiver] = | 2361 result.keyedValues[receiver] = |
| 2362 new Map<HInstruction, HInstruction>.from(values); | 2362 new Map<HInstruction, HInstruction>.from(values); |
| 2363 }); | 2363 }); |
| 2364 | 2364 |
| 2365 result.nonEscapingReceivers.addAll(nonEscapingReceivers); | 2365 result.nonEscapingReceivers.addAll(nonEscapingReceivers); |
| 2366 return result; | 2366 return result; |
| 2367 } | 2367 } |
| 2368 } | 2368 } |
| OLD | NEW |