Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index 6875dcf5ab14de0c3ee2ce2a04f229cebc1e57b7..3d07d56375a09db964ad3b61f4217a1a496bd297 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -430,13 +430,22 @@ 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()->Map(), |
- miss_label, DO_SMI_CHECK); |
- } else { |
- ASSERT(HeapType::Any()->Is(field_type)); |
- __ JumpIfSmi(value_reg, miss_label); |
+ HeapType::Iterator<Map> it = field_type->Classes(); |
+ if (!it.Done()) { |
+ __ ldr(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
+ Label do_store; |
+ while (true) { |
+ __ CompareMap(scratch1, it.Current(), &do_store); |
+ it.Advance(); |
+ if (it.Done()) { |
+ __ b(ne, miss_label); |
+ break; |
+ } |
+ __ b(eq, &do_store); |
+ } |
+ __ bind(&do_store); |
} |
} else if (representation.IsDouble()) { |
Label do_store, heap_number; |
@@ -599,13 +608,22 @@ 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()->Map(), |
- miss_label, DO_SMI_CHECK); |
- } else { |
- ASSERT(HeapType::Any()->Is(field_type)); |
- __ JumpIfSmi(value_reg, miss_label); |
+ HeapType::Iterator<Map> it = field_type->Classes(); |
+ if (!it.Done()) { |
+ __ ldr(scratch1, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
+ Label do_store; |
+ while (true) { |
+ __ CompareMap(scratch1, it.Current(), &do_store); |
+ it.Advance(); |
+ if (it.Done()) { |
+ __ b(ne, miss_label); |
+ break; |
+ } |
+ __ b(eq, &do_store); |
+ } |
+ __ bind(&do_store); |
} |
} else if (representation.IsDouble()) { |
// Load the double storage. |