| Index: runtime/vm/flow_graph_compiler_mips.cc
|
| diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
|
| index 34349845183428319eb334a29050b93f4c0be18f..c273ee80931b5288af03dffda5d42246fa079df2 100644
|
| --- a/runtime/vm/flow_graph_compiler_mips.cc
|
| +++ b/runtime/vm/flow_graph_compiler_mips.cc
|
| @@ -1470,6 +1470,7 @@ void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left,
|
| void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) {
|
| #if defined(DEBUG)
|
| locs->CheckWritableInputs();
|
| + ClobberDeadTempRegisters(locs);
|
| #endif
|
|
|
| __ TraceSimMsg("SaveLiveRegisters");
|
| @@ -1512,6 +1513,9 @@ 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.
|
| __ TraceSimMsg("RestoreLiveRegisters");
|
| @@ -1548,6 +1552,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())) {
|
| + __ LoadImmediate(tmp.reg(), 0xf7);
|
| + }
|
| + }
|
| +}
|
| +#endif
|
| +
|
| +
|
| void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data,
|
| Register class_id_reg,
|
| intptr_t argument_count,
|
|
|