porffor 0.49.3 → 0.49.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/builtins_precompiled.js +156 -156
- package/compiler/codegen.js +2 -2
- package/compiler/wrap.js +4 -9
- package/package.json +1 -1
- package/runner/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -55,7 +55,7 @@ const funcRef = func => {
|
|
55
55
|
[ Opcodes.const, 'funcref', func.name ]
|
56
56
|
];
|
57
57
|
|
58
|
-
const wrapperArgc = Prefs.indirectWrapperArgc ??
|
58
|
+
const wrapperArgc = Prefs.indirectWrapperArgc ?? 10;
|
59
59
|
if (!func.wrapperFunc) {
|
60
60
|
const locals = {}, params = [];
|
61
61
|
for (let i = 0; i < wrapperArgc + 2; i++) {
|
@@ -2408,7 +2408,7 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2408
2408
|
funcs.table = true;
|
2409
2409
|
scope.table = true;
|
2410
2410
|
|
2411
|
-
const wrapperArgc = Prefs.indirectWrapperArgc ??
|
2411
|
+
const wrapperArgc = Prefs.indirectWrapperArgc ?? 10;
|
2412
2412
|
const underflow = wrapperArgc - args.length;
|
2413
2413
|
for (let i = 0; i < underflow; i++) args.push(DEFAULT_VALUE());
|
2414
2414
|
|
package/compiler/wrap.js
CHANGED
@@ -384,7 +384,7 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
384
384
|
|
385
385
|
const backtrace = (funcInd, blobOffset) => {
|
386
386
|
if (funcInd == null || blobOffset == null ||
|
387
|
-
Number.isNaN(funcInd) || Number.isNaN(blobOffset)) return false;
|
387
|
+
Number.isNaN(funcInd) || Number.isNaN(blobOffset) || Prefs.backtrace === false) return false;
|
388
388
|
|
389
389
|
// convert blob offset -> function wasm offset
|
390
390
|
const func = funcs.find(x => x.asmIndex === funcInd);
|
@@ -500,15 +500,10 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
500
500
|
continue;
|
501
501
|
}
|
502
502
|
|
503
|
-
const
|
504
|
-
|
505
|
-
|
506
|
-
const exp = instance.exports[x];
|
507
|
-
exports[func.name] = exp;
|
508
|
-
|
509
|
-
exports[func.name] = function() {
|
503
|
+
const wasm = instance.exports[x];
|
504
|
+
exports[x === 'm' ? 'main' : x] = function() {
|
510
505
|
try {
|
511
|
-
const ret =
|
506
|
+
const ret = wasm.apply(this, arguments);
|
512
507
|
if (ret == null) return undefined;
|
513
508
|
|
514
509
|
if (rawValues) return { value: ret[0], type: ret[1], js: porfToJSValue({ memory, funcs, pages }, ret[0], ret[1]) };
|
package/package.json
CHANGED