+ ArrayProfile* profile = currentInstruction[4].u.arrayProfile;
+ ASSERT(isFloat(type));
+
+ int value = currentInstruction[3].u.operand;
+
+#if USE(JSVALUE64)
+ RegisterID base = regT0;
+ RegisterID property = regT1;
+ RegisterID earlyScratch = regT3;
+ RegisterID lateScratch = regT2;
+#else
+ RegisterID base = regT0;
+ RegisterID property = regT2;
+ RegisterID earlyScratch = regT3;
+ RegisterID lateScratch = regT1;
+#endif
+
+ JumpList slowCases;
+
+ load8(Address(base, JSCell::typeInfoTypeOffset()), earlyScratch);
+ badType = patchableBranch32(NotEqual, earlyScratch, TrustedImm32(typeForTypedArrayType(type)));
+ Jump inBounds = branch32(Below, property, Address(base, JSArrayBufferView::offsetOfLength()));
+ emitArrayProfileOutOfBoundsSpecialCase(profile);
+ Jump done = jump();
+ inBounds.link(this);
+
+#if USE(JSVALUE64)
+ emitGetVirtualRegister(value, earlyScratch);
+ Jump doubleCase = emitJumpIfNotImmediateInteger(earlyScratch);
+ convertInt32ToDouble(earlyScratch, fpRegT0);
+ Jump ready = jump();
+ doubleCase.link(this);
+ slowCases.append(emitJumpIfNotImmediateNumber(earlyScratch));
+ add64(tagTypeNumberRegister, earlyScratch);
+ move64ToDouble(earlyScratch, fpRegT0);
+ ready.link(this);
+#else
+ emitLoad(value, lateScratch, earlyScratch);
+ Jump doubleCase = branch32(NotEqual, lateScratch, TrustedImm32(JSValue::Int32Tag));
+ convertInt32ToDouble(earlyScratch, fpRegT0);
+ Jump ready = jump();
+ doubleCase.link(this);
+ slowCases.append(branch32(Above, lateScratch, TrustedImm32(JSValue::LowestTag)));
+ moveIntsToDouble(earlyScratch, lateScratch, fpRegT0, fpRegT1);
+ ready.link(this);
+#endif
+
+ // We would be loading this into base as in get_by_val, except that the slow
+ // path expects the base to be unclobbered.
+ loadPtr(Address(base, JSArrayBufferView::offsetOfVector()), lateScratch);
+
+ switch (elementSize(type)) {
+ case 4:
+ convertDoubleToFloat(fpRegT0, fpRegT0);
+ storeFloat(fpRegT0, BaseIndex(lateScratch, property, TimesFour));
+ break;
+ case 8:
+ storeDouble(fpRegT0, BaseIndex(lateScratch, property, TimesEight));
+ break;
+ default:
+ CRASH();
+ }