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.
- package/compiler/assemble.js +5 -3
- package/compiler/builtins/console.ts +6 -1
- package/compiler/builtins/regexp.ts +427 -45
- package/compiler/builtins.js +15 -9
- package/compiler/builtins_precompiled.js +388 -351
- package/compiler/codegen.js +38 -26
- package/compiler/wrap.js +2 -2
- package/foo.js +4 -0
- package/package.json +1 -1
- package/runtime/index.js +1 -1
package/compiler/builtins.js
CHANGED
@@ -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, {
|
824
|
+
wasm: (scope, { allocLargePage, funcs }) => [
|
825
825
|
[ Opcodes.local_get, 0 ],
|
826
|
-
|
826
|
+
[ null, () => [
|
827
|
+
number(funcs.bytesPerFuncLut(), Valtype.i32)
|
828
|
+
] ],
|
827
829
|
[ Opcodes.i32_mul ],
|
828
|
-
[ Opcodes.i32_load16_u, 0, ...unsignedLEB128(
|
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, {
|
839
|
+
wasm: (scope, { allocLargePage, funcs }) => [
|
838
840
|
[ Opcodes.local_get, 0 ],
|
839
|
-
|
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(
|
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, {
|
856
|
+
wasm: (scope, { allocLargePage, funcs }) => [
|
853
857
|
[ Opcodes.local_get, 0 ],
|
854
|
-
|
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(
|
864
|
+
number(allocLargePage(scope, 'func lut'), Valtype.i32),
|
859
865
|
[ Opcodes.i32_add ]
|
860
866
|
],
|
861
867
|
table: true
|