| 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 9f2941ae4a022a4a1c5aa8aaee631e66fb33c5f1..b036d22537d58929028cd59c02aa607e9ffae7e2 100644
|
| --- a/runtime/vm/flow_graph_compiler_arm.cc
|
| +++ b/runtime/vm/flow_graph_compiler_arm.cc
|
| @@ -1425,6 +1425,7 @@ void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
|
| void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
|
| #if defined(DEBUG)
|
| locs->CheckWritableInputs();
|
| + ClobberDeadTempRegisters(locs);
|
| #endif
|
|
|
| // TODO(vegorov): consider saving only caller save (volatile) registers.
|
| @@ -1463,6 +1464,10 @@ void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
|
|
|
|
|
| void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
|
| +#if defined(DEBUG)
|
| + ClobberDeadTempRegisters(locs);
|
| +#endif
|
| +
|
| // General purpose registers have the highest register number at the
|
| // lowest address.
|
| for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
|
| @@ -1493,6 +1498,21 @@ void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
|
| }
|
|
|
|
|
| +#if defined(DEBUG)
|
| +void FlowGraphCompiler::ClobberDeadTempRegisters(LocationSummary* locs) {
|
| + // Clobber temporaries that have not been manually preserved.
|
| + for (intptr_t i = 0; i < locs->temp_count(); ++i) {
|
| + Location tmp = locs->temp(i);
|
| + // TODO(zerny): clobber non-live temporary FPU registers.
|
| + if (tmp.IsRegister() &&
|
| + !locs->live_registers()->ContainsRegister(tmp.reg())) {
|
| + __ mov(tmp.reg(), Operand(0xf7));
|
| + }
|
| + }
|
| +}
|
| +#endif
|
| +
|
| +
|
| void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
| Register class_id_reg,
|
| intptr_t argument_count,
|
|
|