(label, buffer)
| 41 | // [5] payload length offset 20 |
| 42 | // [6] payload checksum offset 24 |
| 43 | function dumpBytecodeHeader (label, buffer) { |
| 44 | const names = [ |
| 45 | 'magic @0 ', |
| 46 | 'versionHash @4 ', |
| 47 | 'sourceHash @8 ', |
| 48 | 'flagHash @12', |
| 49 | 'roChecksum @16', |
| 50 | 'payloadLen @20', |
| 51 | 'checksum @24' |
| 52 | ]; |
| 53 | const lines = [`[bytenode] ${label} (buffer length = ${buffer.length})`]; |
| 54 | for (let i = 0; i < names.length; i++) { |
| 55 | const off = i * 4; |
| 56 | if (off + 4 > buffer.length) break; |
| 57 | const v = buffer.readUInt32LE(off); |
| 58 | lines.push(` ${names[i]} = 0x${v.toString(16).padStart(8, '0')} (${v})`); |
| 59 | } |
| 60 | console.error(lines.join('\n')); |
| 61 | } |
| 62 | |
| 63 | function generateScript (cachedData, filename) { |
| 64 | if (!isBufferV8Bytecode(cachedData)) { |
no outgoing calls
no test coverage detected
searching dependent graphs…