Index: src/ic/arm64/handler-compiler-arm64.cc |
diff --git a/src/ic/arm64/handler-compiler-arm64.cc b/src/ic/arm64/handler-compiler-arm64.cc |
index 1c28bf51a215ac265a891e37b6cae695efe9d147..7c198d40a626e6f35e08146ac6098f427cb4f9bb 100644 |
--- a/src/ic/arm64/handler-compiler-arm64.cc |
+++ b/src/ic/arm64/handler-compiler-arm64.cc |
@@ -427,13 +427,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()); |
+ __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
it.Advance(); |
if (it.Done()) { |
__ B(ne, miss_label); |