| 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 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 ASSERT(loc.policy() == Location::kRequiresRegister); | 592 ASSERT(loc.policy() == Location::kRequiresRegister); |
| 593 if (!stack_.is_empty() && !blocked_temp_registers[stack_.Last()]) { | 593 if (!stack_.is_empty() && !blocked_temp_registers[stack_.Last()]) { |
| 594 reg = stack_.Last(); | 594 reg = stack_.Last(); |
| 595 blocked_registers[reg] = true; | 595 blocked_registers[reg] = true; |
| 596 } else { | 596 } else { |
| 597 reg = AllocateFreeRegister(blocked_registers); | 597 reg = AllocateFreeRegister(blocked_registers); |
| 598 } | 598 } |
| 599 locs->set_in(i, Location::RegisterLocation(reg)); | 599 locs->set_in(i, Location::RegisterLocation(reg)); |
| 600 } | 600 } |
| 601 | 601 |
| 602 Pop(reg, instr->InputAt(i)); | 602 // Inputs are consumed from the simulated frame. In case of a call argument |
| 603 // we leave it until the call instruction. |
| 604 if (!instr->IsPushArgument()) Pop(reg, instr->InputAt(i)); |
| 603 } | 605 } |
| 604 | 606 |
| 605 // If this instruction is call spill everything that was not consumed by | 607 // If this instruction is call spill everything that was not consumed by |
| 606 // input locations. | 608 // input locations. |
| 607 if (locs->is_call() || instr->IsBranch() || instr->IsGoto()) { | 609 if (locs->is_call() || instr->IsBranch() || instr->IsGoto()) { |
| 608 Spill(); | 610 Spill(); |
| 609 } | 611 } |
| 610 | 612 |
| 611 // Allocate all unallocated temp locations. | 613 // Allocate all unallocated temp locations. |
| 612 for (intptr_t i = 0; i < locs->temp_count(); i++) { | 614 for (intptr_t i = 0; i < locs->temp_count(); i++) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 return; | 796 return; |
| 795 } | 797 } |
| 796 } | 798 } |
| 797 | 799 |
| 798 // This move is not blocked. | 800 // This move is not blocked. |
| 799 EmitMove(index); | 801 EmitMove(index); |
| 800 } | 802 } |
| 801 | 803 |
| 802 | 804 |
| 803 } // namespace dart | 805 } // namespace dart |
| OLD | NEW |