[READ-ONLY] Mirror of https://github.com/CanadaHonk/porffor. An ahead-of-time JavaScript compiler porffor.dev
9

Configure Feed

Select the types of activity you want to include in your feed.

codegen: simplify tmp by rming TMP_TAG

Oliver Medhurst (Jul 19, 2026, 4:28 AM +0100) 3b628529 c934cf51

+1 -5
+1 -5
compiler/codegen.js
··· 120 120 return list; 121 121 }; 122 122 123 - const TMP_TAG = { 124 - [T.f64]: 'f', [T.i32]: 'i', [T.u32]: 'u', [T.i64]: 'q', [T.u64]: 'w', [T.jsval]: 'v', [T.ptr]: 'p' 125 - }; 126 - 127 123 // scratch temp from the per-type pool, minted on first use 128 124 const tmp = (scope, type = T.jsval, init = null) => { 129 125 const pool = scope.tmpPool[type] ??= []; 130 126 let name = pool.pop(); 131 127 if (name === undefined) { 132 - name = `#${TMP_TAG[type] ?? 'x'}${scope.tmpCount[type] = (scope.tmpCount[type] ?? 0) + 1}`; 128 + name = `#${type}${scope.tmpCount[type] = (scope.tmpCount[type] ?? 0) + 1}`; 133 129 scope.locals[name] = { type, temp: true }; 134 130 } 135 131 scope.tmpBusy.push({ name, type });