porffor 0.55.11 → 0.55.13
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/2c.js +2 -2
- package/compiler/builtins/__internal_object.ts +1 -1
- package/compiler/builtins/error.js +1 -1
- package/compiler/builtins_precompiled.js +13 -13
- package/compiler/codegen.js +81 -78
- package/compiler/disassemble.js +1 -1
- package/compiler/index.js +5 -5
- package/compiler/precompile.js +2 -2
- package/compiler/wrap.js +3 -3
- package/package.json +1 -1
- package/r.cjs +86 -0
- package/runner/index.js +11 -11
- package/runner/repl.js +2 -2
package/compiler/2c.js
CHANGED
@@ -722,7 +722,7 @@ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;`);
|
|
722
722
|
|
723
723
|
case Opcodes.call_indirect:
|
724
724
|
// todo: stub
|
725
|
-
if (Prefs.d) log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[
|
725
|
+
if (Prefs.d) log.warning('2c', `unimplemented op: ${invOpcodes[i[0]]} \x1b[2m(${f.name})`);
|
726
726
|
vals.pop();
|
727
727
|
vals.push('0', '0');
|
728
728
|
break;
|
@@ -874,7 +874,7 @@ _time_out = _time.tv_nsec / 1000000. + _time.tv_sec * 1000.;`);
|
|
874
874
|
break;
|
875
875
|
}
|
876
876
|
|
877
|
-
if (Prefs.d) log.warning('2c', `unimplemented op: ${invOpcodes[i[0]] ?? invOpcodes[i[0] + ',' + i[1]]} \x1b[
|
877
|
+
if (Prefs.d) log.warning('2c', `unimplemented op: ${invOpcodes[i[0]] ?? invOpcodes[i[0] + ',' + i[1]]} \x1b[2m(${f.name})`);
|
878
878
|
}
|
879
879
|
|
880
880
|
lastCond = false;
|
@@ -20,7 +20,7 @@ export const __Porffor_object_underlying = (obj: any): any => {
|
|
20
20
|
if (t == Porffor.TYPES.function) {
|
21
21
|
if (ecma262.IsConstructor(obj)) { // constructor
|
22
22
|
// set prototype and prototype.constructor if function and constructor
|
23
|
-
const proto = {};
|
23
|
+
const proto: object = {};
|
24
24
|
const key1: bytestring = 'prototype';
|
25
25
|
__Porffor_object_expr_initWithFlags(underlying, key1, proto, 0b1000);
|
26
26
|
|
@@ -3,9 +3,9 @@ import { number } from './embedding.js';
|
|
3
3
|
|
4
4
|
export const BuiltinFuncs = function() {
|
5
5
|
this.__Porffor_object_underlying = {
|
6
|
-
wasm:(_,{t,makeString,glbl,builtin})=>[[32,1],[184],[34,2],[68,7],[97],[4,64],[32,0],[32,1],[15],[26],[11],[32,2],[68,40],[102],[32,2],[68,49],[101],[113],[4,64],[32,0],[34,3],[65,7],[15],[26],[11],[32,2],[68,5],[100],[32,2],[68,128],[98],[113],[4,64],...glbl(35,'underlyingKeys',124),[65,208,0],[32,0],[32,1],[16,builtin('__Porffor_array_fastIndexOf')],[33,5],[34,4],[68,-1],[97],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,6],[32,2],[68,6],[97],[4,64],[32,0],[32,1],[16,builtin('__ecma262_IsConstructor')],[33,5],[33,7],[32,5],[33,8],[2,127],...t([67,195],()=>[[32,8],[65,195,0],[70],[32,8],[65,195,1],[70],[114],[4,64],[32,7],[252,3],[40,1,0],[12,1],[11]]),[32,7],[252,3],[11],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,9]
|
6
|
+
wasm:(_,{t,makeString,glbl,builtin})=>[[32,1],[184],[34,2],[68,7],[97],[4,64],[32,0],[32,1],[15],[26],[11],[32,2],[68,40],[102],[32,2],[68,49],[101],[113],[4,64],[32,0],[34,3],[65,7],[15],[26],[11],[32,2],[68,5],[100],[32,2],[68,128],[98],[113],[4,64],...glbl(35,'underlyingKeys',124),[65,208,0],[32,0],[32,1],[16,builtin('__Porffor_array_fastIndexOf')],[33,5],[34,4],[68,-1],[97],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,6],[32,2],[68,6],[97],[4,64],[32,0],[32,1],[16,builtin('__ecma262_IsConstructor')],[33,5],[33,7],[32,5],[33,8],[2,127],...t([67,195],()=>[[32,8],[65,195,0],[70],[32,8],[65,195,1],[70],[114],[4,64],[32,7],[252,3],[40,1,0],[12,1],[11]]),[32,7],[252,3],[11],[4,64],[16,builtin('__Porffor_allocate')],[184],[33,9],...makeString(_,"prototype",1),[33,10],[32,6],[252,2],[65,7],[32,10],[252,2],[65,195,1],[32,9],[65,7],[65,8],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],...makeString(_,"constructor",1),[33,11],[32,9],[252,2],[65,7],[32,11],[252,2],[65,195,1],[32,0],[32,1],[65,10],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[11],...makeString(_,"name",1),[33,12],[32,6],[252,2],[65,7],[32,12],[252,2],[65,195,1],[32,0],[252,2],[16,builtin('__Porffor_funcLut_name')],[183],[65,195,1],[65,2],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],...makeString(_,"length",1),[33,13],[32,6],[252,2],[65,7],[32,13],[252,2],[65,195,1],[32,0],[252,2],[16,builtin('__Porffor_funcLut_length')],[183],[65,1],[65,2],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[11],[32,2],[68,80],[97],[4,64],[32,0],[34,14],[252,3],[40,1,0],[184],[33,15],...makeString(_,"length",1),[33,16],[32,6],[252,2],[65,7],[32,16],[252,2],[65,195,1],[32,15],[65,1],[65,8],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[68,0],[33,17],[3,64],[32,17],[32,15],[99],[4,64],[32,6],[252,2],[65,7],[32,17],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,5],[252,2],[32,5],[32,17],[33,19],[32,14],[33,18],[32,19],[252,3],[65,9],[108],[32,18],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[34,5],[65,14],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[32,17],[68,1],[160],[33,17],[12,1],[11],[11],[11],[32,2],[68,67],[97],[32,2],[68,39],[97],[114],[4,64],[32,0],[34,21],[252,3],[40,1,0],[184],[33,15],...makeString(_,"length",1),[33,22],[32,6],[252,2],[65,7],[32,22],[252,2],[65,195,1],[32,15],[65,1],[65,0],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[68,0],[33,17],[3,64],[32,17],[32,15],[99],[4,64],[32,6],[252,2],[65,7],[32,17],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,5],[252,2],[32,5],[32,17],[33,24],[32,21],[33,23],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,25],[65,1],[54,0,0],[32,25],[32,24],[252,3],[65,2],[108],[32,23],[252,3],[106],[47,0,4],[59,0,4],[32,25],[184],[65,195,0],[33,5],[65,195,0],[65,4],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[32,17],[68,1],[160],[33,17],[12,1],[11],[11],[32,2],[68,67],[97],[4,64],[32,6],[252,2],[65,7],[16,builtin('__Porffor_object_preventExtensions')],[33,5],[183],[26],[11],[11],[32,2],[68,195],[97],[4,64],[32,0],[34,21],[252,3],[40,1,0],[184],[33,15],...makeString(_,"length",1),[33,26],[32,6],[252,2],[65,7],[32,26],[252,2],[65,195,1],[32,15],[65,1],[65,0],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[68,0],[33,17],[3,64],[32,17],[32,15],[99],[4,64],[32,6],[252,2],[65,7],[32,17],[65,1],[68,0],[65,128,1],[16,builtin('__Number_prototype_toString')],[33,5],[252,2],[32,5],[32,17],[33,28],[32,21],[33,27],[65,8],[16,builtin('__Porffor_allocateBytes')],[34,25],[65,1],[54,0,0],[32,25],[32,28],[252,3],[32,27],[252,3],[106],[45,0,4],[58,0,4],[32,25],[184],[65,195,1],[33,5],[65,195,1],[65,4],[65,1],[16,builtin('__Porffor_object_expr_initWithFlags')],[33,5],[183],[26],[32,17],[68,1],[160],[33,17],[12,1],[11],[11],[32,6],[252,2],[65,7],[16,builtin('__Porffor_object_preventExtensions')],[33,5],[183],[26],[11],...glbl(35,'underlyingVals',124),[65,208,0],[32,6],[65,7],[16,builtin('__Porffor_array_fastPush')],[33,5],[26],...glbl(35,'underlyingKeys',124),[65,208,0],[32,0],[32,1],[16,builtin('__Porffor_array_fastPush')],[33,5],[68,1],[161],[33,4],[11],[32,4],[33,30],...glbl(35,'underlyingVals',124),[33,29],[32,30],[252,3],[65,9],[108],[32,29],[252,3],[106],[34,20],[43,0,4],[32,20],[45,0,12],[34,5],[15],[26],[11],[32,0],[32,1],[15]],
|
7
7
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
8
|
-
locals:[124,124,124,127,124,124,127,124,
|
8
|
+
locals:[124,124,124,127,124,124,127,124,124,124,124,124,124,124,124,124,124,124,127,124,124,124,124,127,124,124,124,124,124],localNames:["obj","obj#type","t","remap","idx","#last_type","underlying","#logicinner_tmp","#typeswitch_tmp1","proto","key1","key2","key3","key4","arr","len","key5","i","#member_obj_0","#member_prop_0","#loadArray_offset","str","key6","#member_obj_1","#member_prop_1","#member_allocd","key7","#member_obj_2","#member_prop_2","#member_obj_3","#member_prop_3"],
|
9
9
|
usedTypes:[7,80,195,67],
|
10
10
|
globalInits:{underlyingKeys:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingKeys'),124),...glbl(36,'underlyingKeys',124),[65,16],[26]],underlyingVals:(_,{allocPage,glbl})=>[number(allocPage(_,'__internal_object.ts/underlyingVals'),124),...glbl(36,'underlyingVals',124),[65,128,128,4],[26]]},
|
11
11
|
}
|
@@ -728,7 +728,7 @@ locals:[124,124],localNames:["arg","arg#type","ptr","end"],
|
|
728
728
|
usesImports:1,
|
729
729
|
}
|
730
730
|
this.__Porffor_printHexDigit = {
|
731
|
-
wasm:()=>[[32,0],[33,2],[65,1],[33,3],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[32,2],[68,15],[97],[
|
731
|
+
wasm:()=>[[32,0],[33,2],[65,1],[33,3],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[2,64],[32,2],[68,15],[97],[13,0],[32,2],[68,14],[97],[13,1],[32,2],[68,13],[97],[13,2],[32,2],[68,12],[97],[13,3],[32,2],[68,11],[97],[13,4],[32,2],[68,10],[97],[13,5],[12,6],[11],[68,102],[16,1],[68,0],[65,128,1],[15],[26],[11],[68,101],[16,1],[68,0],[65,128,1],[15],[26],[11],[68,100],[16,1],[68,0],[65,128,1],[15],[26],[11],[68,99],[16,1],[68,0],[65,128,1],[15],[26],[11],[68,98],[16,1],[68,0],[65,128,1],[15],[26],[11],[68,97],[16,1],[68,0],[65,128,1],[15],[26],[11],[32,0],[16,0],[11],[68,0],[65,128,1],[15]],
|
732
732
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
733
733
|
locals:[124,127],localNames:["arg","arg#type","#switch_82","#switch_82#type"],
|
734
734
|
usesImports:1,
|
@@ -1563,7 +1563,7 @@ usedTypes:[195,7,40],
|
|
1563
1563
|
constr:1,
|
1564
1564
|
}
|
1565
1565
|
this.__Error_prototype_toString = {
|
1566
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1566
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1567
1567
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1568
1568
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_105","#member_prop_105","#last_type","#member_obj_106","#member_prop_106","#member_obj_107","#member_prop_107"],
|
1569
1569
|
usedTypes:[40,7,195],
|
@@ -1576,7 +1576,7 @@ usedTypes:[195,7,41],
|
|
1576
1576
|
constr:1,
|
1577
1577
|
}
|
1578
1578
|
this.__AggregateError_prototype_toString = {
|
1579
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1579
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1580
1580
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1581
1581
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_111","#member_prop_111","#last_type","#member_obj_112","#member_prop_112","#member_obj_113","#member_prop_113"],
|
1582
1582
|
usedTypes:[41,7,195],
|
@@ -1589,7 +1589,7 @@ usedTypes:[195,7,42],
|
|
1589
1589
|
constr:1,
|
1590
1590
|
}
|
1591
1591
|
this.__TypeError_prototype_toString = {
|
1592
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1592
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1593
1593
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1594
1594
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_117","#member_prop_117","#last_type","#member_obj_118","#member_prop_118","#member_obj_119","#member_prop_119"],
|
1595
1595
|
usedTypes:[42,7,195],
|
@@ -1602,7 +1602,7 @@ usedTypes:[195,7,43],
|
|
1602
1602
|
constr:1,
|
1603
1603
|
}
|
1604
1604
|
this.__ReferenceError_prototype_toString = {
|
1605
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1605
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1606
1606
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1607
1607
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_123","#member_prop_123","#last_type","#member_obj_124","#member_prop_124","#member_obj_125","#member_prop_125"],
|
1608
1608
|
usedTypes:[43,7,195],
|
@@ -1615,7 +1615,7 @@ usedTypes:[195,7,44],
|
|
1615
1615
|
constr:1,
|
1616
1616
|
}
|
1617
1617
|
this.__SyntaxError_prototype_toString = {
|
1618
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1618
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1619
1619
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1620
1620
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_129","#member_prop_129","#last_type","#member_obj_130","#member_prop_130","#member_obj_131","#member_prop_131"],
|
1621
1621
|
usedTypes:[44,7,195],
|
@@ -1628,7 +1628,7 @@ usedTypes:[195,7,45],
|
|
1628
1628
|
constr:1,
|
1629
1629
|
}
|
1630
1630
|
this.__RangeError_prototype_toString = {
|
1631
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1631
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1632
1632
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1633
1633
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_135","#member_prop_135","#last_type","#member_obj_136","#member_prop_136","#member_obj_137","#member_prop_137"],
|
1634
1634
|
usedTypes:[45,7,195],
|
@@ -1641,7 +1641,7 @@ usedTypes:[195,7,46],
|
|
1641
1641
|
constr:1,
|
1642
1642
|
}
|
1643
1643
|
this.__EvalError_prototype_toString = {
|
1644
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1644
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1645
1645
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1646
1646
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_141","#member_prop_141","#last_type","#member_obj_142","#member_prop_142","#member_obj_143","#member_prop_143"],
|
1647
1647
|
usedTypes:[46,7,195],
|
@@ -1654,7 +1654,7 @@ usedTypes:[195,7,47],
|
|
1654
1654
|
constr:1,
|
1655
1655
|
}
|
1656
1656
|
this.__URIError_prototype_toString = {
|
1657
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1657
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1658
1658
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1659
1659
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_147","#member_prop_147","#last_type","#member_obj_148","#member_prop_148","#member_obj_149","#member_prop_149"],
|
1660
1660
|
usedTypes:[47,7,195],
|
@@ -1667,7 +1667,7 @@ usedTypes:[195,7,48],
|
|
1667
1667
|
constr:1,
|
1668
1668
|
}
|
1669
1669
|
this.__Test262Error_prototype_toString = {
|
1670
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1670
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1671
1671
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1672
1672
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_153","#member_prop_153","#last_type","#member_obj_154","#member_prop_154","#member_obj_155","#member_prop_155"],
|
1673
1673
|
usedTypes:[48,7,195],
|
@@ -1680,7 +1680,7 @@ usedTypes:[195,7,49],
|
|
1680
1680
|
constr:1,
|
1681
1681
|
}
|
1682
1682
|
this.__TodoError_prototype_toString = {
|
1683
|
-
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[
|
1683
|
+
wasm:(_,{makeString,builtin})=>[[32,0],[33,2],...makeString(_,"message",1),[33,6],[32,2],[34,5],[252,2],[65,7],[32,6],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[33,4],[34,3],[252,3],[40,1,0],[184],[68,0],[97],[4,64],...makeString(_,"name",1),[33,9],[32,2],[34,8],[252,2],[65,7],[32,9],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],[15],[26],[11],...makeString(_,"name",1),[33,11],[32,2],[34,10],[252,2],[65,7],[32,11],[252,3],[65,195,1],[16,builtin('__Porffor_object_get')],[34,7],...makeString(_,": ",1),[65,195,1],[16,builtin('__Porffor_concatStrings')],[34,7],[32,3],[32,4],[16,builtin('__Porffor_concatStrings')],[34,7],[15]],
|
1684
1684
|
params:[124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
1685
1685
|
locals:[124,124,127,124,124,127,124,124,124,124],localNames:["_this","_this#type","obj","message","message#type","#member_obj_159","#member_prop_159","#last_type","#member_obj_160","#member_prop_160","#member_obj_161","#member_prop_161"],
|
1686
1686
|
usedTypes:[49,7,195],
|
package/compiler/codegen.js
CHANGED
@@ -748,8 +748,20 @@ const concatStrings = (scope, left, right, leftType, rightType) => {
|
|
748
748
|
];
|
749
749
|
};
|
750
750
|
|
751
|
-
const compareStrings = (scope, left, right, leftType, rightType) => {
|
752
|
-
|
751
|
+
const compareStrings = (scope, left, right, leftType, rightType, noConv = false) => {
|
752
|
+
if (noConv) return [
|
753
|
+
...left,
|
754
|
+
Opcodes.i32_to_u,
|
755
|
+
...leftType,
|
756
|
+
|
757
|
+
...right,
|
758
|
+
Opcodes.i32_to_u,
|
759
|
+
...rightType,
|
760
|
+
|
761
|
+
[ Opcodes.call, includeBuiltin(scope, '__Porffor_strcmp').index ],
|
762
|
+
[ Opcodes.drop ]
|
763
|
+
];
|
764
|
+
|
753
765
|
return [
|
754
766
|
...left,
|
755
767
|
...(valtypeBinary === Valtype.i32 ? [ [ Opcodes.f64_convert_i32_s ] ] : []),
|
@@ -953,7 +965,7 @@ const nullish = (scope, wasm, type, intIn = false, intOut = false) => {
|
|
953
965
|
];
|
954
966
|
};
|
955
967
|
|
956
|
-
const performOp = (scope, op, left, right, leftType, rightType
|
968
|
+
const performOp = (scope, op, left, right, leftType, rightType) => {
|
957
969
|
if (op === '||' || op === '&&' || op === '??') {
|
958
970
|
return performLogicOp(scope, op, left, right, leftType, rightType);
|
959
971
|
}
|
@@ -967,8 +979,8 @@ const performOp = (scope, op, left, right, leftType, rightType, _global = false,
|
|
967
979
|
const startOut = [], endOut = [];
|
968
980
|
const finalize = out => startOut.concat(out, endOut);
|
969
981
|
|
970
|
-
// if strict (in)equal check types match
|
971
|
-
if (strictOp) {
|
982
|
+
// if strict (in)equal check types match, skip if known
|
983
|
+
if (strictOp && !(knownLeft && knownLeft === knownRight)) {
|
972
984
|
endOut.push(
|
973
985
|
...leftType,
|
974
986
|
number(TYPE_FLAGS.parity, Valtype.i32),
|
@@ -989,9 +1001,9 @@ const performOp = (scope, op, left, right, leftType, rightType, _global = false,
|
|
989
1001
|
// todo: if equality op and an operand is undefined, return false
|
990
1002
|
// todo: niche null hell with 0
|
991
1003
|
|
992
|
-
|
993
|
-
|
994
|
-
|
1004
|
+
const knownLeftStr = knownLeft === TYPES.string || knownLeft === TYPES.bytestring || knownLeft === TYPES.stringobject;
|
1005
|
+
const knownRightStr = knownRight === TYPES.string || knownRight === TYPES.bytestring || knownRight === TYPES.stringobject;
|
1006
|
+
if (knownLeftStr || knownRightStr) {
|
995
1007
|
if (op === '+') {
|
996
1008
|
// string concat (a + b)
|
997
1009
|
return concatStrings(scope, left, right, leftType, rightType);
|
@@ -1003,7 +1015,7 @@ const performOp = (scope, op, left, right, leftType, rightType, _global = false,
|
|
1003
1015
|
// string comparison
|
1004
1016
|
if (op === '===' || op === '==' || op === '!==' || op === '!=') {
|
1005
1017
|
return [
|
1006
|
-
...compareStrings(scope, left, right, leftType, rightType),
|
1018
|
+
...compareStrings(scope, left, right, leftType, rightType, knownLeftStr && knownRightStr),
|
1007
1019
|
...(op === '!==' || op === '!=' ? [ [ Opcodes.i32_eqz ] ] : [])
|
1008
1020
|
];
|
1009
1021
|
}
|
@@ -1116,7 +1128,7 @@ const knownNullish = decl => {
|
|
1116
1128
|
return false;
|
1117
1129
|
};
|
1118
1130
|
|
1119
|
-
const generateBinaryExp = (scope, decl
|
1131
|
+
const generateBinaryExp = (scope, decl) => {
|
1120
1132
|
if (decl.operator === 'instanceof') {
|
1121
1133
|
// try hacky version for built-ins first
|
1122
1134
|
const rightName = decl.right.name;
|
@@ -1192,7 +1204,7 @@ const generateBinaryExp = (scope, decl, _global, _name) => {
|
|
1192
1204
|
}
|
1193
1205
|
}
|
1194
1206
|
|
1195
|
-
const out = performOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right)
|
1207
|
+
const out = performOp(scope, decl.operator, generate(scope, decl.left), generate(scope, decl.right), getNodeType(scope, decl.left), getNodeType(scope, decl.right));
|
1196
1208
|
if (valtype !== 'i32' && ['==', '===', '!=', '!==', '>', '>=', '<', '<='].includes(decl.operator)) out.push(Opcodes.i32_from_u);
|
1197
1209
|
|
1198
1210
|
return out;
|
@@ -1282,8 +1294,8 @@ const asmFuncToAsm = (scope, func) => {
|
|
1282
1294
|
});
|
1283
1295
|
};
|
1284
1296
|
|
1285
|
-
const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTypes = [], globals: globalTypes = [], globalInits = [], returns = [], returnType, localNames = [], globalNames = [],
|
1286
|
-
if (wasm == null) { // called with no
|
1297
|
+
const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTypes = [], globals: globalTypes = [], globalInits = [], returns = [], returnType, localNames = [], globalNames = [], table = false, constr = false, hasRestArgument = false, usesTag = false, usesImports = false, usedTypes = [] } = {}) => {
|
1298
|
+
if (wasm == null) { // called with no built-in
|
1287
1299
|
log.warning('codegen', `${name} has no built-in!`);
|
1288
1300
|
wasm = [];
|
1289
1301
|
}
|
@@ -1291,17 +1303,10 @@ const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTy
|
|
1291
1303
|
const existing = funcByName(name);
|
1292
1304
|
if (existing) return existing;
|
1293
1305
|
|
1294
|
-
const nameParam = i => localNames[i] ?? `l${i}`;
|
1295
|
-
|
1296
1306
|
const allLocals = params.concat(localTypes);
|
1297
1307
|
const locals = {};
|
1298
1308
|
for (let i = 0; i < allLocals.length; i++) {
|
1299
|
-
locals[
|
1300
|
-
}
|
1301
|
-
|
1302
|
-
for (const x in _data) {
|
1303
|
-
if (data.find(y => y.page === x)) return;
|
1304
|
-
data.push({ page: x, bytes: _data[x] });
|
1309
|
+
locals[localNames[i] ?? `l${i}`] = { idx: i, type: allLocals[i] };
|
1305
1310
|
}
|
1306
1311
|
|
1307
1312
|
const func = {
|
@@ -1314,9 +1319,8 @@ const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTy
|
|
1314
1319
|
returnType,
|
1315
1320
|
internal: true,
|
1316
1321
|
index: currentFuncIndex++,
|
1317
|
-
|
1318
|
-
constr,
|
1319
|
-
globalInits
|
1322
|
+
globalInits,
|
1323
|
+
constr, table, usesImports, hasRestArgument
|
1320
1324
|
};
|
1321
1325
|
|
1322
1326
|
funcs.push(func);
|
@@ -1327,42 +1331,29 @@ const asmFunc = (name, { wasm, params = [], typedParams = false, locals: localTy
|
|
1327
1331
|
else wasm = asmFuncToAsm(func, wasm);
|
1328
1332
|
}
|
1329
1333
|
|
1330
|
-
let baseGlobalIdx, i = 0;
|
1331
|
-
for (const type of globalTypes) {
|
1332
|
-
if (baseGlobalIdx === undefined) baseGlobalIdx = globals['#ind'];
|
1333
|
-
|
1334
|
-
globals[globalNames[i] ?? `${name}_global_${i}`] = { idx: globals['#ind']++, type, init: globalInits[i] ?? 0 };
|
1335
|
-
i++;
|
1336
|
-
}
|
1337
|
-
|
1338
1334
|
if (globalTypes.length !== 0) {
|
1339
1335
|
// offset global ops for base global idx
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1336
|
+
let baseGlobalIdx, i = 0;
|
1337
|
+
for (const type of globalTypes) {
|
1338
|
+
if (baseGlobalIdx === undefined) baseGlobalIdx = globals['#ind'];
|
1339
|
+
|
1340
|
+
globals[globalNames[i] ?? `${name}_global_${i}`] = { idx: globals['#ind']++, type, init: globalInits[i] ?? 0 };
|
1341
|
+
i++;
|
1344
1342
|
}
|
1345
|
-
}
|
1346
1343
|
|
1347
|
-
|
1348
|
-
|
1349
|
-
if (inst
|
1350
|
-
inst
|
1351
|
-
inst.push(...unsignedLEB128(allocPage({ scope: func, pages }, 'func lut')));
|
1344
|
+
for (let i = 0; i < wasm.length; i++) {
|
1345
|
+
const inst = wasm[i];
|
1346
|
+
if (inst[0] === Opcodes.global_get || inst[0] === Opcodes.global_set) {
|
1347
|
+
inst[1] += baseGlobalIdx;
|
1352
1348
|
}
|
1353
1349
|
}
|
1354
|
-
|
1355
|
-
funcs.table = true;
|
1356
1350
|
}
|
1357
1351
|
|
1358
|
-
if (
|
1352
|
+
if (table) funcs.table = true;
|
1359
1353
|
if (usesTag) ensureTag();
|
1360
|
-
if (usesImports) func.usesImports = true;
|
1361
|
-
|
1362
1354
|
for (const x of usedTypes) typeUsed(func, x);
|
1363
1355
|
|
1364
1356
|
func.wasm = wasm;
|
1365
|
-
|
1366
1357
|
return func;
|
1367
1358
|
};
|
1368
1359
|
|
@@ -2046,15 +2037,18 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2046
2037
|
name = func.name;
|
2047
2038
|
}
|
2048
2039
|
|
2049
|
-
if (!decl._new && name === 'eval') {
|
2040
|
+
if (!decl._new && (name === 'eval' || (decl.callee.type === 'SequenceExpression' && decl.callee.expressions.at(-1)?.name === 'eval'))) {
|
2050
2041
|
const known = knownValue(scope, decl.arguments[0]);
|
2051
2042
|
if (known !== unknownValue) {
|
2052
|
-
// known
|
2043
|
+
// eval('with known/literal string')
|
2053
2044
|
const code = String(known);
|
2054
2045
|
|
2055
2046
|
let parsed;
|
2056
2047
|
try {
|
2057
|
-
parsed =
|
2048
|
+
parsed = {
|
2049
|
+
type: 'BlockStatement',
|
2050
|
+
body: parse(code).body.map(objectHack)
|
2051
|
+
};
|
2058
2052
|
} catch (e) {
|
2059
2053
|
if (e.name === 'SyntaxError') {
|
2060
2054
|
// throw syntax errors of evals at runtime instead
|
@@ -2064,11 +2058,24 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2064
2058
|
throw e;
|
2065
2059
|
}
|
2066
2060
|
|
2061
|
+
if (decl.callee.type === 'SequenceExpression' || decl.optional) {
|
2062
|
+
// indirect, use separate func+scope
|
2063
|
+
const [ func ] = generateFunc({}, {
|
2064
|
+
type: 'ArrowFunctionExpression',
|
2065
|
+
body: parsed,
|
2066
|
+
expression: true
|
2067
|
+
}, true);
|
2068
|
+
|
2069
|
+
func.generate();
|
2070
|
+
|
2071
|
+
return [
|
2072
|
+
[ Opcodes.call, func.index ],
|
2073
|
+
...setLastType(scope)
|
2074
|
+
];
|
2075
|
+
}
|
2076
|
+
|
2067
2077
|
scope.inEval = true;
|
2068
|
-
const out = generate(scope,
|
2069
|
-
type: 'BlockStatement',
|
2070
|
-
body: parsed.body
|
2071
|
-
});
|
2078
|
+
const out = generate(scope, parsed);
|
2072
2079
|
scope.inEval = false;
|
2073
2080
|
|
2074
2081
|
out.push(...setLastType(scope, getNodeType(scope, getLastNode(parsed.body))));
|
@@ -2079,12 +2086,12 @@ const generateCall = (scope, decl, _global, _name, unusedValue = false) => {
|
|
2079
2086
|
if (name === 'Function') {
|
2080
2087
|
const known = knownValue(scope, decl.arguments[0]);
|
2081
2088
|
if (known !== unknownValue) {
|
2082
|
-
//
|
2089
|
+
// new Function('with known/literal string')
|
2083
2090
|
const code = String(known);
|
2084
2091
|
|
2085
2092
|
let parsed;
|
2086
2093
|
try {
|
2087
|
-
parsed = parse(`(function(){${code}})`);
|
2094
|
+
parsed = objectHack(parse(`(function(){${code}})`));
|
2088
2095
|
} catch (e) {
|
2089
2096
|
if (e.name === 'SyntaxError') {
|
2090
2097
|
// throw syntax errors of evals at runtime instead
|
@@ -3521,12 +3528,7 @@ const generateVar = (scope, decl) => {
|
|
3521
3528
|
return out;
|
3522
3529
|
};
|
3523
3530
|
|
3524
|
-
const privateIDName = name => '
|
3525
|
-
const privateIdentifierToIdentifier = decl => ({
|
3526
|
-
type: 'Identifier',
|
3527
|
-
name: privateIDName(decl.name)
|
3528
|
-
});
|
3529
|
-
|
3531
|
+
const privateIDName = name => '__#' + name;
|
3530
3532
|
const getProperty = (decl, forceValueStr = false) => {
|
3531
3533
|
const prop = decl.property ?? decl.key;
|
3532
3534
|
if (decl.computed) return prop;
|
@@ -3746,7 +3748,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3746
3748
|
], generate(scope, decl.right), [
|
3747
3749
|
[ Opcodes.local_get, pointerTmp ],
|
3748
3750
|
[ Opcodes.i32_load8_u, 0, ValtypeSize.i32 + ValtypeSize[valtype] ]
|
3749
|
-
], getNodeType(scope, decl.right)
|
3751
|
+
], getNodeType(scope, decl.right))),
|
3750
3752
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3751
3753
|
[ Opcodes.store, 0, ValtypeSize.i32 ],
|
3752
3754
|
|
@@ -3766,7 +3768,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3766
3768
|
[ Opcodes.local_get, pointerTmp ],
|
3767
3769
|
[ Opcodes.i32_load8_u, 0, 4 ],
|
3768
3770
|
Opcodes.i32_from_u
|
3769
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3771
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3770
3772
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3771
3773
|
|
3772
3774
|
Opcodes.i32_to_u,
|
@@ -3780,7 +3782,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3780
3782
|
[ Opcodes.local_get, pointerTmp ],
|
3781
3783
|
[ Opcodes.i32_load8_u, 0, 4 ],
|
3782
3784
|
Opcodes.i32_from_u
|
3783
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3785
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3784
3786
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3785
3787
|
|
3786
3788
|
number(0),
|
@@ -3798,7 +3800,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3798
3800
|
[ Opcodes.local_get, pointerTmp ],
|
3799
3801
|
[ Opcodes.i32_load8_s, 0, 4 ],
|
3800
3802
|
Opcodes.i32_from
|
3801
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3803
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3802
3804
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3803
3805
|
|
3804
3806
|
Opcodes.i32_to,
|
@@ -3814,7 +3816,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3814
3816
|
[ Opcodes.local_get, pointerTmp ],
|
3815
3817
|
[ Opcodes.i32_load16_u, 0, 4 ],
|
3816
3818
|
Opcodes.i32_from_u
|
3817
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3819
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3818
3820
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3819
3821
|
|
3820
3822
|
Opcodes.i32_to_u,
|
@@ -3830,7 +3832,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3830
3832
|
[ Opcodes.local_get, pointerTmp ],
|
3831
3833
|
[ Opcodes.i32_load16_s, 0, 4 ],
|
3832
3834
|
Opcodes.i32_from
|
3833
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3835
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3834
3836
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3835
3837
|
|
3836
3838
|
Opcodes.i32_to,
|
@@ -3846,7 +3848,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3846
3848
|
[ Opcodes.local_get, pointerTmp ],
|
3847
3849
|
[ Opcodes.i32_load, 0, 4 ],
|
3848
3850
|
Opcodes.i32_from_u
|
3849
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3851
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3850
3852
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3851
3853
|
|
3852
3854
|
Opcodes.i32_to_u,
|
@@ -3862,7 +3864,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3862
3864
|
[ Opcodes.local_get, pointerTmp ],
|
3863
3865
|
[ Opcodes.i32_load, 0, 4 ],
|
3864
3866
|
Opcodes.i32_from
|
3865
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3867
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3866
3868
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3867
3869
|
|
3868
3870
|
Opcodes.i32_to,
|
@@ -3878,7 +3880,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3878
3880
|
[ Opcodes.local_get, pointerTmp ],
|
3879
3881
|
[ Opcodes.f32_load, 0, 4 ],
|
3880
3882
|
[ Opcodes.f64_promote_f32 ]
|
3881
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3883
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3882
3884
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3883
3885
|
|
3884
3886
|
[ Opcodes.f32_demote_f64 ],
|
@@ -3893,7 +3895,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3893
3895
|
...(op === '=' ? generate(scope, decl.right) : performOp(scope, op, [
|
3894
3896
|
[ Opcodes.local_get, pointerTmp ],
|
3895
3897
|
[ Opcodes.f64_load, 0, 4 ]
|
3896
|
-
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right)
|
3898
|
+
], generate(scope, decl.right), [ number(TYPES.number, Valtype.i32) ], getNodeType(scope, decl.right))),
|
3897
3899
|
...optional([ Opcodes.local_tee, newValueTmp ]),
|
3898
3900
|
|
3899
3901
|
[ Opcodes.f64_store, 0, 4 ]
|
@@ -3940,7 +3942,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
3940
3942
|
|
3941
3943
|
[ Opcodes.call, includeBuiltin(scope, '__Porffor_object_get').index ],
|
3942
3944
|
...setLastType(scope)
|
3943
|
-
], generate(scope, decl.right), getLastType(scope), getNodeType(scope, decl.right)
|
3945
|
+
], generate(scope, decl.right), getLastType(scope), getNodeType(scope, decl.right))),
|
3944
3946
|
...getNodeType(scope, decl),
|
3945
3947
|
|
3946
3948
|
[ Opcodes.call, includeBuiltin(scope, scope.strict ? '__Porffor_object_setStrict' : '__Porffor_object_set').index ],
|
@@ -4029,7 +4031,7 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
4029
4031
|
...generate(scope, decl.right, isGlobal, name),
|
4030
4032
|
[ isGlobal ? Opcodes.global_set : Opcodes.local_set, local.idx ],
|
4031
4033
|
[ isGlobal ? Opcodes.global_get : Opcodes.local_get, local.idx ]
|
4032
|
-
], getType(scope, name), getNodeType(scope, decl.right)
|
4034
|
+
], getType(scope, name), getNodeType(scope, decl.right)),
|
4033
4035
|
|
4034
4036
|
...setType(scope, name, getLastType(scope), true)
|
4035
4037
|
];
|
@@ -4037,7 +4039,9 @@ const generateAssign = (scope, decl, _global, _name, valueUnused = false) => {
|
|
4037
4039
|
|
4038
4040
|
const out = setLocalWithType(
|
4039
4041
|
scope, name, isGlobal,
|
4040
|
-
performOp(scope, op, [
|
4042
|
+
performOp(scope, op, [
|
4043
|
+
[ isGlobal ? Opcodes.global_get : Opcodes.local_get, local.idx ]
|
4044
|
+
], generate(scope, decl.right), getType(scope, name), getNodeType(scope, decl.right)),
|
4041
4045
|
!valueUnused,
|
4042
4046
|
getNodeType(scope, decl)
|
4043
4047
|
);
|
@@ -6496,8 +6500,7 @@ const generateFunc = (scope, decl, forceNoExpr = false) => {
|
|
6496
6500
|
start: decl.start,
|
6497
6501
|
locals: {},
|
6498
6502
|
localInd: 0,
|
6499
|
-
// value, type
|
6500
|
-
returns: [ valtypeBinary, Valtype.i32 ],
|
6503
|
+
returns: [ valtypeBinary, Valtype.i32 ], // value, type
|
6501
6504
|
name,
|
6502
6505
|
index: currentFuncIndex++,
|
6503
6506
|
arrow,
|
package/compiler/disassemble.js
CHANGED
@@ -140,4 +140,4 @@ export const highlightAsm = asm => asm
|
|
140
140
|
.replace(/(block|loop|if|end|else|try|catch_all|catch|delegate)/g, _ => `\x1B[95m${_}\x1B[0m`)
|
141
141
|
.replace(/unreachable/g, _ => `\x1B[91m${_}\x1B[0m`)
|
142
142
|
.replace(/ \-?[0-9\.]+/g, _ => ` \x1B[33m${_.slice(1)}\x1B[0m`)
|
143
|
-
.replace(/;;.*$/gm, _ => `\x1B[
|
143
|
+
.replace(/;;.*$/gm, _ => `\x1B[2m${_.replaceAll(/\x1B\[[0-9]+m/g, '')}\x1B[0m`);
|
package/compiler/index.js
CHANGED
@@ -36,7 +36,7 @@ const progressStart = msg => {
|
|
36
36
|
|
37
37
|
const log = (extra, after) => {
|
38
38
|
const pre = extra ? `${extra}` : spinner[spin++ % 4];
|
39
|
-
process.stdout.write(`\r\u001b[
|
39
|
+
process.stdout.write(`\r\u001b[2m${' '.repeat(120)}\r${' '.repeat(12 - pre.length)}${pre} ${msg}${after ?? ''}\u001b[0m`);
|
40
40
|
};
|
41
41
|
log();
|
42
42
|
|
@@ -49,7 +49,7 @@ const progressDone = (msg, start) => {
|
|
49
49
|
clearInterval(progressInterval);
|
50
50
|
|
51
51
|
const timeStr = (performance.now() - start).toFixed(0);
|
52
|
-
console.log(`\r${' '.repeat(120)}\r\u001b[
|
52
|
+
console.log(`\r${' '.repeat(120)}\r\u001b[2m${' '.repeat(10 - timeStr.length)}${timeStr}ms\u001b[0m \u001b[92m${msg}\u001b[0m`);
|
53
53
|
progressLines++;
|
54
54
|
};
|
55
55
|
const progressClear = () => {
|
@@ -214,7 +214,7 @@ export default (code, module = undefined) => {
|
|
214
214
|
if (logProgress) {
|
215
215
|
const total = performance.now();
|
216
216
|
progressClear();
|
217
|
-
console.log(`\u001b[
|
217
|
+
console.log(`\u001b[2m[${total.toFixed(0)}ms]\u001b[0m \u001b[32mcompiled ${globalThis.file} \u001b[90m->\u001b[0m \u001b[92m${outFile}\u001b[90m (${(fs.statSync(outFile).size / 1000).toFixed(1)}KB)\u001b[0m`);
|
218
218
|
}
|
219
219
|
|
220
220
|
if (process.version) process.exit();
|
@@ -233,7 +233,7 @@ export default (code, module = undefined) => {
|
|
233
233
|
if (logProgress) {
|
234
234
|
const total = performance.now();
|
235
235
|
progressClear();
|
236
|
-
console.log(`\u001b[
|
236
|
+
console.log(`\u001b[2m[${total.toFixed(0)}ms]\u001b[0m \u001b[32mcompiled ${globalThis.file} \u001b[90m->\u001b[0m \u001b[92m${outFile}\u001b[90m (${(fs.statSync(outFile).size / 1000).toFixed(1)}KB)\u001b[0m`);
|
237
237
|
}
|
238
238
|
|
239
239
|
if (process.version) process.exit();
|
@@ -293,7 +293,7 @@ export default (code, module = undefined) => {
|
|
293
293
|
if (logProgress) {
|
294
294
|
const total = performance.now();
|
295
295
|
progressClear();
|
296
|
-
console.log(`\u001b[
|
296
|
+
console.log(`\u001b[2m[${total.toFixed(0)}ms]\u001b[0m \u001b[32mcompiled ${globalThis.file} \u001b[90m->\u001b[0m \u001b[92m${outFile}\u001b[90m (${(fs.statSync(outFile).size / 1000).toFixed(1)}KB)\u001b[0m`);
|
297
297
|
}
|
298
298
|
|
299
299
|
process.exit();
|
package/compiler/precompile.js
CHANGED
@@ -205,11 +205,11 @@ const precompile = async () => {
|
|
205
205
|
throw e;
|
206
206
|
}
|
207
207
|
|
208
|
-
process.stdout.write(`\r${' '.repeat(80)}\r\u001b[
|
208
|
+
process.stdout.write(`\r${' '.repeat(80)}\r\u001b[2m${`[${(performance.now() - t).toFixed(2)}ms]`.padEnd(12, ' ')}\u001b[0m\u001b[92m${file}\u001b[0m\r`);
|
209
209
|
}
|
210
210
|
|
211
211
|
const total = performance.now() - t;
|
212
|
-
console.log(`\r${' '.repeat(80)}\r\u001b[
|
212
|
+
console.log(`\r${' '.repeat(80)}\r\u001b[2m${`[${total.toFixed(2)}ms]`.padEnd(12, ' ')}\u001b[0m\u001b[92mcompiled ${fileCount} files/${funcs.length} funcs\u001b[0m \u001b[90m(${['parse', 'codegen', 'opt'].map(x => `${x}: ${((timing[x] / total) * 100).toFixed(0)}%`).join(', ')})\u001b[0m`);
|
213
213
|
|
214
214
|
const comptimeFlagChecks = {
|
215
215
|
hasFunc: x => `hasFunc('${x}')`
|
package/compiler/wrap.js
CHANGED
@@ -364,7 +364,7 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
364
364
|
}
|
365
365
|
|
366
366
|
const disasm = disassemble(func.wasm.slice(min, max), func.name, 0, func.locals, func.params, func.returns, funcs, globals, exceptions)
|
367
|
-
.slice(0, -1).split('\n').filter(x => !x.startsWith('\x1B[
|
367
|
+
.slice(0, -1).split('\n').filter(x => !x.startsWith('\x1B[2m;;'));
|
368
368
|
|
369
369
|
const noAnsi = s => s && s.replace(/\u001b\[[0-9]+m/g, '');
|
370
370
|
let longest = 0;
|
@@ -377,9 +377,9 @@ export default (source, module = undefined, customImports = {}, print = str => p
|
|
377
377
|
disasm[middle] = `\x1B[47m\x1B[30m${noAnsi(disasm[middle])}${'\u00a0'.repeat(longest - noAnsi(disasm[middle]).length)}\x1B[0m`;
|
378
378
|
}
|
379
379
|
|
380
|
-
if (min != 0) console.log('\x1B[
|
380
|
+
if (min != 0) console.log('\x1B[2m...\x1B[0m');
|
381
381
|
console.log(disasm.join('\n'));
|
382
|
-
if (max > func.wasm.length) console.log('\x1B[
|
382
|
+
if (max > func.wasm.length) console.log('\x1B[2m...\x1B[0m\n');
|
383
383
|
};
|
384
384
|
|
385
385
|
const backtrace = (funcInd, blobOffset) => {
|
package/package.json
CHANGED
package/r.cjs
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
// 'use strict';
|
2
|
+
function foo() {
|
3
|
+
'use strict';
|
4
|
+
console.log(this);
|
5
|
+
eval('console.log(this)');
|
6
|
+
(0, eval)('console.log(this)');
|
7
|
+
eval?.('console.log(this)');
|
8
|
+
}
|
9
|
+
|
10
|
+
foo();
|
11
|
+
|
12
|
+
// let o = { set foo(x) { console.log('set foo', x); }, __proto__: { set bar(x) { console.log('set bar', x); } } };
|
13
|
+
|
14
|
+
// o.foo = 1;
|
15
|
+
// o.bar = 2;
|
16
|
+
|
17
|
+
// class C {
|
18
|
+
// // static #method = () => 1;
|
19
|
+
// static #method() {
|
20
|
+
// return 'Test262';
|
21
|
+
// }
|
22
|
+
|
23
|
+
// static getPrivateMethod() {
|
24
|
+
// this.#method = () => 2;
|
25
|
+
// return this.#method();
|
26
|
+
// }
|
27
|
+
// }
|
28
|
+
|
29
|
+
// console.log(C.getPrivateMethod())
|
30
|
+
|
31
|
+
// var __assert_throws = (expectedErrorConstructor, func) => {
|
32
|
+
// if (typeof func !== 'function') {
|
33
|
+
// throw new Test262Error('assert.throws invoked with a non-function value');
|
34
|
+
// }
|
35
|
+
|
36
|
+
// try {
|
37
|
+
// func();
|
38
|
+
// } catch {
|
39
|
+
// return;
|
40
|
+
// }
|
41
|
+
|
42
|
+
// throw new Test262Error('assert.throws failed');
|
43
|
+
// };
|
44
|
+
|
45
|
+
// var __assert__isSameValue = (a, b) => {
|
46
|
+
// if (a === b) {
|
47
|
+
// // Handle +/-0 vs. -/+0
|
48
|
+
// return a !== 0 || 1 / a === 1 / b;
|
49
|
+
// }
|
50
|
+
|
51
|
+
// // Handle NaN vs. NaN
|
52
|
+
// return a !== a && b !== b;
|
53
|
+
// };
|
54
|
+
|
55
|
+
// var __assert_sameValue = (actual, expected) => {
|
56
|
+
// if (__assert__isSameValue(actual, expected)) {
|
57
|
+
// return;
|
58
|
+
// }
|
59
|
+
|
60
|
+
// throw new Test262Error('assert.sameValue failed');
|
61
|
+
// };
|
62
|
+
|
63
|
+
// (function() {
|
64
|
+
// eval(
|
65
|
+
// '__assert_throws(ReferenceError, function() {\
|
66
|
+
// f;\
|
67
|
+
// }, "An initialized binding is not created prior to evaluation");\
|
68
|
+
// __assert_sameValue(\
|
69
|
+
// typeof f,\
|
70
|
+
// "undefined",\
|
71
|
+
// "An uninitialized binding is not created prior to evaluation"\
|
72
|
+
// );\
|
73
|
+
// \
|
74
|
+
// {\
|
75
|
+
// let f = 123;if (false) ; else function f() { }}\
|
76
|
+
// \
|
77
|
+
// __assert_throws(ReferenceError, function() {\
|
78
|
+
// f;\
|
79
|
+
// }, "An initialized binding is not created following evaluation");\
|
80
|
+
// __assert_sameValue(\
|
81
|
+
// typeof f,\
|
82
|
+
// "undefined",\
|
83
|
+
// "An uninitialized binding is not created following evaluation"\
|
84
|
+
// );'
|
85
|
+
// );
|
86
|
+
// }());
|
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.55.
|
3
|
+
globalThis.version = '0.55.13';
|
4
4
|
|
5
5
|
// deno compat
|
6
6
|
if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
|
@@ -9,7 +9,7 @@ if (typeof process === 'undefined' && typeof Deno !== 'undefined') {
|
|
9
9
|
|
10
10
|
const start = performance.now();
|
11
11
|
|
12
|
-
if (process.argv.includes('--help')) {
|
12
|
+
if (process.argv.includes('--help') || process.argv.includes('-h')) {
|
13
13
|
// description + version
|
14
14
|
console.log(`\x1B[1m\x1B[35mPorffor\x1B[0m is a JavaScript/TypeScript engine/compiler/runtime. \x1B[2m(${globalThis.version})\x1B[0m`);
|
15
15
|
|
@@ -40,7 +40,7 @@ if (process.argv.includes('--help')) {
|
|
40
40
|
|
41
41
|
if (cmd.length > 0) post = ' ' + post;
|
42
42
|
|
43
|
-
console.log(` \x1B[
|
43
|
+
console.log(` \x1B[2mporf\x1B[0m \x1B[1m\x1B[${color}m${cmd}\x1B[0m${post} ${' '.repeat(30 - cmd.length - post.length)}${desc}`);
|
44
44
|
}
|
45
45
|
|
46
46
|
// flags
|
@@ -61,15 +61,15 @@ if (process.argv.includes('--help')) {
|
|
61
61
|
for (let [ flag, desc ] of Object.entries({
|
62
62
|
f: 'Print disassembled Wasm generated from user functions',
|
63
63
|
pgo: 'Enable PGO (profile-guided optimization)',
|
64
|
-
|
65
|
-
valtype: 'Valtype to use (i32|i64|\x1B[1mf64\x1B[0m)',
|
66
|
-
prng: 'PRNG algorithm to use (lcg32|xorshift32+|xorshift64+|\x1B[1mxorshift128+\x1B[0m|xoroshiro128+|xoshiro128+)',
|
67
|
-
allocator: 'Allocator to use (oneshot|\x1B[1mchunk\x1B[0m)',
|
68
|
-
'exception-mode': 'Exception mode to use (lut|\x1B[1mstack\x1B[0m)',
|
69
|
-
fastLength: 'Spec non-compliant optimization to make .length faster',
|
64
|
+
valtype: 'Valtype to use, not well supported (i32|i64|\x1B[1mf64\x1B[0m)',
|
70
65
|
'no-coctc': 'Disable COCTC (cross-object compile-time cache)',
|
71
66
|
cyclone: 'Enable experimental Cyclone optimizer',
|
72
|
-
'no-treeshake-wasm-imports': 'Do not treeshake Wasm imports'
|
67
|
+
'no-treeshake-wasm-imports': 'Do not treeshake Wasm imports',
|
68
|
+
allocator: 'Allocator to use (oneshot|\x1B[1mchunk\x1B[0m)',
|
69
|
+
'exception-mode': 'Exception mode to use (lut|\x1B[1mstack\x1B[0m)',
|
70
|
+
'fast-length': 'Non-compliant optimization to make .length faster',
|
71
|
+
'profile-compiler': 'Log general compiler performance (on by default when compiling to a file)',
|
72
|
+
prng: 'PRNG algorithm to use (lcg32|xorshift32+|xorshift64+|\x1B[1mxorshift128+\x1B[0m|xoroshiro128+|xoshiro128+)'
|
73
73
|
})) {
|
74
74
|
flag = '-' + flag;
|
75
75
|
if (flag.length > 3) flag = '-' + flag;
|
@@ -77,7 +77,7 @@ if (process.argv.includes('--help')) {
|
|
77
77
|
console.log(` \x1B[1m${flag}\x1B[0m${' '.repeat(36 - flag.length)}${desc}`);
|
78
78
|
}
|
79
79
|
} else {
|
80
|
-
console.log(` \x1B[2m(To view all flags use --flags)\x1B[0m`);
|
80
|
+
console.log(` \x1B[2m(To view all flags also use --flags)\x1B[0m`);
|
81
81
|
}
|
82
82
|
|
83
83
|
console.log();
|
package/runner/repl.js
CHANGED
@@ -29,8 +29,8 @@ if (host.startsWith('Node')) host = '\x1B[92m' + host;
|
|
29
29
|
if (host.startsWith('Deno')) host = '\x1B[97m' + host;
|
30
30
|
if (host.startsWith('Bun')) host = '\x1B[93m' + host;
|
31
31
|
|
32
|
-
console.log(`Welcome to \x1B[1m\x1B[35mPorffor\x1B[0m \x1B[
|
33
|
-
console.log(`\x1B[90musing opt ${process.argv.find(x => x.startsWith('-O')) ?? '-O1'}, parser ${parser}, valtype ${valtype}\x1B[0m`);
|
32
|
+
console.log(`Welcome to \x1B[1m\x1B[35mPorffor\x1B[0m \x1B[2m(${globalThis.version})\x1B[0m running on \x1B[1m${host.replace('/', ' \x1B[0m\x1B[2m(')})\x1B[0m`);
|
33
|
+
// console.log(`\x1B[90musing opt ${process.argv.find(x => x.startsWith('-O')) ?? '-O1'}, parser ${parser}, valtype ${valtype}\x1B[0m`);
|
34
34
|
console.log();
|
35
35
|
|
36
36
|
let lastMemory, lastPages;
|