Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_arm.cc |
| diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc |
| index 3ea3503ba95bfacef7cba235ab2e64a48534c17c..17253e2f43c0b24b0e69b9939a7b2066a256c5c8 100644 |
| --- a/runtime/vm/flow_graph_compiler_arm.cc |
| +++ b/runtime/vm/flow_graph_compiler_arm.cc |
| @@ -1446,23 +1446,25 @@ void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
| ASSERT(offset == (fpu_regs_count * kFpuRegisterSize)); |
| } |
| - // Store general purpose registers with the lowest register number at the |
| + // Store general purpose registers with the highest register number at the |
| // lowest address. |
| - const intptr_t cpu_registers = locs->live_registers()->cpu_registers(); |
| - ASSERT((cpu_registers & ~kAllCpuRegistersList) == 0); |
| - if (cpu_registers != 0) { |
| - __ PushList(cpu_registers); |
| + for (intptr_t reg_idx = 0; reg_idx < kNumberOfCpuRegisters; ++reg_idx) { |
| + Register reg = static_cast<Register>(reg_idx); |
| + if (locs->live_registers()->ContainsRegister(reg)) { |
| + __ Push(reg); |
| + } |
|
regis
2014/05/22 17:09:40
Is there a good reason for this change? It should
Cutch
2014/05/23 21:33:54
Yes, there was a very serious bug where the stackm
regis
2014/05/23 22:36:59
Cool you found it!
|
| } |
| } |
| void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) { |
| - // General purpose registers have the lowest register number at the |
| + // General purpose registers have the highest register number at the |
| // lowest address. |
| - const intptr_t cpu_registers = locs->live_registers()->cpu_registers(); |
| - ASSERT((cpu_registers & ~kAllCpuRegistersList) == 0); |
| - if (cpu_registers != 0) { |
| - __ PopList(cpu_registers); |
| + for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) { |
| + Register reg = static_cast<Register>(reg_idx); |
| + if (locs->live_registers()->ContainsRegister(reg)) { |
| + __ Pop(reg); |
| + } |
| } |
| const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount(); |