Index: src/ic/arm/handler-compiler-arm.cc |
diff --git a/src/ic/arm/handler-compiler-arm.cc b/src/ic/arm/handler-compiler-arm.cc |
index 9905e4eb7de75b4b38f659e91f58df62e3f53362..6af8bbc2e9bdc66143e9c4b5429e9e8302d8c277 100644 |
--- a/src/ic/arm/handler-compiler-arm.cc |
+++ b/src/ic/arm/handler-compiler-arm.cc |
@@ -377,13 +377,17 @@ void NamedStoreHandlerCompiler::GenerateConstantCheck(Register map_reg, |
void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
Register value_reg, |
Label* miss_label) { |
+ Register map_reg = scratch1(); |
+ Register scratch = scratch2(); |
+ DCHECK(!value_reg.is(map_reg)); |
+ DCHECK(!value_reg.is(scratch)); |
__ JumpIfSmi(value_reg, miss_label); |
HeapType::Iterator<Map> it = field_type->Classes(); |
if (!it.Done()) { |
- __ ldr(scratch1(), FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
+ __ ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
Label do_store; |
while (true) { |
- __ CompareMap(scratch1(), it.Current(), &do_store); |
+ __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
it.Advance(); |
if (it.Done()) { |
__ b(ne, miss_label); |