porffor 0.18.32 → 0.18.34

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.
@@ -1042,6 +1042,141 @@ export const __ByteString_prototype_trim = (_this: bytestring) => {
1042
1042
  };
1043
1043
 
1044
1044
 
1045
+ export const __String_prototype_concat = (_this: string, ...vals: any[]) => {
1046
+ // todo/perf: rewrite to use memory.copy?
1047
+ let out: string = Porffor.allocate();
1048
+ out += _this;
1049
+
1050
+ const valsLen: i32 = vals.length;
1051
+ for (let i: i32 = 0; i < valsLen; i++) {
1052
+ let x: any;
1053
+ Porffor.wasm`
1054
+ local.get ${vals}
1055
+ local.get ${i}
1056
+ i32.const 9
1057
+ i32.mul
1058
+ i32.add
1059
+ f64.load 0 4
1060
+
1061
+ local.get ${vals}
1062
+ local.get ${i}
1063
+ i32.const 9
1064
+ i32.mul
1065
+ i32.add
1066
+ i32.load8_u 0 12
1067
+
1068
+ call __ecma262_ToString
1069
+ local.set ${x+1}
1070
+ i32.trunc_sat_f64_u
1071
+ local.set ${x}`;
1072
+
1073
+ out += x;
1074
+ }
1075
+
1076
+ return out;
1077
+ };
1078
+
1079
+ export const __ByteString_prototype_concat = (_this: bytestring, ...vals: any[]) => {
1080
+ // todo/perf: rewrite to use memory.copy?
1081
+ let out: string = Porffor.allocate();
1082
+ out += _this;
1083
+
1084
+ const valsLen: i32 = vals.length;
1085
+ for (let i: i32 = 0; i < valsLen; i++) {
1086
+ let x: any;
1087
+ Porffor.wasm`
1088
+ local.get ${vals}
1089
+ local.get ${i}
1090
+ i32.const 9
1091
+ i32.mul
1092
+ i32.add
1093
+ f64.load 0 4
1094
+
1095
+ local.get ${vals}
1096
+ local.get ${i}
1097
+ i32.const 9
1098
+ i32.mul
1099
+ i32.add
1100
+ i32.load8_u 0 12
1101
+
1102
+ call __ecma262_ToString
1103
+ local.set ${x+1}
1104
+ i32.trunc_sat_f64_u
1105
+ local.set ${x}`;
1106
+
1107
+ out += x;
1108
+ }
1109
+
1110
+ return out;
1111
+ };
1112
+
1113
+ export const __String_prototype_repeat = (_this: string, count: number) => {
1114
+ let out: string = Porffor.allocate();
1115
+
1116
+ count |= 0;
1117
+ if (count < 0) throw new RangeError('Invalid count value');
1118
+
1119
+ const thisLen: i32 = _this.length * 2;
1120
+ for (let i: i32 = 0; i < count; i++) {
1121
+ Porffor.wasm`
1122
+ ;; dst = out + 4 + i * thisLen
1123
+ local.get ${out}
1124
+ i32.const 4
1125
+ i32.add
1126
+ local.get ${i}
1127
+ local.get ${thisLen}
1128
+ i32.mul
1129
+ i32.add
1130
+
1131
+ ;; src = this + 4
1132
+ local.get ${_this}
1133
+ i32.const 4
1134
+ i32.add
1135
+
1136
+ ;; size = thisLen
1137
+ local.get ${thisLen}
1138
+
1139
+ memory.copy 0 0`;
1140
+ }
1141
+
1142
+ Porffor.wasm.i32.store(out, thisLen * count, 0, 0);
1143
+ return out;
1144
+ };
1145
+
1146
+ export const __ByteString_prototype_repeat = (_this: string, count: number) => {
1147
+ let out: bytestring = Porffor.allocate();
1148
+
1149
+ count |= 0;
1150
+ if (count < 0) throw new RangeError('Invalid count value');
1151
+
1152
+ const thisLen: i32 = _this.length;
1153
+ for (let i: i32 = 0; i < count; i++) {
1154
+ Porffor.wasm`
1155
+ ;; dst = out + 4 + i * thisLen
1156
+ local.get ${out}
1157
+ i32.const 4
1158
+ i32.add
1159
+ local.get ${i}
1160
+ local.get ${thisLen}
1161
+ i32.mul
1162
+ i32.add
1163
+
1164
+ ;; src = this + 4
1165
+ local.get ${_this}
1166
+ i32.const 4
1167
+ i32.add
1168
+
1169
+ ;; size = thisLen
1170
+ local.get ${thisLen}
1171
+
1172
+ memory.copy 0 0`;
1173
+ }
1174
+
1175
+ Porffor.wasm.i32.store(out, thisLen * count, 0, 0);
1176
+ return out;
1177
+ };
1178
+
1179
+
1045
1180
  // 22.1.3.29 String.prototype.toString ()
