| 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/debugger.h" | 10 #include "vm/debugger.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 for (intptr_t i = 0; i < block_order().length(); ++i) { | 92 for (intptr_t i = 0; i < block_order().length(); ++i) { |
| 93 ASSERT(frame_register_allocator()->IsSpilled()); | 93 ASSERT(frame_register_allocator()->IsSpilled()); |
| 94 assembler()->Comment("B%d", i); | 94 assembler()->Comment("B%d", i); |
| 95 // Compile the block entry. | 95 // Compile the block entry. |
| 96 set_current_block(block_order()[i]); | 96 set_current_block(block_order()[i]); |
| 97 current_block()->PrepareEntry(this); | 97 current_block()->PrepareEntry(this); |
| 98 Instruction* instr = current_block()->StraightLineSuccessor(); | 98 Instruction* instr = current_block()->StraightLineSuccessor(); |
| 99 // Compile all successors until an exit, branch, or a block entry. | 99 // Compile all successors until an exit, branch, or a block entry. |
| 100 while ((instr != NULL) && !instr->IsBlockEntry()) { | 100 while ((instr != NULL) && !instr->IsBlockEntry()) { |
| 101 if (FLAG_code_comments) EmitComment(instr); | 101 if (FLAG_code_comments) EmitComment(instr); |
| 102 ASSERT(instr->IsGoto() || instr->locs() != NULL); | 102 ASSERT(instr->locs() != NULL); |
| 103 if (instr->locs() != NULL) { | 103 EmitInstructionPrologue(instr); |
| 104 EmitInstructionPrologue(instr); | 104 instr->EmitNativeCode(this); |
| 105 instr->EmitNativeCode(this); | |
| 106 } | |
| 107 instr = instr->StraightLineSuccessor(); | 105 instr = instr->StraightLineSuccessor(); |
| 108 } | 106 } |
| 109 BlockEntryInstr* successor = | 107 BlockEntryInstr* successor = |
| 110 (instr == NULL) ? NULL : instr->AsBlockEntry(); | 108 (instr == NULL) ? NULL : instr->AsBlockEntry(); |
| 111 if (successor != NULL) { | 109 if (successor != NULL) { |
| 112 frame_register_allocator()->Spill(); | 110 frame_register_allocator()->Spill(); |
| 113 // Block ended with a "goto". We can fall through if it is the | 111 // Block ended with a "goto". We can fall through if it is the |
| 114 // next block in the list. Otherwise, we need a jump. | 112 // next block in the list. Otherwise, we need a jump. |
| 115 if ((i == block_order().length() - 1) || | 113 if ((i == block_order().length() - 1) || |
| 116 (block_order()[i + 1] != successor)) { | 114 (block_order()[i + 1] != successor)) { |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 622 |
| 625 | 623 |
| 626 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { | 624 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { |
| 627 for (int i = 0; i < stack_.length(); i++) { | 625 for (int i = 0; i < stack_.length(); i++) { |
| 628 stub->Push(stack_[i]); | 626 stub->Push(stack_[i]); |
| 629 } | 627 } |
| 630 } | 628 } |
| 631 | 629 |
| 632 | 630 |
| 633 } // namespace dart | 631 } // namespace dart |
| OLD | NEW |