porffor 0.2.0-69d30a8 → 0.2.0-6bc63ef
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/CONTRIBUTING.md +256 -0
- package/README.md +64 -44
- package/asur/index.js +2 -2
- package/byg/index.js +3 -24
- package/compiler/2c.js +2 -53
- package/compiler/assemble.js +6 -7
- package/compiler/builtins/annexb_string.js +12 -12
- package/compiler/builtins/annexb_string.ts +5 -6
- package/compiler/builtins/array.ts +15 -15
- package/compiler/builtins/base64.ts +4 -79
- package/compiler/builtins/boolean.ts +18 -0
- package/compiler/builtins/crypto.ts +1 -1
- package/compiler/builtins/date.ts +2067 -0
- package/compiler/builtins/escape.ts +2 -2
- package/compiler/builtins/function.ts +5 -0
- package/compiler/builtins/int.ts +2 -4
- package/compiler/builtins/number.ts +11 -9
- package/compiler/builtins/object.ts +4 -0
- package/compiler/builtins/porffor.d.ts +28 -10
- package/compiler/builtins/set.ts +187 -0
- package/compiler/builtins/string.ts +47 -22
- package/compiler/builtins.js +19 -36
- package/compiler/codegen.js +239 -199
- package/compiler/decompile.js +2 -3
- package/compiler/embedding.js +2 -2
- package/compiler/encoding.js +0 -14
- package/compiler/expression.js +1 -1
- package/compiler/generated_builtins.js +1138 -208
- package/compiler/index.js +0 -2
- package/compiler/opt.js +7 -7
- package/compiler/parse.js +5 -5
- package/compiler/precompile.js +21 -24
- package/compiler/prefs.js +6 -5
- package/compiler/prototype.js +19 -19
- package/compiler/types.js +3 -2
- package/compiler/wasmSpec.js +1 -0
- package/compiler/wrap.js +70 -54
- package/package.json +1 -1
- package/rhemyn/compile.js +42 -25
- package/rhemyn/parse.js +4 -5
- package/runner/compare.js +0 -1
- package/runner/debug.js +1 -6
- package/runner/index.js +45 -4
- package/runner/profiler.js +15 -42
- package/runner/repl.js +3 -9
- package/runner/sizes.js +2 -2
- package/runner/version.js +3 -3
- package/.vscode/launch.json +0 -18
- package/compiler/builtins/tostring.ts +0 -45
- package/test262_changes_from_1afe9b87d2_to_04-09.md +0 -270
package/compiler/decompile.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Blocktype, Opcodes, Valtype } from
|
2
|
-
import { read_ieee754_binary64, read_signedLEB128, read_unsignedLEB128 } from
|
1
|
+
import { Blocktype, Opcodes, Valtype } from './wasmSpec.js';
|
2
|
+
import { read_ieee754_binary64, read_signedLEB128, read_unsignedLEB128 } from './encoding.js';
|
3
3
|
|
4
4
|
const inv = (obj, keyMap = x => x) => Object.keys(obj).reduce((acc, x) => { acc[keyMap(obj[x])] = x; return acc; }, {});
|
5
5
|
const invOpcodes = inv(Opcodes);
|
@@ -110,7 +110,6 @@ export default (wasm, name = '', ind = 0, locals = {}, params = [], returns = []
|
|
110
110
|
|
111
111
|
out += '\n';
|
112
112
|
lastInst = inst;
|
113
|
-
i++;
|
114
113
|
}
|
115
114
|
|
116
115
|
return highlightAsm(out);
|
package/compiler/embedding.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { Opcodes, Valtype } from
|
2
|
-
import { signedLEB128, ieee754_binary64 } from
|
1
|
+
import { Opcodes, Valtype } from './wasmSpec.js';
|
2
|
+
import { signedLEB128, ieee754_binary64 } from './encoding.js';
|
3
3
|
|
4
4
|
export const number = (n, valtype = valtypeBinary) => {
|
5
5
|
switch (valtype) {
|
package/compiler/encoding.js
CHANGED
@@ -7,21 +7,7 @@ export const codifyString = str => {
|
|
7
7
|
return out;
|
8
8
|
};
|
9
9
|
|
10
|
-
// export const encodeString = str => [
|
11
|
-
// str.length,
|
12
|
-
// ...codifyString(str)
|
13
|
-
// ];
|
14
10
|
export const encodeString = str => unsignedLEB128(str.length).concat(codifyString(str));
|
15
|
-
|
16
|
-
// export const encodeVector = data => [
|
17
|
-
// ...unsignedLEB128(data.length),
|
18
|
-
// ...data.flat()
|
19
|
-
// ];
|
20
|
-
// export const encodeVector = data => {
|
21
|
-
// const out = data.flat();
|
22
|
-
// out.unshift.apply(out, unsignedLEB128(data.length));
|
23
|
-
// return out;
|
24
|
-
// };
|
25
11
|
export const encodeVector = data => unsignedLEB128(data.length).concat(data.flat());
|
26
12
|
|
27
13
|
export const encodeLocal = (count, type) => [
|
package/compiler/expression.js
CHANGED