Lines Matching refs:wasm

21   const capi = sqlite3.capi, wasm = sqlite3.wasm, util = sqlite3.util;
71 wasm.installFunction('i(ippp)', function(t,c,p,x){
75 wasm.cstringToJs(x));
139 let fnJs = ('number'===typeof fn) ? wasm.cstringToJs(fn) : fn;
152 const stack = wasm.pstack.pointer;
154 const pPtr = wasm.pstack.allocPtr() /* output (sqlite3**) arg */;
156 pDb = wasm.getPtrValue(pPtr);
175 wasm.pstack.restore(stack);
300 if(wasm.bigIntEnabled){
577 try{ rc = wasm.cstringToJs(v.$zName) }
606 const stack = wasm.pstack.pointer;
609 ppStmt = wasm.pstack.alloc(8)/* output (sqlite3_stmt**) arg */;
611 pStmt = wasm.getPtrValue(ppStmt);
614 wasm.pstack.restore(stack);
774 const stack = wasm.scopedAllocPush();
782 let sqlByteLen = isTA ? arg.sql.byteLength : wasm.jstrlen(arg.sql);
783 const ppStmt = wasm.scopedAlloc(/* output (sqlite3_stmt**) arg and pzTail */
784 (2 * wasm.ptrSizeof)
786 const pzTail = ppStmt + wasm.ptrSizeof /* final arg to sqlite3_prepare_v2() */;
787 let pSql = pzTail + wasm.ptrSizeof;
789 if(isTA) wasm.heap8().set(arg.sql, pSql);
790 else wasm.jstrcpy(arg.sql, wasm.heap8(), pSql, sqlByteLen, false);
791 wasm.setMemValue(pSql + sqlByteLen, 0/*NUL terminator*/);
792 while(pSql && wasm.getMemValue(pSql, 'i8')
800 wasm.setPtrValue(ppStmt, 0);
801 wasm.setPtrValue(pzTail, 0);
805 const pStmt = wasm.getPtrValue(ppStmt);
806 pSql = wasm.getPtrValue(pzTail);
845 wasm.scopedAllocPop(stack);
1157 if(wasm.bigIntEnabled) return t;
1227 const stack = wasm.scopedAllocPush();
1229 const n = wasm.jstrlen(val);
1230 const pStr = wasm.scopedAlloc(n);
1231 wasm.jstrcpy(val, wasm.heap8u(), pStr, n, false);
1235 wasm.scopedAllocPop(stack);
1238 const bytes = wasm.jstrToUintArray(val,false);
1239 const pStr = wasm.alloc(bytes.length || 1);
1240 wasm.heap8u().set(bytes.length ? bytes : [0], pStr);
1245 wasm.dealloc(pStr);
1267 }else if(wasm.bigIntEnabled){
1277 if(wasm.bigIntEnabled && Number.isInteger(val)){
1297 const stack = wasm.scopedAllocPush();
1299 const pBlob = wasm.scopedAlloc(val.byteLength || 1);
1300 wasm.heap8().set(val.byteLength ? val : [0], pBlob)
1304 wasm.scopedAllocPop(stack);
1307 const pBlob = wasm.allocFromTypedArray(val);
1312 wasm.dealloc(pBlob);
1626 if(wasm.bigIntEnabled){
1658 if(n) rc.set(wasm.heap8u().slice(ptr, ptr+n), 0);