Index: runtime/vm/intermediate_language.cc |
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc |
index e23603fb493170adaf9683639b5a2d613187e894..a65c8234aff5a3df1fc39c984d59b21bc693fbd7 100644 |
--- a/runtime/vm/intermediate_language.cc |
+++ b/runtime/vm/intermediate_language.cc |
@@ -2281,6 +2281,11 @@ void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
// FlowGraphCompiler::SlowPathEnvironmentFor(). |
void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots, |
intptr_t* cpu_reg_slots) { |
+ if (registers_remapped_) { |
+ return; |
+ } |
+ registers_remapped_ = true; |
+ |
for (intptr_t i = 0; i < InputCount(); i++) { |
Location loc = LocationAt(i); |
if (loc.IsRegister()) { |
@@ -2305,11 +2310,10 @@ void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots, |
} |
} else if (loc.IsPairLocation()) { |
UNREACHABLE(); |
- } else if (loc.IsInvalid()) { |
- // We currently only perform one iteration of allocation |
- // sinking, so we do not expect to find materialized objects |
- // here. |
- ASSERT(!InputAt(i)->definition()->IsMaterializeObject()); |
+ } else if (loc.IsInvalid() && |
+ InputAt(i)->definition()->IsMaterializeObject()) { |
+ InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters( |
+ fpu_reg_slots, cpu_reg_slots); |
} |
} |
} |