1046
1181
  // https://tc39.es/ecma262/#sec-string.prototype.tostring
1047
1182
  export const __String_prototype_toString = (_this: string) => {
@@ -263,7 +263,7 @@ export const BuiltinFuncs = function() {
263
263
 
264
264
 
265
265
  this.__Porffor_print = {
266
- params: [ valtypeBinary, Valtype.i32 ],
266
+ params: [ globalThis.precompile ? Valtype.f64 : valtypeBinary, Valtype.i32 ],
267
267
  typedParams: true,
268
268
  locals: [ Valtype.i32, Valtype.i32 ],
269
269
  returns: [],
@@ -189,7 +189,14 @@ const generate = (scope, decl, global = false, name = undefined, valueUnused = f
189
189
  if (!Array.isArray(inst)) inst = [ inst ];
190
190
  const immediates = asm.slice(1).map(x => {
191
191
  const int = parseInt(x);
192
- if (Number.isNaN(int)) return scope.locals[x]?.idx ?? globals[x].idx;
192
+ if (Number.isNaN(int)) {
193
+ if (builtinFuncs[x]) {
194
+ if (funcIndex[x] == null) includeBuiltin(scope, x);
195
+ return funcIndex[x];
196
+ }
197
+
198
+ return scope.locals[x]?.idx ?? globals[x].idx;
199
+ }
193
200
  return int;
194
201
  });
195
202
 
@@ -4737,7 +4744,7 @@ const internalConstrs = {
4737
4744
 
4738
4745
  // print space
4739
4746
  ...(i !== decl.arguments.length - 1 ? [
4740
- ...number(32),
4747
+ ...number(32, globalThis.precompile ? Valtype.f64 : valtypeBinary),
4741
4748
  [ Opcodes.call, importedFuncs.printChar ]
4742
4749
  ] : [])
4743
4750
  );
@@ -4745,7 +4752,7 @@ const internalConstrs = {
4745
4752
 
4746
4753
  // print newline
4747
4754
  out.push(
4748
- ...number(10),
4755
+ ...number(10, globalThis.precompile ? Valtype.f64 : valtypeBinary),
4749
4756
  [ Opcodes.call, importedFuncs.printChar ]
4750
4757
  );
4751
4758
 
@@ -1662,6 +1662,32 @@ export const BuiltinFuncs = function() {
1662
1662
  returns: [127,127], typedReturns: 1,
1663
1663
  locals: [127], localNames: ["_this","_this#type","#last_type"],
1664
1664
  };
1665
+ this.__String_prototype_concat = {
1666
+ wasm: (scope, {builtin}) => [[16, builtin('__Porffor_allocate')],[33,5],[252,2],[34,4],[32,0],[33,6],[33,9],[65,1],[64,0],[65,128,128,4],[108],[34,10],[32,9],[40,0,0],[34,8],[32,6],[40,0,0],[34,7],[106],[54,1,0],[32,10],[65,4],[106],[32,9],[65,4],[106],[65,252,255,3],[252,10,0,0],[32,10],[65,4],[106],[32,8],[65,2],[108],[106],[32,6],[65,4],[106],[32,7],[65,2],[108],[252,10,0,0],[65,194,0],[33,5],[32,10],[33,4],[32,2],[40,1,0],[33,11],[65,0],[33,12],[3,64],[32,12],[32,11],[72],[4,64],[32,2],[32,12],[65,9],[108],[106],[43,0,4],[32,2],[32,12],[65,9],[108],[106],[45,0,12],[16, builtin('__ecma262_ToString')],[33,14],[252,3],[33,13],[32,4],[32,13],[33,6],[33,9],[65,1],[64,0],[65,128,128,4],[108],[34,10],[32,9],[40,0,0],[34,8],[32,6],[40,0,0],[34,7],[106],[54,1,0],[65,194,0],[65,194,1],[70],[4,64],[32,9],[32,8],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[32,14],[65,194,1],[70],[4,64],[32,6],[32,7],[16, builtin('__Porffor_bytestringToString')],[33,6],[11],[32,10],[65,4],[106],[32,9],[65,4],[106],[65,252,255,3],[252,10,0,0],[32,10],[65,4],[106],[32,8],[65,2],[108],[106],[32,6],[65,4],[106],[32,7],[65,2],[108],[252,10,0,0],[65,194,0],[33,5],[32,10],[33,4],[32,12],[65,1],[106],[33,12],[12,1],[11],[11],[32,4],[65,194,0],[15]],
1667
+ params: [127,127,127,127], typedParams: 1,
1668
+ returns: [127,127], typedReturns: 1,
1669
+ locals: [127,127,127,127,127,127,127,127,127,127,127], localNames: ["_this","_this#type","vals","vals#type","out","#last_type","concat_right_pointer","concat_right_length","concat_left_length","concat_left_pointer","concat_out_pointer","valsLen","i","x","x#type"],
1670
+ hasRestArgument: 1,
1671
+ };
1672
+ this.__ByteString_prototype_concat = {
1673
+ wasm: (scope, {builtin}) => [[16, builtin('__Porffor_allocate')],[33,5],[252,2],[34,4],[32,0],[33,6],[33,9],[65,1],[64,0],[65,128,128,4],[108],[34,10],[32,9],[40,0,0],[34,8],[32,6],[40,0,0],[34,7],[106],[54,1,0],[65,194,0],[65,194,1],[70],[4,64],[32,9],[32,8],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[65,194,1],[65,194,1],[70],[4,64],[32,6],[32,7],[16, builtin('__Porffor_bytestringToString')],[33,6],[11],[32,10],[65,4],[106],[32,9],[65,4],[106],[65,252,255,3],[252,10,0,0],[32,10],[65,4],[106],[32,8],[65,2],[108],[106],[32,6],[65,4],[106],[32,7],[65,2],[108],[252,10,0,0],[65,194,0],[33,5],[32,10],[33,4],[32,2],[40,1,0],[33,11],[65,0],[33,12],[3,64],[32,12],[32,11],[72],[4,64],[32,2],[32,12],[65,9],[108],[106],[43,0,4],[32,2],[32,12],[65,9],[108],[106],[45,0,12],[16, builtin('__ecma262_ToString')],[33,14],[252,3],[33,13],[32,4],[32,13],[33,6],[33,9],[65,1],[64,0],[65,128,128,4],[108],[34,10],[32,9],[40,0,0],[34,8],[32,6],[40,0,0],[34,7],[106],[54,1,0],[65,194,0],[65,194,1],[70],[4,64],[32,9],[32,8],[16, builtin('__Porffor_bytestringToString')],[33,9],[11],[32,14],[65,194,1],[70],[4,64],[32,6],[32,7],[16, builtin('__Porffor_bytestringToString')],[33,6],[11],[32,10],[65,4],[106],[32,9],[65,4],[106],[65,252,255,3],[252,10,0,0],[32,10],[65,4],[106],[32,8],[65,2],[108],[106],[32,6],[65,4],[106],[32,7],[65,2],[108],[252,10,0,0],[65,194,0],[33,5],[32,10],[33,4],[32,12],[65,1],[106],[33,12],[12,1],[11],[11],[32,4],[65,194,0],[15]],
1674
+ params: [127,127,127,127], typedParams: 1,
1675
+ returns: [127,127], typedReturns: 1,
1676
+ locals: [127,127,127,127,127,127,127,127,127,127,127], localNames: ["_this","_this#type","vals","vals#type","out","#last_type","concat_right_pointer","concat_right_length","concat_left_length","concat_left_pointer","concat_out_pointer","valsLen","i","x","x#type"],
1677
+ hasRestArgument: 1,
1678
+ };
1679
+ this.__String_prototype_repeat = {
1680
+ wasm: (scope, {builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,5],[252,2],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[4,64],...internalThrow(scope, 'RangeError', `Invalid count value`),[11],[32,0],[40,1,0],[65,2],[108],[33,6],[65,0],[33,7],[3,64],[32,7],[32,2],[72],[4,64],[32,4],[65,4],[106],[32,7],[32,6],[108],[106],[32,0],[65,4],[106],[32,6],[252,10,0,0],[32,7],[65,1],[106],[33,7],[12,1],[11],[11],[32,4],[32,6],[32,2],[108],[54,0,0],[32,4],[65,194,0],[15]],
1681
+ params: [127,127,127,127], typedParams: 1,
1682
+ returns: [127,127], typedReturns: 1,
1683
+ locals: [127,127,127,127], localNames: ["_this","_this#type","count","count#type","out","#last_type","thisLen","i"],
1684
+ };
1685
+ this.__ByteString_prototype_repeat = {
1686
+ wasm: (scope, {builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,5],[252,2],[33,4],[32,2],[65,0],[114],[34,2],[65,0],[72],[4,64],...internalThrow(scope, 'RangeError', `Invalid count value`),[11],[32,0],[40,1,0],[33,6],[65,0],[33,7],[3,64],[32,7],[32,2],[72],[4,64],[32,4],[65,4],[106],[32,7],[32,6],[108],[106],[32,0],[65,4],[106],[32,6],[252,10,0,0],[32,7],[65,1],[106],[33,7],[12,1],[11],[11],[32,4],[32,6],[32,2],[108],[54,0,0],[32,4],[65,194,1],[15]],
1687
+ params: [127,127,127,127], typedParams: 1,
1688
+ returns: [127,127], typedReturns: 1,
1689
+ locals: [127,127,127,127], localNames: ["_this","_this#type","count","count#type","out","#last_type","thisLen","i"],
1690
+ };
1665
1691
  this.__String_prototype_toString = {
1666
1692
  wasm: (scope, {}) => [[32,0],[65,194,0],[15]],
1667
1693
  params: [127,127], typedParams: 1,
@@ -3808,7 +3834,7 @@ export const BuiltinFuncs = function() {
3808
3834
  locals: [124], localNames: ["argument","argument#type","number"],
3809
3835
  };
3810
3836
  this.__ecma262_ToString = {
3811
- wasm: (scope, {allocPage,builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,3],[33,2],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[34,4],[68,0,0,0,0,0,128,80,64],[97],[32,4],[68,0,0,0,0,0,64,104,64],[97],[114],[4,64],[32,0],[32,1],[15],[11],[32,4],[68,0,0,0,0,0,0,24,64],[97],[4,64],...internalThrow(scope, 'TypeError', `Cannot convert a Symbol value to a string`),[11],[32,4],[68,0,0,0,0,0,0,8,64],[97],[4,64],...number(allocPage(scope, 'bytestring: __ecma262_ToString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,16,64],[97],[32,0],[68,0,0,0,0,0,0,0,0],[97],[113],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,238,0],[58,0,4],[32,5],[65,245,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,236,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,0],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,244,0],[58,0,4],[32,5],[65,242,0],[58,0,5],[32,5],[65,245,0],[58,0,6],[32,5],[65,229,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,2],[252,3],[34,5],[65,5],[54,1,0],[32,5],[65,230,0],[58,0,4],[32,5],[65,225,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,243,0],[58,0,7],[32,5],[65,229,0],[58,0,8],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,0],[33,6],[32,1],[34,7],[33,8],[2,124],[32,8],[65,0],[70],[4,64,"TYPESWITCH|Number"],[32,6],[32,7],[68,0,0,0,0,0,0,0,0],[65,3],[16, builtin('__Number_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,1],[70],[4,64,"TYPESWITCH|Boolean"],[32,6],[32,7],[16, builtin('__Boolean_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,4],[70],[4,64,"TYPESWITCH|Object"],[32,6],[32,7],[16, builtin('__Object_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,6],[32,7],[16, builtin('__Function_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,6],[70],[4,64,"TYPESWITCH|Symbol"],[32,6],[32,7],[16, builtin('__Symbol_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,18],[70],[4,64,"TYPESWITCH|Date"],[32,6],[32,7],[16, builtin('__Date_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,6],[32,7],[16, builtin('__Set_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,6],[32,7],[16, builtin('__WeakSet_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,6],[252,2],[32,7],[16, builtin('__String_prototype_toString')],[33,3],[183],[12,1],[11],[32,8],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,6],[32,7],[16, builtin('__Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,6],[32,7],[16, builtin('__Uint8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,6],[32,7],[16, builtin('__Int8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,6],[32,7],[16, builtin('__Uint8ClampedArray_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,6],[32,7],[16, builtin('__Uint16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,6],[32,7],[16, builtin('__Int16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,6],[32,7],[16, builtin('__Uint32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,6],[32,7],[16, builtin('__Int32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,6],[32,7],[16, builtin('__Float32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,6],[32,7],[16, builtin('__Float64Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,6],[252,2],[32,7],[16, builtin('__ByteString_prototype_toString')],[33,3],[183],[12,1],[11],...internalThrow(scope, 'TypeError', `'toString' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[32,3],[15]],
3837
+ wasm: (scope, {allocPage,builtin,internalThrow}) => [[16, builtin('__Porffor_allocate')],[33,3],[33,2],[32,0],[32,1],[16, builtin('__Porffor_rawType')],[34,4],[68,0,0,0,0,0,128,80,64],[97],[32,4],[68,0,0,0,0,0,64,104,64],[97],[114],[4,64],[32,0],[32,1],[15],[11],[32,4],[68,0,0,0,0,0,0,24,64],[97],[4,64],...internalThrow(scope, 'TypeError', `Cannot convert a Symbol value to a string`),[11],[32,4],[68,0,0,0,0,0,0,8,64],[97],[4,64],...number(allocPage(scope, 'bytestring: __ecma262_ToString/out', 'i8') * pageSize, 124),[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,16,64],[97],[32,0],[68,0,0,0,0,0,0,0,0],[97],[113],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,238,0],[58,0,4],[32,5],[65,245,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,236,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,4],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,0],[68,0,0,0,0,0,0,240,63],[97],[4,64],[32,2],[252,3],[34,5],[65,4],[54,1,0],[32,5],[65,244,0],[58,0,4],[32,5],[65,242,0],[58,0,5],[32,5],[65,245,0],[58,0,6],[32,5],[65,229,0],[58,0,7],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,2],[252,3],[34,5],[65,5],[54,1,0],[32,5],[65,230,0],[58,0,4],[32,5],[65,225,0],[58,0,5],[32,5],[65,236,0],[58,0,6],[32,5],[65,243,0],[58,0,7],[32,5],[65,229,0],[58,0,8],[32,5],[184],[34,2],[65,194,1],[15],[11],[32,0],[33,6],[32,1],[34,7],[33,8],[2,124],[32,8],[65,0],[70],[4,64,"TYPESWITCH|Number"],[32,6],[32,7],[68,0,0,0,0,0,0,0,0],[65,3],[16, builtin('__Number_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,1],[70],[4,64,"TYPESWITCH|Boolean"],[32,6],[32,7],[16, builtin('__Boolean_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,4],[70],[4,64,"TYPESWITCH|Object"],[32,6],[32,7],[16, builtin('__Object_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,5],[70],[4,64,"TYPESWITCH|Function"],[32,6],[32,7],[16, builtin('__Function_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,6],[70],[4,64,"TYPESWITCH|Symbol"],[32,6],[32,7],[16, builtin('__Symbol_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,18],[70],[4,64,"TYPESWITCH|Date"],[32,6],[32,7],[16, builtin('__Date_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,19],[70],[4,64,"TYPESWITCH|Set"],[32,6],[32,7],[16, builtin('__Set_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,32],[70],[4,64,"TYPESWITCH|WeakRef"],[32,6],[32,7],[16, builtin('__WeakRef_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,33],[70],[4,64,"TYPESWITCH|WeakSet"],[32,6],[32,7],[16, builtin('__WeakSet_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,0],[70],[4,64,"TYPESWITCH|String"],[32,6],[252,2],[32,7],[16, builtin('__String_prototype_toString')],[33,3],[183],[12,1],[11],[32,8],[65,208,0],[70],[4,64,"TYPESWITCH|Array"],[32,6],[32,7],[16, builtin('__Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,215,0],[70],[4,64,"TYPESWITCH|Uint8Array"],[32,6],[32,7],[16, builtin('__Uint8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,216,0],[70],[4,64,"TYPESWITCH|Int8Array"],[32,6],[32,7],[16, builtin('__Int8Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,217,0],[70],[4,64,"TYPESWITCH|Uint8ClampedArray"],[32,6],[32,7],[16, builtin('__Uint8ClampedArray_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,218,0],[70],[4,64,"TYPESWITCH|Uint16Array"],[32,6],[32,7],[16, builtin('__Uint16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,219,0],[70],[4,64,"TYPESWITCH|Int16Array"],[32,6],[32,7],[16, builtin('__Int16Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,220,0],[70],[4,64,"TYPESWITCH|Uint32Array"],[32,6],[32,7],[16, builtin('__Uint32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,221,0],[70],[4,64,"TYPESWITCH|Int32Array"],[32,6],[32,7],[16, builtin('__Int32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,222,0],[70],[4,64,"TYPESWITCH|Float32Array"],[32,6],[32,7],[16, builtin('__Float32Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,223,0],[70],[4,64,"TYPESWITCH|Float64Array"],[32,6],[32,7],[16, builtin('__Float64Array_prototype_toString')],[33,3],[12,1],[11],[32,8],[65,194,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,6],[252,2],[32,7],[16, builtin('__ByteString_prototype_toString')],[33,3],[183],[12,1],[11],...internalThrow(scope, 'TypeError', `'toString' proto func tried to be called on a type without an impl`),[11,"TYPESWITCH_end"],[32,3],[15]],
3812
3838
  params: [124,127], typedParams: 1,
3813
3839
  returns: [124,127], typedReturns: 1,
3814
3840
  locals: [124,127,124,127,124,127,127], localNames: ["argument","argument#type","out","#last_type","type","#makearray_pointer_tmp","#proto_target","#proto_target#type","#typeswitch_tmp"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "porffor",
3
3
  "description": "a basic experimental wip aot optimizing js -> wasm engine/compiler/runtime in js",
4
- "version": "0.18.32+da1ae5c67",
4
+ "version": "0.18.34+c83c8ab39",
5
5
  "author": "CanadaHonk",
6
6
  "license": "MIT",
7
7
  "scripts": {},
package/runner/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from 'node:fs';
3
- globalThis.version = '0.18.32+da1ae5c67';
3
+ globalThis.version = '0.18.34+c83c8ab39';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {