+ Label done = label();
+
+ m_byValCompilationInfo.append(ByValCompilationInfo(m_bytecodeOffset, badType, mode, done));
+}
+
+JIT::JumpList JIT::emitGenericContiguousPutByVal(Instruction* currentInstruction, PatchableJump& badType, IndexingType indexingShape)
+{
+ int base = currentInstruction[1].u.operand;
+ int value = currentInstruction[3].u.operand;
+ ArrayProfile* profile = currentInstruction[4].u.arrayProfile;
+
+ JumpList slowCases;
+
+ badType = patchableBranch32(NotEqual, regT1, TrustedImm32(ContiguousShape));
+
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT3);
+ Jump outOfBounds = branch32(AboveOrEqual, regT2, Address(regT3, Butterfly::offsetOfPublicLength()));
+
+ Label storeResult = label();
+ emitLoad(value, regT1, regT0);
+ switch (indexingShape) {
+ case Int32Shape:
+ slowCases.append(branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag)));
+ store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
+ store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
+ break;
+ case ContiguousShape:
+ store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)));
+ store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)));
+ emitLoad(base, regT2, regT3);
+ emitWriteBarrier(base, value, ShouldFilterValue);
+ break;
+ case DoubleShape: {
+ Jump notInt = branch32(NotEqual, regT1, TrustedImm32(JSValue::Int32Tag));
+ convertInt32ToDouble(regT0, fpRegT0);
+ Jump ready = jump();
+ notInt.link(this);
+ moveIntsToDouble(regT0, regT1, fpRegT0, fpRegT1);
+ slowCases.append(branchDouble(DoubleNotEqualOrUnordered, fpRegT0, fpRegT0));
+ ready.link(this);
+ storeDouble(fpRegT0, BaseIndex(regT3, regT2, TimesEight));
+ break;
+ }
+ default:
+ CRASH();
+ break;
+ }
+
+ Jump done = jump();
+
+ outOfBounds.link(this);
+ slowCases.append(branch32(AboveOrEqual, regT2, Address(regT3, Butterfly::offsetOfVectorLength())));
+
+ emitArrayProfileStoreToHoleSpecialCase(profile);
+
+ add32(TrustedImm32(1), regT2, regT1);
+ store32(regT1, Address(regT3, Butterfly::offsetOfPublicLength()));
+ jump().linkTo(storeResult, this);
+
+ done.link(this);
+
+ return slowCases;
+}
+
+JIT::JumpList JIT::emitArrayStoragePutByVal(Instruction* currentInstruction, PatchableJump& badType)
+{
+ int base = currentInstruction[1].u.operand;
+ int value = currentInstruction[3].u.operand;
+ ArrayProfile* profile = currentInstruction[4].u.arrayProfile;
+
+ JumpList slowCases;
+
+ badType = patchableBranch32(NotEqual, regT1, TrustedImm32(ArrayStorageShape));
+
+ loadPtr(Address(regT0, JSObject::butterflyOffset()), regT3);
+ slowCases.append(branch32(AboveOrEqual, regT2, Address(regT3, ArrayStorage::vectorLengthOffset())));
+
+ Jump empty = branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), TrustedImm32(JSValue::EmptyValueTag));