| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 class SsaFromIrBuilderTask extends CompilerTask { | 7 class SsaFromIrBuilderTask extends CompilerTask { |
| 8 final JavaScriptBackend backend; | 8 final JavaScriptBackend backend; |
| 9 | 9 |
| 10 SsaFromIrBuilderTask(JavaScriptBackend backend) | 10 SsaFromIrBuilderTask(JavaScriptBackend backend) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 implements IrNodesVisitor, SsaBuilderMixin<IrNode> { | 53 implements IrNodesVisitor, SsaBuilderMixin<IrNode> { |
| 54 /** | 54 /** |
| 55 * Maps IR expressions to the generated [HInstruction]. Because the IR is | 55 * Maps IR expressions to the generated [HInstruction]. Because the IR is |
| 56 * in an SSA form, the arguments of an [IrNode] have already been visited | 56 * in an SSA form, the arguments of an [IrNode] have already been visited |
| 57 * prior to the node. This map is used to obtain the corresponding generated | 57 * prior to the node. This map is used to obtain the corresponding generated |
| 58 * SSA node. | 58 * SSA node. |
| 59 */ | 59 */ |
| 60 final Map<IrExpression, HInstruction> emitted = | 60 final Map<IrExpression, HInstruction> emitted = |
| 61 new Map<IrExpression, HInstruction>(); | 61 new Map<IrExpression, HInstruction>(); |
| 62 | 62 |
| 63 void emitReturn(HInstruction value, IrReturn node); | |
| 64 | |
| 65 /** | 63 /** |
| 66 * This method sets up the state of the IR visitor for inlining an invocation | 64 * This method sets up the state of the IR visitor for inlining an invocation |
| 67 * of [function]. | 65 * of [function]. |
| 68 */ | 66 */ |
| 69 void setupStateForInlining(FunctionElement function, | 67 void setupStateForInlining(FunctionElement function, |
| 70 List<HInstruction> compiledArguments) { | 68 List<HInstruction> compiledArguments) { |
| 71 // TODO(lry): once the IR supports functions with parameters or dynamic | 69 // TODO(lry): once the IR supports functions with parameters or dynamic |
| 72 // invocations, map the parameters (and [:this:]) to the argument | 70 // invocations, map the parameters (and [:this:]) to the argument |
| 73 // instructions by extending the [emitted] mapping. | 71 // instructions by extending the [emitted] mapping. |
| 74 assert(function.computeSignature(compiler).parameterCount == 0); | 72 assert(function.computeSignature(compiler).parameterCount == 0); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 247 |
| 250 void doInline(FunctionElement function) { | 248 void doInline(FunctionElement function) { |
| 251 if (compiler.irBuilder.hasIr(function)) { | 249 if (compiler.irBuilder.hasIr(function)) { |
| 252 visitInlinedFunction(function); | 250 visitInlinedFunction(function); |
| 253 } else { | 251 } else { |
| 254 IrInliningState state = inliningStack.last; | 252 IrInliningState state = inliningStack.last; |
| 255 state.astInliner.visitInlinedFunction(function); | 253 state.astInliner.visitInlinedFunction(function); |
| 256 } | 254 } |
| 257 } | 255 } |
| 258 } | 256 } |
| OLD | NEW |