porffor 0.58.12 → 0.58.14

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.
@@ -821,11 +821,13 @@ export const BuiltinFuncs = function() {
821
821
  params: [ Valtype.i32 ],
822
822
  returns: [ Valtype.i32 ],
823
823
  returnType: TYPES.number,
824
- wasm: (scope, { allocPage }) => [
824
+ wasm: (scope, { allocLargePage, funcs }) => [
825
825
  [ Opcodes.local_get, 0 ],
826
- number(48, Valtype.i32),
826
+ [ null, () => [
827
+ number(funcs.bytesPerFuncLut(), Valtype.i32)
828
+ ] ],
827
829
  [ Opcodes.i32_mul ],
828
- [ Opcodes.i32_load16_u, 0, ...unsignedLEB128(allocPage(scope, 'func lut')) ]
830
+ [ Opcodes.i32_load16_u, 0, ...unsignedLEB128(allocLargePage(scope, 'func lut')) ]
829
831
  ],
830
832
  table: true
831
833
  };
@@ -834,13 +836,15 @@ export const BuiltinFuncs = function() {
834
836
  params: [ Valtype.i32 ],
835
837
  returns: [ Valtype.i32 ],
836
838
  returnType: TYPES.number,
837
- wasm: (scope, { allocPage }) => [
839
+ wasm: (scope, { allocLargePage, funcs }) => [
838
840
  [ Opcodes.local_get, 0 ],
839
- number(48, Valtype.i32),
841
+ [ null, () => [
842
+ number(funcs.bytesPerFuncLut(), Valtype.i32)
843
+ ] ],
840
844
  [ Opcodes.i32_mul ],
841
845
  number(2, Valtype.i32),
842
846
  [ Opcodes.i32_add ],
843
- [ Opcodes.i32_load8_u, 0, ...unsignedLEB128(allocPage(scope, 'func lut')) ]
847
+ [ Opcodes.i32_load8_u, 0, ...unsignedLEB128(allocLargePage(scope, 'func lut')) ]
844
848
  ],
845
849
  table: true
846
850
  };
@@ -849,13 +853,15 @@ export const BuiltinFuncs = function() {
849
853
  params: [ Valtype.i32 ],
850
854
  returns: [ Valtype.i32 ],
851
855
  returnType: TYPES.bytestring,
852
- wasm: (scope, { allocPage }) => [
856
+ wasm: (scope, { allocLargePage, funcs }) => [
853
857
  [ Opcodes.local_get, 0 ],
854
- number(48, Valtype.i32),
858
+ [ null, () => [
859
+ number(funcs.bytesPerFuncLut(), Valtype.i32)
860
+ ] ],
855
861
  [ Opcodes.i32_mul ],
856
862
  number(3, Valtype.i32),
857
863
  [ Opcodes.i32_add ],
858
- number(allocPage(scope, 'func lut'), Valtype.i32),
864
+ number(allocLargePage(scope, 'func lut'), Valtype.i32),
859
865
  [ Opcodes.i32_add ]
860
866
  ],
861
867
  table: true