porffor 0.18.14 → 0.18.16

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.
@@ -46,6 +46,105 @@ export const __Array_prototype_slice = (_this: any[], start: number, end: number
46
46
  return out;
47
47
  };
48
48
 
49
+ export const __Array_prototype_splice = (_this: any[], start: number, deleteCount: any, ...items: any[]) => {
50
+ const len: i32 = _this.length;
51
+
52
+ start |= 0;
53
+ if (start < 0) {
54
+ start = len + start;
55
+ if (start < 0) start = 0;
56
+ }
57
+ if (start > len) start = len;
58
+
59
+ if (Porffor.rawType(deleteCount) == Porffor.TYPES.undefined) deleteCount = len - start;
60
+ deleteCount |= 0;
61
+
62
+ if (deleteCount < 0) deleteCount = 0;
63
+ if (deleteCount > len - start) deleteCount = len - start;
64
+
65
+ // read values to be deleted into out
66
+ let out: any[] = Porffor.allocate();
67
+ out.length = deleteCount;
68
+
69
+ let outPtr: i32 = Porffor.wasm`local.get ${out}`;
70
+ let thisPtr: i32 = Porffor.wasm`local.get ${_this}` + start * 9;
71
+ let thisPtrEnd: i32 = thisPtr + deleteCount * 9;
72
+
73
+ while (thisPtr < thisPtrEnd) {
74
+ Porffor.wasm.f64.store(outPtr, Porffor.wasm.f64.load(thisPtr, 0, 4), 0, 4);
75
+ Porffor.wasm.i32.store8(outPtr + 8, Porffor.wasm.i32.load8_u(thisPtr + 8, 0, 4), 0, 4);
76
+
77
+ thisPtr += 9;
78
+ outPtr += 9;
79
+ }
80
+
81
+ // update this length
82
+ const itemsLen: i32 = items.length;
83
+ _this.length = len - deleteCount + itemsLen;
84
+
85
+ // remove deleted values via memory.copy shifting values in mem
86
+ Porffor.wasm`;; setup
87
+ local #splice_ptr i32
88
+
89
+ ;; ptr = ptr(_this) + 4 + (start * 9)
90
+ local.get ${_this}
91
+ i32.to_u
92
+ i32.const 4
93
+ i32.add
94
+ local.get ${start}
95
+ i32.to_u
96
+ i32.const 9
97
+ i32.mul
98
+ i32.add
99
+ local.set #splice_ptr
100
+
101
+ ;; dst = ptr + itemsLen * 9
102
+ local.get #splice_ptr
103
+ local.get ${itemsLen}
104
+ i32.to_u
105
+ i32.const 9
106
+ i32.mul
107
+ i32.add
108
+
109
+ ;; src = ptr + deleteCount * 9
110
+ local.get #splice_ptr
111
+ local.get ${deleteCount}
112
+ i32.to_u
113
+ i32.const 9
114
+ i32.mul
115
+ i32.add
116
+
117
+ ;; size = (len - start - deleteCount) * 9
118
+ local.get ${len}
119
+ i32.to_u
120
+ local.get ${start}
121
+ i32.to_u
122
+ local.get ${deleteCount}
123
+ i32.to_u
124
+ i32.sub
125
+ i32.sub
126
+ i32.const 9
127
+ i32.mul
128
+
129
+ memory.copy 0 0`;
130
+
131
+ if (itemsLen > 0) {
132
+ let itemsPtr: i32 = Porffor.wasm`local.get ${items}`;
133
+ thisPtr = Porffor.wasm`local.get ${_this}` + start * 9;
134
+ thisPtrEnd = thisPtr + itemsLen * 9;
135
+
136
+ while (thisPtr < thisPtrEnd) {
137
+ Porffor.wasm.f64.store(thisPtr, Porffor.wasm.f64.load(itemsPtr, 0, 4), 0, 4);
138
+ Porffor.wasm.i32.store8(thisPtr + 8, Porffor.wasm.i32.load8_u(itemsPtr + 8, 0, 4), 0, 4);
139
+
140
+ thisPtr += 9;
141
+ itemsPtr += 9;
142
+ }
143
+ }
144
+
145
+ return out;
146
+ };
147
+
49
148
  // @porf-typed-array
