Index: src/arm64/stub-cache-arm64.cc |
diff --git a/src/arm64/stub-cache-arm64.cc b/src/arm64/stub-cache-arm64.cc |
index aed9af998f631201240eb630b917788813bdb15b..e5383f166dbe21ff085ce286e3c69c8461851974 100644 |
--- a/src/arm64/stub-cache-arm64.cc |
+++ b/src/arm64/stub-cache-arm64.cc |
@@ -392,7 +392,14 @@ void StoreStubCompiler::GenerateStoreTransition(MacroAssembler* masm, |
} else if (representation.IsSmi()) { |
__ JumpIfNotSmi(value_reg, miss_label); |
} else if (representation.IsHeapObject()) { |
- __ JumpIfSmi(value_reg, miss_label); |
+ HeapType* field_type = descriptors->GetFieldType(descriptor); |
+ if (field_type->IsClass()) { |
+ __ CheckMap(value_reg, scratch1, field_type->AsClass(), |
+ miss_label, DO_SMI_CHECK); |
+ } else { |
+ ASSERT(HeapType::Any()->Is(field_type)); |
+ __ JumpIfSmi(value_reg, miss_label); |
+ } |
} else if (representation.IsDouble()) { |
UseScratchRegisterScope temps(masm); |
DoubleRegister temp_double = temps.AcquireD(); |
@@ -541,7 +548,14 @@ void StoreStubCompiler::GenerateStoreField(MacroAssembler* masm, |
if (representation.IsSmi()) { |
__ JumpIfNotSmi(value_reg, miss_label); |
} else if (representation.IsHeapObject()) { |
- __ JumpIfSmi(value_reg, miss_label); |
+ HeapType* field_type = lookup->GetFieldType(); |
+ if (field_type->IsClass()) { |
+ __ CheckMap(value_reg, scratch1, field_type->AsClass(), |
+ miss_label, DO_SMI_CHECK); |
+ } else { |
+ ASSERT(HeapType::Any()->Is(field_type)); |
+ __ JumpIfSmi(value_reg, miss_label); |
+ } |
} else if (representation.IsDouble()) { |
UseScratchRegisterScope temps(masm); |
DoubleRegister temp_double = temps.AcquireD(); |