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.
Files changed (50) hide show
  1. package/CONTRIBUTING.md +256 -0
  2. package/README.md +64 -44
  3. package/asur/index.js +2 -2
  4. package/byg/index.js +3 -24
  5. package/compiler/2c.js +2 -53
  6. package/compiler/assemble.js +6 -7
  7. package/compiler/builtins/annexb_string.js +12 -12
  8. package/compiler/builtins/annexb_string.ts +5 -6
  9. package/compiler/builtins/array.ts +15 -15
  10. package/compiler/builtins/base64.ts +4 -79
  11. package/compiler/builtins/boolean.ts +18 -0
  12. package/compiler/builtins/crypto.ts +1 -1
  13. package/compiler/builtins/date.ts +2067 -0
  14. package/compiler/builtins/escape.ts +2 -2
  15. package/compiler/builtins/function.ts +5 -0
  16. package/compiler/builtins/int.ts +2 -4
  17. package/compiler/builtins/number.ts +11 -9
  18. package/compiler/builtins/object.ts +4 -0
  19. package/compiler/builtins/porffor.d.ts +28 -10
  20. package/compiler/builtins/set.ts +187 -0
  21. package/compiler/builtins/string.ts +47 -22
  22. package/compiler/builtins.js +19 -36
  23. package/compiler/codegen.js +239 -199
  24. package/compiler/decompile.js +2 -3
  25. package/compiler/embedding.js +2 -2
  26. package/compiler/encoding.js +0 -14
  27. package/compiler/expression.js +1 -1
  28. package/compiler/generated_builtins.js +1138 -208
  29. package/compiler/index.js +0 -2
  30. package/compiler/opt.js +7 -7
  31. package/compiler/parse.js +5 -5
  32. package/compiler/precompile.js +21 -24
  33. package/compiler/prefs.js +6 -5
  34. package/compiler/prototype.js +19 -19
  35. package/compiler/types.js +3 -2
  36. package/compiler/wasmSpec.js +1 -0
  37. package/compiler/wrap.js +70 -54
  38. package/package.json +1 -1
  39. package/rhemyn/compile.js +42 -25
  40. package/rhemyn/parse.js +4 -5
  41. package/runner/compare.js +0 -1
  42. package/runner/debug.js +1 -6
  43. package/runner/index.js +45 -4
  44. package/runner/profiler.js +15 -42
  45. package/runner/repl.js +3 -9
  46. package/runner/sizes.js +2 -2
  47. package/runner/version.js +3 -3
  48. package/.vscode/launch.json +0 -18
  49. package/compiler/builtins/tostring.ts +0 -45
  50. package/test262_changes_from_1afe9b87d2_to_04-09.md +0 -270
@@ -1,5 +1,5 @@
1
- import { Blocktype, Opcodes, Valtype } from "./wasmSpec.js";
2
- import { read_ieee754_binary64, read_signedLEB128, read_unsignedLEB128 } from "./encoding.js";
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);
@@ -1,5 +1,5 @@
1
- import { Opcodes, Valtype } from "./wasmSpec.js";
2
- import { signedLEB128, ieee754_binary64 } from "./encoding.js";
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) {
@@ -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) => [
@@ -1,4 +1,4 @@
1
- import { Opcodes } from "./wasmSpec.js";
1
+ import { Opcodes } from './wasmSpec.js';
2
2
 
3
3
  export const operatorOpcode = {
4
4
  i32: {