| 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 /** | 5 /** |
| 6 * Instead of emitting each SSA instruction with a temporary variable | 6 * Instead of emitting each SSA instruction with a temporary variable |
| 7 * mark instructions that can be emitted at their use-site. | 7 * mark instructions that can be emitted at their use-site. |
| 8 * For example, in: | 8 * For example, in: |
| 9 * t0 = 4; | 9 * t0 = 4; |
| 10 * t1 = 3; | 10 * t1 = 3; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 if (!input.generateAtUseSite() && input.usedBy.length == 1) { | 31 if (!input.generateAtUseSite() && input.usedBy.length == 1) { |
| 32 expectedInputs.add(input); | 32 expectedInputs.add(input); |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 // The codegen might use the input multiple times, so it must not be | 37 // The codegen might use the input multiple times, so it must not be |
| 38 // set generate at use site. | 38 // set generate at use site. |
| 39 void visitIs(HIs instruction) {} | 39 void visitIs(HIs instruction) {} |
| 40 | 40 |
| 41 // A bailout target does not use its input like the other |
| 42 // instructions. Its inputs must be emitted prior to visiting it. |
| 43 void visitBailoutTarget(HBailoutTarget instruction) {} |
| 44 |
| 41 void visitBasicBlock(HBasicBlock block) { | 45 void visitBasicBlock(HBasicBlock block) { |
| 42 // Visit each instruction of the basic block in last-to-first order. | 46 // Visit each instruction of the basic block in last-to-first order. |
| 43 // Keep a list of expected inputs of the current "expression" being | 47 // Keep a list of expected inputs of the current "expression" being |
| 44 // merged. If instructions occur in the expected order, they are | 48 // merged. If instructions occur in the expected order, they are |
| 45 // included in the expression. | 49 // included in the expression. |
| 46 | 50 |
| 47 // The expectedInputs list holds non-trivial instructions that may | 51 // The expectedInputs list holds non-trivial instructions that may |
| 48 // be generated at their use site, if they occur in the correct order. | 52 // be generated at their use site, if they occur in the correct order. |
| 49 expectedInputs = new List<HInstruction>(); | 53 expectedInputs = new List<HInstruction>(); |
| 50 // Add non-trivial inputs of instruction to expectedInputs, in | 54 // Add non-trivial inputs of instruction to expectedInputs, in |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 }; | 342 }; |
| 339 } | 343 } |
| 340 | 344 |
| 341 class JSBinaryOperatorPrecedence { | 345 class JSBinaryOperatorPrecedence { |
| 342 final int left; | 346 final int left; |
| 343 final int right; | 347 final int right; |
| 344 const JSBinaryOperatorPrecedence(this.left, this.right); | 348 const JSBinaryOperatorPrecedence(this.left, this.right); |
| 345 // All binary operators (excluding assignment) are left associative. | 349 // All binary operators (excluding assignment) are left associative. |
| 346 int get precedence() => left; | 350 int get precedence() => left; |
| 347 } | 351 } |
| OLD | NEW |