Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index c034b223d840edaf224b618086b1e8e8a27331af..a5968485141cb4e37977506a9fa7b96fbb5aeda0 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -5173,6 +5173,15 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Load the PropertyCell at the specified slot. |
__ mov(cell_reg, ContextOperand(context_reg, slot_reg)); |
+ // Check that cell value is not the_hole. |
+ { |
+ // TODO(bmeurer): use ecx (name_reg) when name parameter is removed. |
+ Register cell_value_reg = cell_details_reg; |
+ __ mov(cell_value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset)); |
+ __ CompareRoot(cell_value_reg, Heap::kTheHoleValueRootIndex); |
+ __ j(equal, &slow_case, FLAG_debug_code ? Label::kFar : Label::kNear); |
+ } |
+ |
// Load PropertyDetails for the cell (actually only the cell_type and kind). |
__ mov(cell_details_reg, |
FieldOperand(cell_reg, PropertyCell::kDetailsOffset)); |
@@ -5240,6 +5249,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Now either both old and new values must be SMIs or both must be heap |
// objects with same map. |
Label value_is_heap_object; |
+ // TODO(bmeurer): use ecx (name_reg) when name parameter is removed. |
Register cell_value_reg = cell_details_reg; |
__ mov(cell_value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset)); |
__ JumpIfNotSmi(value_reg, &value_is_heap_object, Label::kNear); |