50
149
  export const __Array_prototype_fill = (_this: any[], value: any, start: any, end: any) => {
51
150
  const len: i32 = _this.length;
@@ -28,7 +28,7 @@ export const __crypto_randomUUID = (): bytestring => {
28
28
  12 // 4 + 8
29
29
  );
30
30
 
31
- let output: bytestring = '------------------------------------';
31
+ let output: bytestring = Porffor.allocate();
32
32
 
33
33
  let i: i32 = Porffor.wasm`local.get ${output}`;
34
34
  let j: i32 = bytesPtr;
@@ -1,19 +1,6 @@
1
1
  // @porf --valtype=i32
2
2
  import type {} from './porffor.d.ts';
3
3
 
4
- export const __String_fromCharCode = (code: i32) => {
5
- // todo: support >1 arg
6
- if (code < 256) {
7
- let out: bytestring = '.';
8
- Porffor.wasm.i32.store8(out, code, 0, 4);
9
- return out;
10
- }
11
-
12
- let out: string = Porffor.s`.`;
13
- Porffor.wasm.i32.store16(out, code, 0, 4);
14
- return out;
15
- };
16
-
17
4
  export const __String_prototype_toUpperCase = (_this: string) => {
18
5
  // todo: unicode not just ascii
19
6
  const len: i32 = _this.length;
@@ -5,4 +5,33 @@ import type {} from './porffor.d.ts';
5
5
  export const String = function (value: any): bytestring {
6
6
  if (!new.target && Porffor.rawType(value) == Porffor.TYPES.symbol) return __Symbol_prototype_toString(value);
7
7
  return __ecma262_ToString(value);
8
+ };
9
+
10
+ export const __String_fromCharCode = (...codes: any[]): bytestring|string => {
11
+ let out: string = Porffor.allocate();
12
+
13
+ const len: i32 = codes.length;
14
+ out.length = len;
15
+
16
+ let bytestringable: boolean = true;
17
+ for (let i: i32 = 0; i < len; i++) {
18
+ const v: i32 = __ecma262_ToIntegerOrInfinity(codes[i]);
19
+ if (v > 0xFF) bytestringable = false;
20
+
21
+ Porffor.wasm.i32.store16(Porffor.wasm`local.get ${out}` + i * 2, v, 0, 4);
22
+ }
23
+
24
+ if (bytestringable) {
25
+ let out2: bytestring = Porffor.wasm`local.get ${out}`;
26
+ for (let i: i32 = 0; i < len; i++) {
27
+ Porffor.wasm.i32.store8(
28
+ Porffor.wasm`local.get ${out}` + i,
29
+ Porffor.wasm.i32.load8_u(Porffor.wasm`local.get ${out}` + i * 2, 0, 4),
30
+ 0, 4);
31
+ }
32
+
33
+ return out2;
34
+ }
35
+
36
+ return out;
8
37
  };
@@ -236,6 +236,16 @@ export const BuiltinFuncs = function() {
236
236
  locals: [124,124,127,124,124,124,124],
237
237
  localNames: ["_this","_this#type","start","start#type","end","end#type","len","out","#last_type","outPtr","thisPtr","thisPtrEnd","__length_setter_tmp"],
238
238
  };
239
+ this.__Array_prototype_splice = {
240
+ wasm: (scope, {builtin,}) => [[32,0],[252,3],[40,1,0],[184],[33,8],[32,2],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,2],[68,0,0,0,0,0,0,0,0],[99],[4,64],[32,8],[32,2],[160],[34,2],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[33,2],[11],[11],[32,2],[32,8],[100],[4,64],[32,8],[33,2],[11],[32,4],[32,5],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[97],[4,64],[32,8],[32,2],[161],[34,4],[65,0],[33,5],[26],[11],[32,4],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,4],[65,0],[33,5],[26],[32,4],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[34,4],[65,0],[33,5],[26],[11],[32,4],[32,8],[32,2],[161],[100],[4,64],[32,8],[32,2],[161],[34,4],[65,0],[33,5],[26],[11],[16, builtin('__Porffor_allocate')],[33,10],[34,9],[252,3],[32,4],[34,11],[252,3],[54,1,0],[32,9],[33,12],[32,0],[32,2],[68,0,0,0,0,0,0,34,64],[162],[160],[34,13],[32,4],[68,0,0,0,0,0,0,34,64],[162],[160],[33,14],[3,64],[32,13],[32,14],[99],[4,64],[32,12],[252,2],[32,13],[252,2],[43,0,4],[57,0,4],[32,12],[68,0,0,0,0,0,0,32,64],[160],[252,2],[32,13],[68,0,0,0,0,0,0,32,64],[160],[252,2],[45,0,4],[58,0,4],[32,13],[68,0,0,0,0,0,0,34,64],[160],[33,13],[32,12],[68,0,0,0,0,0,0,34,64],[160],[33,12],[12,1],[11],[11],[32,6],[252,3],[40,1,0],[184],[33,15],[32,0],[252,3],[32,8],[32,4],[161],[32,15],[160],[34,11],[252,3],[54,1,0],[32,0],[252,3],[65,4],[106],[32,2],[252,3],[65,9],[108],[106],[34,16],[32,15],[252,3],[65,9],[108],[106],[32,16],[32,4],[252,3],[65,9],[108],[106],[32,8],[252,3],[32,2],[252,3],[32,4],[252,3],[107],[107],[65,9],[108],[252,10,0,0],[32,15],[68,0,0,0,0,0,0,0,0],[100],[4,64],[32,6],[33,17],[32,0],[32,2],[68,0,0,0,0,0,0,34,64],[162],[160],[34,13],[32,15],[68,0,0,0,0,0,0,34,64],[162],[160],[33,14],[3,64],[32,13],[32,14],[99],[4,64],[32,13],[252,2],[32,17],[252,2],[43,0,4],[57,0,4],[32,13],[68,0,0,0,0,0,0,32,64],[160],[252,2],[32,17],[68,0,0,0,0,0,0,32,64],[160],[252,2],[45,0,4],[58,0,4],[32,13],[68,0,0,0,0,0,0,34,64],[160],[33,13],[32,17],[68,0,0,0,0,0,0,34,64],[160],[33,17],[12,1],[11],[11],[11],[32,9],[65,208,0],[15]],
241
+ params: [124,127,124,127,124,127,124,127],
242
+ typedParams: true,
243
+ returns: [124,127],
244
+ typedReturns: true,
245
+ locals: [124,124,127,124,124,124,124,124,127,124],
246
+ localNames: ["_this","_this#type","start","start#type","deleteCount","deleteCount#type","items","items#type","len","out","#last_type","__length_setter_tmp","outPtr","thisPtr","thisPtrEnd","itemsLen","#splice_ptr","itemsPtr"],
247
+ hasRestArgument: true,
248
+ };
239
249
  this.__Array_prototype_fill = {
240
250
  wasm: (scope, {builtin,}) => [[32,0],[252,3],[40,1,0],[184],[33,8],[32,4],[32,5],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[97],[4,64],[68,0,0,0,0,0,0,0,0],[34,4],[65,0],[33,5],[26],[11],[32,6],[32,7],[16, builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,8,64],[97],[4,64],[32,8],[34,6],[65,0],[33,7],[26],[11],[32,4],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,4],[65,0],[33,5],[26],[32,6],[68,0,0,0,0,0,0,0,0],[16, builtin('f64_|')],[34,6],[65,0],[33,7],[26],[32,4],[68,0,0,0,0,0,0,0,0],[99],[4,64],[32,8],[32,4],[160],[34,4],[65,0],[33,5],[26],[32,4],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[34,4],[65,0],[33,5],[26],[11],[11],[32,4],[32,8],[100],[4,64],[32,8],[34,4],[65,0],[33,5],[26],[11],[32,6],[68,0,0,0,0,0,0,0,0],[99],[4,64],[32,8],[32,6],[160],[34,6],[65,0],[33,7],[26],[32,6],[68,0,0,0,0,0,0,0,0],[99],[4,64],[68,0,0,0,0,0,0,0,0],[34,6],[65,0],[33,7],[26],[11],[11],[32,6],[32,8],[100],[4,64],[32,8],[34,6],[65,0],[33,7],[26],[11],[32,4],[33,9],[3,64],[32,9],[32,6],[99],[4,64],[32,0],[252,3],[32,9],[252,3],[65,9],[108],[106],[34,11],[32,2],[34,10],[57,0,4],[32,11],[32,3],[58,0,12],[32,9],[68,0,0,0,0,0,0,240,63],[160],[33,9],[12,1],[11],[11],[32,0],[65,208,0],[15]],
241
251
  params: [124,127,124,127,124,127,124,127],
@@ -516,14 +526,14 @@ export const BuiltinFuncs = function() {
516
526
  data: [{"bytes":[9,0,0,0,27,91,49,59,49,72,27,91,74],"offset":0}],
517
527
  };
518
528
  this.__crypto_randomUUID = {
519
- wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __crypto_randomUUID/bytes', 'i8') * pageSize, 127),[34,0],[34,1],[34,2],[65,16],[106],[33,3],[3,64],[32,2],[32,3],[72],[4,64],[32,2],[32,2],[65,1],[106],[33,2],[16, builtin('__Porffor_randomByte')],[58,0,4],[12,1],[11],[11],[32,1],[32,1],[45,0,10],[65,15],[113],[65,192,0],[114],[58,0,10],[32,1],[32,1],[45,0,12],[65,63],[113],[65,128,1],[114],[58,0,12],...number(allocPage(scope, 'bytestring: __crypto_randomUUID/output', 'i8') * pageSize, 127),[34,4],[33,5],[32,1],[33,6],[32,5],[65,8],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,6],[32,6],[65,1],[106],[33,6],[45,0,4],[34,8],[65,15],[113],[65,48],[106],[34,9],[65,57],[74],[4,64],[32,9],[65,39],[106],[33,9],[11],[32,8],[65,4],[117],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,5],[32,5],[65,1],[106],[33,5],[32,10],[58,0,4],[32,5],[32,5],[65,1],[106],[33,5],[32,9],[58,0,4],[12,1],[11],[11],[32,5],[65,1],[106],[34,5],[65,4],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,6],[32,6],[65,1],[106],[33,6],[45,0,4],[34,8],[65,15],[113],[65,48],[106],[34,9],[65,57],[74],[4,64],[32,9],[65,39],[106],[33,9],[11],[32,8],[65,4],[117],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,5],[32,5],[65,1],[106],[33,5],[32,10],[58,0,4],[32,5],[32,5],[65,1],[106],[33,5],[32,9],[58,0,4],[12,1],[11],[11],[32,5],[65,1],[106],[34,5],[65,4],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,6],[32,6],[65,1],[106],[33,6],[45,0,4],[34,8],[65,15],[113],[65,48],[106],[34,9],[65,57],[74],[4,64],[32,9],[65,39],[106],[33,9],[11],[32,8],[65,4],[117],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,5],[32,5],[65,1],[106],[33,5],[32,10],[58,0,4],[32,5],[32,5],[65,1],[106],[33,5],[32,9],[58,0,4],[12,1],[11],[11],[32,5],[65,1],[106],[34,5],[65,4],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,6],[32,6],[65,1],[106],[33,6],[45,0,4],[34,8],[65,15],[113],[65,48],[106],[34,9],[65,57],[74],[4,64],[32,9],[65,39],[106],[33,9],[11],[32,8],[65,4],[117],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,5],[32,5],[65,1],[106],[33,5],[32,10],[58,0,4],[32,5],[32,5],[65,1],[106],[33,5],[32,9],[58,0,4],[12,1],[11],[11],[32,5],[65,1],[106],[34,5],[65,12],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,6],[32,6],[65,1],[106],[33,6],[45,0,4],[34,8],[65,15],[113],[65,48],[106],[34,9],[65,57],[74],[4,64],[32,9],[65,39],[106],[33,9],[11],[32,8],[65,4],[117],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,5],[32,5],[65,1],[106],[33,5],[32,10],[58,0,4],[32,5],[32,5],[65,1],[106],[33,5],[32,9],[58,0,4],[12,1],[11],[11],[32,5],[65,1],[106],[33,5],[32,4],[65,194,1],[15]],
529
+ wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __crypto_randomUUID/bytes', 'i8') * pageSize, 127),[34,0],[34,1],[34,2],[65,16],[106],[33,3],[3,64],[32,2],[32,3],[72],[4,64],[32,2],[32,2],[65,1],[106],[33,2],[16, builtin('__Porffor_randomByte')],[58,0,4],[12,1],[11],[11],[32,1],[32,1],[45,0,10],[65,15],[113],[65,192,0],[114],[58,0,10],[32,1],[32,1],[45,0,12],[65,63],[113],[65,128,1],[114],[58,0,12],[16, builtin('__Porffor_allocate')],[33,5],[252,2],[34,4],[33,6],[32,1],[33,7],[32,6],[65,8],[106],[33,8],[3,64],[32,6],[32,8],[72],[4,64],[32,7],[32,7],[65,1],[106],[33,7],[45,0,4],[34,9],[65,15],[113],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,9],[65,4],[117],[65,48],[106],[34,11],[65,57],[74],[4,64],[32,11],[65,39],[106],[33,11],[11],[32,6],[32,6],[65,1],[106],[33,6],[32,11],[58,0,4],[32,6],[32,6],[65,1],[106],[33,6],[32,10],[58,0,4],[12,1],[11],[11],[32,6],[65,1],[106],[34,6],[65,4],[106],[33,8],[3,64],[32,6],[32,8],[72],[4,64],[32,7],[32,7],[65,1],[106],[33,7],[45,0,4],[34,9],[65,15],[113],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,9],[65,4],[117],[65,48],[106],[34,11],[65,57],[74],[4,64],[32,11],[65,39],[106],[33,11],[11],[32,6],[32,6],[65,1],[106],[33,6],[32,11],[58,0,4],[32,6],[32,6],[65,1],[106],[33,6],[32,10],[58,0,4],[12,1],[11],[11],[32,6],[65,1],[106],[34,6],[65,4],[106],[33,8],[3,64],[32,6],[32,8],[72],[4,64],[32,7],[32,7],[65,1],[106],[33,7],[45,0,4],[34,9],[65,15],[113],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,9],[65,4],[117],[65,48],[106],[34,11],[65,57],[74],[4,64],[32,11],[65,39],[106],[33,11],[11],[32,6],[32,6],[65,1],[106],[33,6],[32,11],[58,0,4],[32,6],[32,6],[65,1],[106],[33,6],[32,10],[58,0,4],[12,1],[11],[11],[32,6],[65,1],[106],[34,6],[65,4],[106],[33,8],[3,64],[32,6],[32,8],[72],[4,64],[32,7],[32,7],[65,1],[106],[33,7],[45,0,4],[34,9],[65,15],[113],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,9],[65,4],[117],[65,48],[106],[34,11],[65,57],[74],[4,64],[32,11],[65,39],[106],[33,11],[11],[32,6],[32,6],[65,1],[106],[33,6],[32,11],[58,0,4],[32,6],[32,6],[65,1],[106],[33,6],[32,10],[58,0,4],[12,1],[11],[11],[32,6],[65,1],[106],[34,6],[65,12],[106],[33,8],[3,64],[32,6],[32,8],[72],[4,64],[32,7],[32,7],[65,1],[106],[33,7],[45,0,4],[34,9],[65,15],[113],[65,48],[106],[34,10],[65,57],[74],[4,64],[32,10],[65,39],[106],[33,10],[11],[32,9],[65,4],[117],[65,48],[106],[34,11],[65,57],[74],[4,64],[32,11],[65,39],[106],[33,11],[11],[32,6],[32,6],[65,1],[106],[33,6],[32,11],[58,0,4],[32,6],[32,6],[65,1],[106],[33,6],[32,10],[58,0,4],[12,1],[11],[11],[32,6],[65,1],[106],[33,6],[32,4],[65,194,1],[15]],
520
530
  params: [],
521
531
  typedParams: true,
522
532
  returns: [127,127],
523
533
  typedReturns: true,
524
- locals: [127,127,127,127,127,127,127,127,127,127,127],
525
- localNames: ["bytes","bytesPtr","a","aEndPtr","output","i","j","endPtr","byte","lower","upper"],
526
- data: [{"bytes":[16,0,0,0,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46],"offset":0},{"bytes":[36,0,0,0,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45],"offset":65536}],
534
+ locals: [127,127,127,127,127,127,127,127,127,127,127,127],
535
+ localNames: ["bytes","bytesPtr","a","aEndPtr","output","#last_type","i","j","endPtr","byte","lower","upper"],
536
+ data: [{"bytes":[16,0,0,0,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46,46],"offset":0}],
527
537
  };
