Index: src/ic/ia32/handler-compiler-ia32.cc |
diff --git a/src/ic/ia32/handler-compiler-ia32.cc b/src/ic/ia32/handler-compiler-ia32.cc |
index 90512e9bc8797514b401d0cbe0d32e4b2c98a853..bbb922eff9c7db0a544d8faeec3b1a519ae39cda 100644 |
--- a/src/ic/ia32/handler-compiler-ia32.cc |
+++ b/src/ic/ia32/handler-compiler-ia32.cc |
@@ -385,12 +385,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()) { |
Label do_store; |
+ __ mov(map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
while (true) { |
- __ CompareMap(value_reg, it.Current()); |
+ __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
it.Advance(); |
if (it.Done()) { |
__ j(not_equal, miss_label); |