(ptr, pos, type)
| 476 | |
| 477 | // See makeSetValue |
| 478 | function makeGetValue(ptr, pos, type) { |
| 479 | assert(arguments.length == 3, 'makeGetValue expects 3 arguments'); |
| 480 | |
| 481 | const offset = calcFastOffset(ptr, pos); |
| 482 | if (type === 'i53' || type === 'u53') { |
| 483 | // Set `unsigned` based on the type name. |
| 484 | const unsigned = type.startsWith('u'); |
| 485 | return `readI53From${unsigned ? 'U' : 'I'}64(${offset})`; |
| 486 | } |
| 487 | |
| 488 | const slab = getHeapForType(type); |
| 489 | let ret = `${slab}[${getHeapOffset(offset, type)}]`; |
| 490 | if (MEMORY64 && isPointerType(type)) { |
| 491 | ret = `Number(${ret})`; |
| 492 | } |
| 493 | return ret; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * @param {number} ptr The pointer. Used to find both the slab and the offset in that slab. If the pointer |
no test coverage detected