528
538
  this.__ecma262_Day = {
529
539
  wasm: (scope, {builtin,}) => [[32,0],[68,0,0,0,0,112,153,148,65],[163],[16, builtin('__Math_floor')],[65,0],[15]],
@@ -1773,16 +1783,6 @@ export const BuiltinFuncs = function() {
1773
1783
  localNames: ["_this","_this#type","out"],
1774
1784
  data: [{"bytes":[12,0,0,0,91,111,98,106,101,99,116,32,83,101,116,93],"offset":0}],
1775
1785
  };
1776
- this.__String_fromCharCode = {
1777
- wasm: (scope, {allocPage,}) => [[32,0],[65,128,2],[72],[4,64],...number(allocPage(scope, 'bytestring: __String_fromCharCode/out', 'i8') * pageSize, 127),[34,2],[32,0],[58,0,4],[32,2],[65,194,1],[15],[11],[32,2],[34,3],[65,1],[54,1,0],[32,3],[65,46],[59,0,4],[32,3],[34,2],[32,0],[59,0,4],[32,2],[65,194,0],[15]],
1778
- params: [127,127],
1779
- typedParams: true,
1780
- returns: [127,127],
1781
- typedReturns: true,
1782
- locals: [127,127],
1783
- localNames: ["code","code#type","out","#makearray_pointer_tmp"],
1784
- data: [{"bytes":[1,0,0,0,46],"offset":0}],
1785
- };
1786
1786
  this.__String_prototype_toUpperCase = {
1787
1787
  wasm: (scope, {builtin,}) => [[32,0],[40,1,0],[33,2],[16, builtin('__Porffor_allocate')],[33,4],[252,2],[34,3],[32,2],[54,0,0],[32,0],[33,5],[32,3],[33,6],[32,5],[32,2],[65,2],[108],[106],[33,7],[3,64],[32,5],[32,7],[72],[4,64],[32,5],[47,0,4],[33,8],[32,5],[65,2],[106],[33,5],[32,8],[65,225,0],[78],[4,64],[32,8],[65,250,0],[76],[4,64],[32,8],[65,32],[107],[33,8],[11],[11],[32,6],[32,8],[59,0,4],[32,6],[65,2],[106],[33,6],[12,1],[11],[11],[32,3],[65,194,0],[15]],
1788
1788
  params: [127,127],
@@ -2099,6 +2099,16 @@ export const BuiltinFuncs = function() {
2099
2099
  localNames: ["value","value#type","#last_type","#logicinner_tmp","#typeswitch_tmp","logictmp"],
2100
2100
  constr: true,
2101
2101
  };
2102
+ this.__String_fromCharCode = {
2103
+ wasm: (scope, {builtin,}) => [[16, builtin('__Porffor_allocate')],[33,3],[33,2],[32,0],[252,3],[40,1,0],[184],[33,4],[32,2],[252,3],[32,4],[34,5],[252,3],[54,1,0],[68,0,0,0,0,0,0,240,63],[33,6],[68,0,0,0,0,0,0,0,0],[33,7],[3,64],[32,7],[32,4],[99],[4,64],[32,7],[252,3],[65,9],[108],[32,0],[252,3],[106],[34,9],[43,0,4],[32,9],[45,0,12],[34,3],[16, builtin('__ecma262_ToIntegerOrInfinity')],[33,3],[34,8],[68,0,0,0,0,0,224,111,64],[100],[4,64],[68,0,0,0,0,0,0,0,0],[33,6],[11],[32,2],[32,7],[68,0,0,0,0,0,0,0,64],[162],[160],[252,2],[32,8],[252,2],[59,0,4],[32,7],[68,0,0,0,0,0,0,240,63],[160],[33,7],[12,1],[11],[11],[32,6],[252,3],[4,64],[32,2],[33,10],[68,0,0,0,0,0,0,0,0],[33,7],[3,64],[32,7],[32,4],[99],[4,64],[32,2],[32,7],[160],[252,2],[32,2],[32,7],[68,0,0,0,0,0,0,0,64],[162],[160],[252,2],[45,0,4],[58,0,4],[32,7],[68,0,0,0,0,0,0,240,63],[160],[33,7],[12,1],[11],[11],[32,10],[65,194,1],[15],[11],[32,2],[65,194,0],[15]],
2104
+ params: [124,127],
2105
+ typedParams: true,
2106
+ returns: [124,127],
2107
+ typedReturns: true,
2108
+ locals: [124,127,124,124,124,124,124,127,124],
2109
+ localNames: ["codes","codes#type","out","#last_type","len","__length_setter_tmp","bytestringable","i","v","#loadArray_offset","out2"],
2110
+ hasRestArgument: true,
2111
+ };
2102
2112
  this.__Porffor_symbol_descStore = {
2103
2113
  wasm: (scope, {allocPage,builtin,}) => [...number(allocPage(scope, 'bytestring: __Porffor_symbol_descStore/ptr', 'i8') * pageSize, 124),[33,4],[32,0],[252,3],[4,64],[32,4],[252,2],[40,0,0],[183],[33,5],[32,4],[252,2],[32,5],[68,0,0,0,0,0,0,240,63],[160],[252,2],[54,0,0],[32,4],[65,194,1],[32,5],[65,0],[32,2],[32,3],[16, builtin('__Porffor_set_write')],[33,6],[26],[32,5],[65,0],[15],[5],[32,4],[65,194,1],[32,2],[32,3],[16, builtin('__Porffor_set_read')],[34,6],[15],[11],[68,0,0,0,0,0,0,0,0],[65,3],[15]],
2104
2114
  params: [124,127,124,127],
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.14+d7ef62736",
4
+ "version": "0.18.16+031bc17dd",
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.14+d7ef62736';
3
+ globalThis.version = '0.18.16+031bc17dd';
4
4
 
5
5
  // deno compat
6
6
  if (typeof process === 'undefined' && typeof Deno !== 'undefined') {