* @param {number} ptr The pointer. Used to find both the slab and the offset in that slab. If the pointer * is just an integer, then this is almost redundant, but in general the pointer type * may in the future include information about which slab as well. So, for now it is
(ptr, pos, value, type)
| 505 | * @return {string} JS code for performing the memory set operation |
| 506 | */ |
| 507 | function makeSetValue(ptr, pos, value, type) { |
| 508 | var rtn = makeSetValueImpl(ptr, pos, value, type); |
| 509 | if (ASSERTIONS == 2 && (type.startsWith('i') || type.startsWith('u'))) { |
| 510 | const width = getBitWidth(type); |
| 511 | const assertion = `checkInt${width}(${value})`; |
| 512 | rtn += `;${assertion}`; |
| 513 | } |
| 514 | return rtn; |
| 515 | } |
| 516 | |
| 517 | function makeSetValueImpl(ptr, pos, value, type) { |
| 518 | if (type == 'i64' && !WASM_BIGINT) { |
no test coverage detected