Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler.cc |
| diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc |
| index 6b4f67d46937bc78ba56db36a2463267a6c9c232..9a4897da711297dd40d1c6a7b3ee9748c3d7cc4b 100644 |
| --- a/runtime/vm/flow_graph_compiler.cc |
| +++ b/runtime/vm/flow_graph_compiler.cc |
| @@ -455,10 +455,15 @@ void FlowGraphCompiler::AddDeoptIndexAtCall(intptr_t deopt_id, |
| // and FlowGraphCompiler::SlowPathEnvironmentFor. |
| void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { |
| if (is_optimizing()) { |
| + RegisterSet* registers = locs->live_registers(); |
| + ASSERT(registers != NULL); |
| + const intptr_t kFpuRegisterSpillFactor = |
| + kFpuRegisterSize / kWordSize; |
| + const intptr_t live_registers_size = registers->CpuRegisterCount() + |
| + (registers->FpuRegisterCount() * kFpuRegisterSpillFactor); |
| BitmapBuilder* bitmap = locs->stack_bitmap(); |
| ASSERT(bitmap != NULL); |
| - ASSERT(bitmap->Length() <= StackSize()); |
| - // Pad the bitmap out to describe all the spill slots. |
| + ASSERT(bitmap->Length() <= (StackSize() + live_registers_size)); |
|
Florian Schneider
2014/02/06 12:38:49
We should comment what's going on here:
Maybe add
Cutch
2014/02/06 23:15:38
Done.
|
| bitmap->SetLength(StackSize()); |
| // Mark the bits in the stack map in the same order we push registers in |
| @@ -475,8 +480,6 @@ void FlowGraphCompiler::RecordSafepoint(LocationSummary* locs) { |
| // |
| // FPU registers have the highest register number at the highest |
| // address (i.e., first in the stackmap). |
| - const intptr_t kFpuRegisterSpillFactor = |
| - kFpuRegisterSize / kWordSize; |
| for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) { |
| FpuRegister reg = static_cast<FpuRegister>(i); |
| if (regs->ContainsFpuRegister(reg)) { |