| Index: runtime/vm/flow_graph_compiler.cc
|
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
|
| index a5d50b111fa942aa49cf4c64f8130d496736713c..a953c228128dee23391e17eff39ad72e19929fd5 100644
|
| --- a/runtime/vm/flow_graph_compiler.cc
|
| +++ b/runtime/vm/flow_graph_compiler.cc
|
| @@ -212,29 +212,17 @@ void FlowGraphCompiler::VisitBlocks() {
|
| for (intptr_t i = 0; i < block_order().length(); ++i) {
|
| // Compile the block entry.
|
| BlockEntryInstr* entry = block_order()[i];
|
| - assembler()->Comment("B%"Pd"", entry->block_id());
|
| set_current_block(entry);
|
|
|
| if (WasCompacted(entry)) {
|
| + assembler()->Comment("B%"Pd"", entry->block_id());
|
| continue;
|
| }
|
|
|
| - entry->EmitNativeCode(this);
|
| - // Compile all successors until an exit, branch, or a block entry.
|
| + EmitInstruction(entry);
|
| + // Compile all successors in the block.
|
| for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
|
| - Instruction* instr = it.Current();
|
| - if (FLAG_code_comments) EmitComment(instr);
|
| - if (instr->IsParallelMove()) {
|
| - parallel_move_resolver_.EmitNativeCode(instr->AsParallelMove());
|
| - } else {
|
| - ASSERT(instr->locs() != NULL);
|
| - EmitInstructionPrologue(instr);
|
| - ASSERT(pending_deoptimization_env_ == NULL);
|
| - pending_deoptimization_env_ = instr->env();
|
| - instr->EmitNativeCode(this);
|
| - pending_deoptimization_env_ = NULL;
|
| - EmitInstructionEpilogue(instr);
|
| - }
|
| + EmitInstruction(it.Current());
|
| }
|
| }
|
| set_current_block(NULL);
|
| @@ -668,6 +656,24 @@ void FlowGraphCompiler::EmitComment(Instruction* instr) {
|
| }
|
|
|
|
|
| +void FlowGraphCompiler::EmitInstruction(Instruction* instr) {
|
| + if (FLAG_code_comments) {
|
| + if (instr->IsBlockEntry()) {
|
| + assembler()->Comment("B%"Pd"", instr->AsBlockEntry()->block_id());
|
| + } else {
|
| + EmitComment(instr);
|
| + }
|
| + }
|
| +
|
| + EmitInstructionPrologue(instr);
|
| + ASSERT(pending_deoptimization_env_ == NULL);
|
| + pending_deoptimization_env_ = instr->env();
|
| + instr->EmitNativeCode(this);
|
| + pending_deoptimization_env_ = NULL;
|
| + EmitInstructionEpilogue(instr);
|
| +}
|
| +
|
| +
|
| // Allocate a register that is not explicitly blocked.
|
| static Register AllocateFreeRegister(bool* blocked_registers) {
|
| for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) {
|
|
|