Index: src/x64/ic-x64.cc |
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc |
index 15f410c1345e8bbd4dc7db6a46494fa357763ed6..721ae1d982aa9279dff7845b326da554459de690 100644 |
--- a/src/x64/ic-x64.cc |
+++ b/src/x64/ic-x64.cc |
@@ -609,6 +609,21 @@ static void KeyedStoreGenerateGenericHelper( |
__ CompareRoot(rdi, Heap::kFixedArrayMapRootIndex); |
__ j(not_equal, fast_double); |
} |
+ |
+ // HOLECHECK: guards "A[i] = V" |
+ // We have to go to the runtime if the current value is the hole because |
+ // there may be a callback on the element |
+ Label holecheck_passed1; |
+ __ movq(kScratchRegister, FieldOperand(rbx, |
+ rcx, |
+ times_pointer_size, |
+ FixedArray::kHeaderSize)); |
+ __ CompareRoot(kScratchRegister, Heap::kTheHoleValueRootIndex); |
+ __ j(not_equal, &holecheck_passed1); |
+ __ JumpIfDictionaryInPrototypeChain(rdx, rdi, kScratchRegister, slow); |
+ |
+ __ bind(&holecheck_passed1); |
+ |
// Smi stores don't require further checks. |
Label non_smi_value; |
__ JumpIfNotSmi(rax, &non_smi_value); |
@@ -648,6 +663,15 @@ static void KeyedStoreGenerateGenericHelper( |
__ CompareRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex); |
__ j(not_equal, slow); |
} |
+ |
+ // HOLECHECK: guards "A[i] double hole?" |
+ // We have to see if the double version of the hole is present. If so |
+ // go to the runtime. |
+ uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32); |
+ __ cmpl(FieldOperand(rbx, rcx, times_8, offset), Immediate(kHoleNanUpper32)); |
+ __ j(not_equal, &fast_double_without_map_check); |
+ __ JumpIfDictionaryInPrototypeChain(rdx, rdi, kScratchRegister, slow); |
+ |
__ bind(&fast_double_without_map_check); |
__ StoreNumberToDoubleElements(rax, rbx, rcx, xmm0, |
&transition_double_elements); |