@yeyelailou/co 0.0.0-stage → 0.0.1

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 (335) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +982 -2
  3. package/bin/cocn.js +72 -0
  4. package/bin/install.js +276 -0
  5. package/bin//345/205/245/345/217/243.js +287 -0
  6. package/index.js +84 -0
  7. package/install.js +259 -0
  8. package/install.sh +86 -0
  9. package/package.json +103 -4
  10. package/src/repl.co +93 -0
  11. package/src//345/272/223//345/210/227/350/241/250.co +2455 -0
  12. package/src//345/272/223//345/212/240/345/257/206.co +996 -0
  13. package/src//345/272/223//345/255/227/345/205/270.co +1697 -0
  14. package/src//345/272/223//345/255/227/347/254/246/344/270/262.co +2278 -0
  15. package/src//345/272/223//346/225/260/345/255/246.co +3084 -0
  16. package/src//345/272/223//346/225/260/346/215/256/347/273/223/346/236/204.co +3032 -0
  17. package/src//345/272/223//346/226/207/344/273/266/347/263/273/347/273/237.co +1084 -0
  18. package/src//345/272/223//346/227/245/346/234/237/346/227/266/351/227/264.co +1003 -0
  19. package/src//345/272/223//347/256/227/346/263/225.co +2378 -0
  20. package/src//345/272/223//347/263/273/347/273/237.co +1019 -0
  21. package/src//345/272/223//347/274/226/347/240/201.co +1044 -0
  22. package/src//346/240/207/345/207/206/345/272/223.co +1897 -0
  23. package/src//346/261/202/345/200/274/345/231/250.co +6577 -0
  24. package/src//347/275/221/347/273/234.co +251 -0
  25. package/src//350/231/232/346/213/237/346/234/272.co +3563 -0
  26. package/src//350/247/243/351/207/212/345/231/250.co +59 -0
  27. package/src//350/257/215/346/263/225/345/210/206/346/236/220/345/231/250.co +606 -0
  28. package/src//350/257/255/346/263/225/345/210/206/346/236/220/345/231/250.co +1840 -0
  29. package/src//350/260/203/350/257/225/345/231/250.co +1526 -0
  30. package//345/267/245/345/205/267/lsp/server.js +419 -0
  31. package//345/267/245/345/205/267/lsp//346/265/213/350/257/225.sh +81 -0
  32. package//345/267/245/345/205/267/vscode-cocn/extension.js +203 -0
  33. package//345/267/245/345/205/267/vscode-cocn/package.json +58 -0
  34. package//345/267/245/345/205/267/vscode-cocn/syntaxes/coCN.tmLanguage.json +130 -0
  35. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250/elf.js +127 -0
  36. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/273/243/347/240/201/347/224/237/346/210/220/345/231/250.js +2284 -0
  37. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/analysis.js +116 -0
  38. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/benchmark_demo.js +75 -0
  39. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/dominance.js +158 -0
  40. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/gvn.js +45 -0
  41. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/index.js +121 -0
  42. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/ir.js +237 -0
  43. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/constProp.js +126 -0
  44. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/copyProp.js +57 -0
  45. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/cse.js +62 -0
  46. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/dce.js +68 -0
  47. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/devirt.js +38 -0
  48. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/escape.js +67 -0
  49. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/inline.js +142 -0
  50. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/passes/loopOpt.js +215 -0
  51. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/peephole.js +42 -0
  52. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/regalloc.js +212 -0
  53. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/scheduler.js +86 -0
  54. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/spill.js +78 -0
  55. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/ssa.js +235 -0
  56. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/traceSched.js +47 -0
  57. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250/unroll.js +46 -0
  58. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/harness.js +33 -0
  59. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/run_all.js +11 -0
  60. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_constfold.js +58 -0
  61. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_dce.js +49 -0
  62. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_e2e.js +57 -0
  63. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_gvn_spill.js +45 -0
  64. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_loop.js +46 -0
  65. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_regalloc.js +51 -0
  66. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250//346/265/213/350/257/225/test_ssa.js +65 -0
  67. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//345/205/245/345/217/243.c +9 -0
  68. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//345/205/245/345/217/243.js +38 -0
  69. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//345/220/257/345/212/250/345/231/250.c +414 -0
  70. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/234/272/345/231/250/347/240/201/347/224/237/346/210/220/345/231/250.js +2332 -0
  71. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/01_hello.co +1 -0
  72. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/02_/347/256/227/346/234/257.co +7 -0
  73. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/03_/347/264/257/345/212/240.co +5 -0
  74. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/04_/346/226/220/346/263/242/351/202/243/345/245/221.co +9 -0
  75. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/05_/345/210/227/350/241/250.co +9 -0
  76. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/06_/345/255/227/345/205/270.co +5 -0
  77. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/07_/351/230/266/344/271/230.co +8 -0
  78. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/perf_fib.co +7 -0
  79. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/perf_loop.co +5 -0
  80. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225//346/200/247/350/203/275_/346/226/220/346/263/242.co +11 -0
  81. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237/AST/345/267/245/345/205/267.js +126 -0
  82. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237/index.js +103 -0
  83. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//345/206/205/350/201/224.js +194 -0
  84. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//345/207/275/346/225/260/347/211/271/345/214/226.js +168 -0
  85. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/243/200/346/237/245/346/266/210/351/231/244.js +166 -0
  86. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//345/206/205/350/201/224/346/265/213/350/257/225.js +53 -0
  87. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//345/207/275/346/225/260/347/211/271/345/214/226/346/265/213/350/257/225.js +67 -0
  88. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//347/253/257/345/210/260/347/253/257/346/265/213/350/257/225.js +104 -0
  89. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//347/261/273/345/236/213/346/216/250/346/226/255/346/265/213/350/257/225.js +87 -0
  90. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//350/277/220/350/241/214/346/265/213/350/257/225.js +43 -0
  91. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//346/265/213/350/257/225//351/200/203/351/200/270/345/210/206/346/236/220/346/265/213/350/257/225.js +58 -0
  92. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//347/211/271/345/214/226/347/274/223/345/255/230.js +83 -0
  93. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//347/216/257/345/242/203.js +126 -0
  94. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//347/261/273/345/236/213.js +294 -0
  95. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//347/261/273/345/236/213/346/216/250/346/226/255.js +461 -0
  96. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//350/260/203/347/224/250/345/233/276.js +119 -0
  97. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237//351/200/203/351/200/270/345/210/206/346/236/220.js +184 -0
  98. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/274/226/350/257/221.sh +45 -0
  99. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//347/274/226/350/257/221/345/231/250/345/220/210/345/271/266.co +4818 -0
  100. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/257/215/346/263/225/345/210/206/346/236/220/345/231/250.js +193 -0
  101. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/257/255/346/263/225/345/210/206/346/236/220/345/231/250.js +661 -0
  102. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/alloc.c +206 -0
  103. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/build.sh +70 -0
  104. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/dict.c +143 -0
  105. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/list.c +148 -0
  106. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/math.c +129 -0
  107. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/print.c +135 -0
  108. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/rt.h +177 -0
  109. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/string.c +288 -0
  110. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/syscall.asm +153 -0
  111. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266/test.c +228 -0
  112. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266//344/270/264/346/227/266.c +379 -0
  113. package//345/267/245/345/205/267//345/216/237/347/224/237/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266.c +441 -0
  114. package//345/267/245/345/205/267//347/224/237/346/200/201/cli.js +443 -0
  115. package//345/267/245/345/205/267//347/224/237/346/200/201/docgen.js +113 -0
  116. package//345/267/245/345/205/267//347/224/237/346/200/201//346/263/250/345/206/214/350/241/250/346/234/215/345/212/241.js +200 -0
  117. package//345/267/245/345/205/267//347/224/237/346/200/201//350/247/204/350/214/203.js +125 -0
  118. package//345/267/245/345/205/267//347/224/237/346/200/201//351/252/214/350/257/201/344/270/211/351/200/232/351/201/223.js +94 -0
  119. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250/AST/351/252/214/350/257/201.co +214 -0
  120. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250/elf.co +105 -0
  121. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//344/270/273.co +29 -0
  122. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//344/273/243/347/240/201/347/224/237/346/210/220/345/231/250.co +3669 -0
  123. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//344/274/230/345/214/226/345/231/250.co +1994 -0
  124. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//345/216/237/347/224/237/351/251/261/345/212/250.co +11 -0
  125. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/212/245/351/224/231/350/241/245/344/270/201.co +7 -0
  126. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/234/272/345/231/250/347/240/201/347/224/237/346/210/220/345/231/250.co +2921 -0
  127. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/01_/345/217/230/351/207/217/345/243/260/346/230/216.co +2 -0
  128. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/02_/347/256/227/346/234/257/350/241/250/350/276/276/345/274/217.co +4 -0
  129. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/03_/345/246/202/346/236/234/350/257/255/345/217/245.co +6 -0
  130. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/04_/345/275/223/345/276/252/347/216/257.co +7 -0
  131. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/05_/345/207/275/346/225/260/345/256/232/344/271/211/350/260/203/347/224/250.co +8 -0
  132. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/06_/345/210/227/350/241/250/345/255/227/345/205/270.co +4 -0
  133. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/07_/346/226/220/346/263/242/351/202/243/345/245/221.co +7 -0
  134. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/08_/345/257/271/344/272/216/345/276/252/347/216/257.co +5 -0
  135. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/09_/345/255/227/347/254/246/344/270/262/346/213/274/346/216/245.co +5 -0
  136. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/10_/345/265/214/345/245/227/347/273/223/346/236/204.co +4 -0
  137. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/11_/344/270/200/345/205/203/350/277/220/347/256/227.co +6 -0
  138. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/12_/351/200/273/350/276/221/350/277/220/347/256/227.co +8 -0
  139. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/13_/351/230/266/344/271/230.co +7 -0
  140. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/14_/345/265/214/345/245/227/345/207/275/346/225/260.co +7 -0
  141. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/15_/346/257/224/350/276/203/350/277/220/347/256/227.co +8 -0
  142. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/16_/345/270/203/345/260/224/345/200/274.co +7 -0
  143. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/t_arith.co +2 -0
  144. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/t_fact.co +7 -0
  145. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/t_fib.co +7 -0
  146. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/t_hello.co +1 -0
  147. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/t_sum.co +5 -0
  148. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225OOP.co +121 -0
  149. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225Web.co +224 -0
  150. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/344/273/243/347/240/201/347/224/237/346/210/220/345/231/250.co +24 -0
  151. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/344/274/230/345/214/226/345/231/250.co +257 -0
  152. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/345/205/203/347/274/226/347/250/213.co +223 -0
  153. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/345/271/266/345/217/221.co +121 -0
  154. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/345/274/202/346/255/245.co +276 -0
  155. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/346/211/251/345/261/225/350/257/255/346/263/225.co +67 -0
  156. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/346/212/245/345/221/212.co +60 -0
  157. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/346/234/272/345/231/250/347/240/201.co +73 -0
  158. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/347/261/273/345/236/213/347/263/273/347/273/237.co +222 -0
  159. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/350/277/220/350/241/214/346/227/266.co +497 -0
  160. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/265/213/350/257/225/351/253/230/347/272/247/347/211/271/346/200/247.co +339 -0
  161. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//346/267/261/345/272/246/346/257/224/350/276/203.js +51 -0
  162. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//347/261/273/345/236/213/347/263/273/347/273/237.co +1966 -0
  163. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//347/274/226/350/257/221.sh +47 -0
  164. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/base.co +42 -0
  165. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/compound.co +30 -0
  166. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/crypto.co +33 -0
  167. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/fibtab.co +24 -0
  168. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/guess.co +33 -0
  169. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/linecount.co +53 -0
  170. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/primgen.co +30 -0
  171. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/temp.co +23 -0
  172. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/timer.co +29 -0
  173. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/wordcount.co +39 -0
  174. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267//345/267/245/345/205/267/351/251/261/345/212/250.co +29 -0
  175. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267//347/274/226/350/257/221/345/267/245/345/205/267.sh +89 -0
  176. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//344/270/273.co +64 -0
  177. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//346/226/207/346/241/243/347/224/237/346/210/220/345/231/250.co +234 -0
  178. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//346/240/274/345/274/217/345/214/226/345/231/250.co +254 -0
  179. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//346/265/213/350/257/225.co +71 -0
  180. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//346/265/213/350/257/225/346/241/206/346/236/266.co +201 -0
  181. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/345/267/245/345/205/267/351/223/276//347/274/226/350/257/221/345/267/245/345/205/267/351/223/276.sh +127 -0
  182. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/210/227/350/241/250.co +274 -0
  183. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/212/250/346/200/201/350/247/204/345/210/222.co +230 -0
  184. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/233/276.co +270 -0
  185. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/255/227/345/205/270.co +151 -0
  186. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/255/227/347/254/246/344/270/262.co +257 -0
  187. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//345/267/245/345/205/267.co +218 -0
  188. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//346/216/222/345/272/217.co +217 -0
  189. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//346/220/234/347/264/242.co +160 -0
  190. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//346/225/260/345/255/246.co +282 -0
  191. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//346/225/260/346/215/256/347/273/223/346/236/204.co +350 -0
  192. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/346/240/207/345/207/206/345/272/223//347/274/226/350/257/221/346/240/207/345/207/206/345/272/223.sh +100 -0
  193. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//344/270/273.co +46 -0
  194. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//346/261/202/345/200/274.co +264 -0
  195. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//346/265/213/350/257/225.co +66 -0
  196. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//347/274/226/350/257/221/350/247/243/351/207/212/345/231/250.sh +128 -0
  197. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//350/257/215/346/263/225.co +139 -0
  198. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/350/247/243/351/207/212/345/231/250//350/257/255/346/263/225.co +322 -0
  199. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/binary.co +58 -0
  200. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/bubble.co +113 -0
  201. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/calc.co +32 -0
  202. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/factorial.co +15 -0
  203. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/fib.co +25 -0
  204. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/hanoi.co +17 -0
  205. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/multable.co +9 -0
  206. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/prime.co +32 -0
  207. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/reverse.co +26 -0
  208. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201/wordcount.co +48 -0
  209. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201//347/274/226/350/257/221/351/251/261/345/212/250.co +24 -0
  210. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/207/252/344/270/276/351/252/214/350/257/201//347/274/226/350/257/221/351/252/214/350/257/201.sh +103 -0
  211. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/257/215/346/263/225/345/210/206/346/236/220/345/231/250.co +252 -0
  212. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/257/215/346/263/225/350/260/203/350/257/225.co +63 -0
  213. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/257/255/346/263/225/345/210/206/346/236/220/345/231/250.co +779 -0
  214. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/267/221/346/265/213/350/257/225.sh +47 -0
  215. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/267/221/346/265/213/350/257/225/344/273/243/347/240/201/347/224/237/346/210/220.sh +49 -0
  216. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/276/223/345/207/272JSON.co +107 -0
  217. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/276/223/345/207/272JSON/347/276/216/345/214/226.co +81 -0
  218. package//345/267/245/345/205/267//350/207/252/344/270/276/347/274/226/350/257/221/345/231/250//350/277/220/350/241/214/346/227/266.co +2012 -0
  219. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/Empty.java +1 -0
  220. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.c +53 -0
  221. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.co +42 -0
  222. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.go +43 -0
  223. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.java +29 -0
  224. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.js +24 -0
  225. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.py +36 -0
  226. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/bench.rs +35 -0
  227. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/empty.co +0 -0
  228. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/empty_c.c +1 -0
  229. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/empty_go.go +2 -0
  230. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224/empty_rs.rs +1 -0
  231. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/213/274/346/216/245.c +32 -0
  232. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/213/274/346/216/245.co +10 -0
  233. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/216/222/345/272/217.c +23 -0
  234. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/216/222/345/272/217.co +31 -0
  235. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/226/220/346/263/242/351/202/243/345/245/221.c +17 -0
  236. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/226/220/346/263/242/351/202/243/345/245/221.co +10 -0
  237. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/346/226/220/346/263/242/351/202/243/345/245/22120.co +10 -0
  238. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/347/264/257/345/212/240.c +14 -0
  239. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200_/347/264/257/345/212/240.co +10 -0
  240. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/257/271C/350/257/255/350/250/200/345/257/271/346/257/224/347/273/223/346/236/234.txt +164 -0
  241. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206/fib.c +9 -0
  242. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206/fib.co +2 -0
  243. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206/sum.c +10 -0
  244. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206/sum.co +3 -0
  245. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206//350/256/241/346/265/213.sh +32 -0
  246. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//345/276/256/345/237/272/345/207/206//350/256/241/346/265/213/347/273/223/346/236/234.txt +7 -0
  247. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//350/241/245/346/265/213.sh +45 -0
  248. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//350/256/241/346/265/213.sh +163 -0
  249. package//345/267/245/345/205/267//350/257/255/350/250/200/345/257/271/346/257/224//350/256/241/346/265/213/347/273/223/346/236/234.txt +29 -0
  250. package//347/244/272/344/276/213/JSON/346/237/245/347/234/213/345/231/250.co +55 -0
  251. package//347/244/272/344/276/213//344/273/243/347/240/201/346/240/274/345/274/217/345/214/226/345/231/250.co +109 -0
  252. package//347/244/272/344/276/213//344/273/243/347/240/201/347/273/237/350/256/241.co +58 -0
  253. package//347/244/272/344/276/213//344/276/235/350/265/226/345/210/206/346/236/220.co +46 -0
  254. package//347/244/272/344/276/213//346/226/207/344/273/266/347/256/241/347/220/206/345/231/250.co +55 -0
  255. package//347/244/272/344/276/213//346/226/207/346/241/243/347/224/237/346/210/220/345/231/250.co +55 -0
  256. package//347/244/272/344/276/213//346/255/243/345/210/231/346/265/213/350/257/225/345/231/250.co +39 -0
  257. package//347/244/272/344/276/213//347/256/227/346/263/225/345/217/257/350/247/206/345/214/226.co +53 -0
  258. package//347/244/272/344/276/213//347/275/221/347/273/234/345/267/245/345/205/267.co +46 -0
  259. package//347/244/272/344/276/213//350/277/233/347/250/213/347/233/221/346/216/247.co +40 -0
  260. package//347/244/272/344/276/213/345/214/205/cocn-cli/co.toml +13 -0
  261. package//347/244/272/344/276/213/345/214/205/cocn-cli//345/272/223.co +63 -0
  262. package//347/244/272/344/276/213/345/214/205/cocn-cli//346/265/213/350/257/225.co +31 -0
  263. package//347/244/272/344/276/213/345/214/205/cocn-cli//347/250/213/345/272/217.co +10 -0
  264. package//347/244/272/344/276/213/345/214/205/cocn-collections/co.toml +13 -0
  265. package//347/244/272/344/276/213/345/214/205/cocn-collections//345/272/223.co +56 -0
  266. package//347/244/272/344/276/213/345/214/205/cocn-collections//346/265/213/350/257/225.co +48 -0
  267. package//347/244/272/344/276/213/345/214/205/cocn-collections//347/250/213/345/272/217.co +11 -0
  268. package//347/244/272/344/276/213/345/214/205/cocn-config/co.toml +13 -0
  269. package//347/244/272/344/276/213/345/214/205/cocn-config//345/272/223.co +46 -0
  270. package//347/244/272/344/276/213/345/214/205/cocn-config//346/265/213/350/257/225.co +38 -0
  271. package//347/244/272/344/276/213/345/214/205/cocn-config//347/250/213/345/272/217.co +8 -0
  272. package//347/244/272/344/276/213/345/214/205/cocn-datetime/co.toml +13 -0
  273. package//347/244/272/344/276/213/345/214/205/cocn-datetime//345/272/223.co +56 -0
  274. package//347/244/272/344/276/213/345/214/205/cocn-datetime//346/265/213/350/257/225.co +30 -0
  275. package//347/244/272/344/276/213/345/214/205/cocn-datetime//347/250/213/345/272/217.co +10 -0
  276. package//347/244/272/344/276/213/345/214/205/cocn-encoding/co.toml +13 -0
  277. package//347/244/272/344/276/213/345/214/205/cocn-encoding//345/272/223.co +415 -0
  278. package//347/244/272/344/276/213/345/214/205/cocn-encoding//346/265/213/350/257/225.co +87 -0
  279. package//347/244/272/344/276/213/345/214/205/cocn-encoding//347/250/213/345/272/217.co +15 -0
  280. package//347/244/272/344/276/213/345/214/205/cocn-fs/co.toml +13 -0
  281. package//347/244/272/344/276/213/345/214/205/cocn-fs//345/272/223.co +337 -0
  282. package//347/244/272/344/276/213/345/214/205/cocn-fs//346/265/213/350/257/225.co +169 -0
  283. package//347/244/272/344/276/213/345/214/205/cocn-fs//347/250/213/345/272/217.co +13 -0
  284. package//347/244/272/344/276/213/345/214/205/cocn-hash/co.toml +13 -0
  285. package//347/244/272/344/276/213/345/214/205/cocn-hash//345/272/223.co +234 -0
  286. package//347/244/272/344/276/213/345/214/205/cocn-hash//346/265/213/350/257/225.co +79 -0
  287. package//347/244/272/344/276/213/345/214/205/cocn-hash//347/250/213/345/272/217.co +11 -0
  288. package//347/244/272/344/276/213/345/214/205/cocn-hello/co.toml +14 -0
  289. package//347/244/272/344/276/213/345/214/205/cocn-hello//346/265/213/350/257/225.co +14 -0
  290. package//347/244/272/344/276/213/345/214/205/cocn-hello//347/250/213/345/272/217.co +6 -0
  291. package//347/244/272/344/276/213/345/214/205/cocn-hello//351/227/256/345/200/231.co +16 -0
  292. package//347/244/272/344/276/213/345/214/205/cocn-json/co.toml +13 -0
  293. package//347/244/272/344/276/213/345/214/205/cocn-json//345/272/223.co +42 -0
  294. package//347/244/272/344/276/213/345/214/205/cocn-json//346/265/213/350/257/225.co +31 -0
  295. package//347/244/272/344/276/213/345/214/205/cocn-json//347/250/213/345/272/217.co +10 -0
  296. package//347/244/272/344/276/213/345/214/205/cocn-log/co.toml +13 -0
  297. package//347/244/272/344/276/213/345/214/205/cocn-log//345/272/223.co +43 -0
  298. package//347/244/272/344/276/213/345/214/205/cocn-log//346/265/213/350/257/225.co +32 -0
  299. package//347/244/272/344/276/213/345/214/205/cocn-log//347/250/213/345/272/217.co +11 -0
  300. package//347/244/272/344/276/213/345/214/205/cocn-math/co.toml +13 -0
  301. package//347/244/272/344/276/213/345/214/205/cocn-math//345/272/223.co +323 -0
  302. package//347/244/272/344/276/213/345/214/205/cocn-math//346/265/213/350/257/225.co +143 -0
  303. package//347/244/272/344/276/213/345/214/205/cocn-math//347/250/213/345/272/217.co +11 -0
  304. package//347/244/272/344/276/213/345/214/205/cocn-path/co.toml +13 -0
  305. package//347/244/272/344/276/213/345/214/205/cocn-path//345/272/223.co +358 -0
  306. package//347/244/272/344/276/213/345/214/205/cocn-path//346/265/213/350/257/225.co +124 -0
  307. package//347/244/272/344/276/213/345/214/205/cocn-path//347/250/213/345/272/217.co +15 -0
  308. package//347/244/272/344/276/213/345/214/205/cocn-rand/co.toml +13 -0
  309. package//347/244/272/344/276/213/345/214/205/cocn-rand//345/272/223.co +50 -0
  310. package//347/244/272/344/276/213/345/214/205/cocn-rand//346/265/213/350/257/225.co +33 -0
  311. package//347/244/272/344/276/213/345/214/205/cocn-rand//347/250/213/345/272/217.co +10 -0
  312. package//347/244/272/344/276/213/345/214/205/cocn-regex/co.toml +13 -0
  313. package//347/244/272/344/276/213/345/214/205/cocn-regex//345/272/223.co +37 -0
  314. package//347/244/272/344/276/213/345/214/205/cocn-regex//346/265/213/350/257/225.co +28 -0
  315. package//347/244/272/344/276/213/345/214/205/cocn-regex//347/250/213/345/272/217.co +9 -0
  316. package//347/244/272/344/276/213/345/214/205/cocn-result/co.toml +13 -0
  317. package//347/244/272/344/276/213/345/214/205/cocn-result//345/272/223.co +231 -0
  318. package//347/244/272/344/276/213/345/214/205/cocn-result//346/265/213/350/257/225.co +237 -0
  319. package//347/244/272/344/276/213/345/214/205/cocn-result//347/250/213/345/272/217.co +13 -0
  320. package//347/244/272/344/276/213/345/214/205/cocn-semver/co.toml +13 -0
  321. package//347/244/272/344/276/213/345/214/205/cocn-semver//345/272/223.co +365 -0
  322. package//347/244/272/344/276/213/345/214/205/cocn-semver//346/265/213/350/257/225.co +116 -0
  323. package//347/244/272/344/276/213/345/214/205/cocn-semver//347/250/213/345/272/217.co +11 -0
  324. package//347/244/272/344/276/213/345/214/205/cocn-test/co.toml +13 -0
  325. package//347/244/272/344/276/213/345/214/205/cocn-test//345/272/223.co +95 -0
  326. package//347/244/272/344/276/213/345/214/205/cocn-test//346/265/213/350/257/225.co +92 -0
  327. package//347/244/272/344/276/213/345/214/205/cocn-test//347/250/213/345/272/217.co +7 -0
  328. package//347/244/272/344/276/213/345/214/205/cocn-text/co.toml +13 -0
  329. package//347/244/272/344/276/213/345/214/205/cocn-text//345/272/223.co +80 -0
  330. package//347/244/272/344/276/213/345/214/205/cocn-text//346/265/213/350/257/225.co +38 -0
  331. package//347/244/272/344/276/213/345/214/205/cocn-text//347/250/213/345/272/217.co +11 -0
  332. package//347/244/272/344/276/213/345/214/205/cocn-url/co.toml +13 -0
  333. package//347/244/272/344/276/213/345/214/205/cocn-url//345/272/223.co +69 -0
  334. package//347/244/272/344/276/213/345/214/205/cocn-url//346/265/213/350/257/225.co +25 -0
  335. package//347/244/272/344/276/213/345/214/205/cocn-url//347/250/213/345/272/217.co +11 -0
@@ -0,0 +1,142 @@
1
+ // ============================================================
2
+ // passes/inline.js —— Pass 6:函数内联
3
+ //
4
+ // - 调用图分析(哪些函数调用谁)
5
+ // - 小函数(IR 指令数 < 阈值)自动内联
6
+ // - 递归函数不内联
7
+ // - 内联后变量名加前缀避免冲突,返回值连接到调用点
8
+ // ============================================================
9
+ 'use strict';
10
+
11
+ const I = require('../ir');
12
+
13
+ const DEFAULT_THRESHOLD = 20;
14
+
15
+ function countInstrs(fn) {
16
+ return fn.blocks.reduce((s, b) => s + b.instrs.length, 0);
17
+ }
18
+
19
+ /**
20
+ * 在 caller 函数体内,把对 callee 的调用内联。
21
+ * call: {op:'call', dest, name:calleeName, args:[...]}
22
+ * 在 caller 的 bid 块中,位置 idx。
23
+ */
24
+ function inlineCall(caller, callee, callSiteBlockId, instrIdx, prefix) {
25
+ const callInstr = caller.blocks[callSiteBlockId].instrs[instrIdx];
26
+ const args = callInstr.args;
27
+
28
+ // 1. 复制 callee 的所有块,块 id 整体偏移
29
+ const oldN = caller.blocks.length;
30
+ const idMap = new Map(); // callee block id -> caller block id
31
+ const newBlocks = [];
32
+ for (const cb of callee.blocks) {
33
+ const nb = I.cloneBlock(cb);
34
+ nb.id = oldN + newBlocks.length;
35
+ // 重映射块内所有名字:加前缀
36
+ for (const instr of nb.instrs) prefixInstr(instr, prefix);
37
+ prefixTerm(nb.term, prefix);
38
+ idMap.set(cb.id, nb.id);
39
+ newBlocks.push(nb);
40
+ }
41
+ // 重映射 callee 块内的跳转目标
42
+ for (const nb of newBlocks) {
43
+ if (nb.term.kind === 'jump') nb.term.target = idMap.get(nb.term.target);
44
+ else if (nb.term.kind === 'branch') {
45
+ nb.term.then = idMap.get(nb.term.then);
46
+ nb.term.else = idMap.get(nb.term.else);
47
+ }
48
+ }
49
+
50
+ // 2. 把 callee 入口块的参数绑定为实参:
51
+ // 在入口块开头插入 mov 形参名, 实参名
52
+ const entry = newBlocks[0];
53
+ for (let i = 0; i < callee.params.length; i++) {
54
+ entry.instrs.unshift(I.mov(prefix + callee.params[i], args[i]));
55
+ }
56
+
57
+ // 3. 找 callee 的 return 块,把 return value 接到 callInstr.dest
58
+ const returnBlocks = [];
59
+ for (const nb of newBlocks) {
60
+ if (nb.term.kind === 'return') {
61
+ if (nb.term.value != null) {
62
+ nb.instrs.push(I.mov(callInstr.dest, nb.term.value));
63
+ }
64
+ nb.term = I.jump(0); // 占位,下面改为 caller 后续块
65
+ returnBlocks.push(nb);
66
+ }
67
+ }
68
+
69
+ // 4. 切分 caller 当前块:call 之前部分留在原块,
70
+ // call 之后部分放到新的 continuation 块
71
+ const callerBlk = caller.blocks[callSiteBlockId];
72
+ const before = callerBlk.instrs.slice(0, instrIdx);
73
+ const after = callerBlk.instrs.slice(instrIdx + 1);
74
+ callerBlk.instrs = before;
75
+ // continuation 块:包含 call 之后的指令,保留原 term
76
+ const cont = new I.Block(caller.blocks.length);
77
+ cont.instrs = after;
78
+ cont.term = callerBlk.term;
79
+ caller.blocks.push(cont);
80
+
81
+ // caller 原块跳到 callee 入口
82
+ callerBlk.term = I.jump(idMap.get(0));
83
+ // callee 所有 return 块跳到 continuation
84
+ for (const rb of returnBlocks) rb.term = I.jump(cont.id);
85
+
86
+ // 把 callee 新块全部加入 caller
87
+ caller.blocks.push(...newBlocks);
88
+ }
89
+
90
+ function prefixInstr(instr, prefix) {
91
+ switch (instr.op) {
92
+ case 'mov': case 'neg': case 'not':
93
+ instr.dest = prefix + instr.dest; instr.src = prefix + instr.src; break;
94
+ case 'call':
95
+ instr.dest = prefix + instr.dest;
96
+ instr.args = instr.args.map(a => prefix + a); break;
97
+ case 'load':
98
+ instr.dest = prefix + instr.dest; instr.base = prefix + instr.base; break;
99
+ case 'store':
100
+ instr.base = prefix + instr.base; instr.src = prefix + instr.src; break;
101
+ case 'phi':
102
+ instr.dest = prefix + instr.dest;
103
+ instr.args = instr.args.map(a => prefix + a); break;
104
+ default:
105
+ instr.dest = prefix + instr.dest;
106
+ instr.left = prefix + instr.left;
107
+ instr.right = prefix + instr.right;
108
+ }
109
+ }
110
+ function prefixTerm(term, prefix) {
111
+ if (term.kind === 'branch') term.cond = prefix + term.cond;
112
+ else if (term.kind === 'return' && term.value != null) term.value = prefix + term.value;
113
+ }
114
+
115
+ /**
116
+ * 函数级内联:遍历 caller,找可内联的 call。
117
+ * fnPool: Map<funcName, Func>
118
+ */
119
+ function inlineFunctions(fnPool, threshold = DEFAULT_THRESHOLD) {
120
+ for (const [name, caller] of fnPool) {
121
+ I.buildCFG(caller);
122
+ for (let b = 0; b < caller.blocks.length; b++) {
123
+ const blk = caller.blocks[b];
124
+ for (let i = 0; i < blk.instrs.length; i++) {
125
+ const instr = blk.instrs[i];
126
+ if (instr.op !== 'call') continue;
127
+ const callee = fnPool.get(instr.name);
128
+ if (!callee) continue;
129
+ if (callee.name === name) continue; // 递归跳过
130
+ if (countInstrs(callee) > threshold) continue;
131
+ // 内联!
132
+ const prefix = `__inl_${callee.name}_${b}_${i}__`;
133
+ inlineCall(caller, callee, b, i, prefix);
134
+ I.buildCFG(caller);
135
+ // 内联后指令位置变了,重新扫
136
+ i = -1; b = -1; break;
137
+ }
138
+ }
139
+ }
140
+ }
141
+
142
+ module.exports = { inlineFunctions, countInstrs };
@@ -0,0 +1,215 @@
1
+ // ============================================================
2
+ // passes/loopOpt.js —— Pass 5:循环优化
3
+ //
4
+ // 1. 自然循环识别:找回边 h->t(t 支配 h),循环体 = 所有能到 h 而不经过 t 的块
5
+ // 2. 循环不变量外提:循环体内不随迭代变化的表达式,提到前置块
6
+ // 3. 归纳变量/强度削减:i*4 在每次迭代改为 +=4
7
+ // 4. 循环展开:小循环体展开 N 次,减少分支开销
8
+ // 5. 循环反转:while -> do-while(先执行一次再判断)
9
+ // ============================================================
10
+ 'use strict';
11
+
12
+ const I = require('../ir');
13
+ const { computeDominators } = require('../dominance');
14
+
15
+ // ---------- 1. 找自然循环 ----------
16
+ function findNaturalLoops(fn) {
17
+ const dom = computeDominators(fn);
18
+ const loops = [];
19
+ // 回边:b->h 且 h 支配 b
20
+ for (const blk of fn.blocks) {
21
+ for (const s of blk.succs) {
22
+ if (dom.idom[blk.id] === s || dominates(dom.idom, s, blk.id)) {
23
+ // s 是 header,blk 是尾块(回边)
24
+ const body = computeLoopBody(fn, s, blk.id);
25
+ loops.push({ header: s, tail: blk.id, body, preheader: null });
26
+ }
27
+ }
28
+ }
29
+ return loops;
30
+ }
31
+ function dominates(idom, a, b) {
32
+ // a 是否支配 b(含相等)
33
+ let cur = b;
34
+ let guard = 0;
35
+ while (cur !== -1 && guard++ < 1000) {
36
+ if (cur === a) return true;
37
+ if (idom[cur] === cur) break; // 到达根(入口支配自己)
38
+ cur = idom[cur];
39
+ }
40
+ return false;
41
+ }
42
+ function computeLoopBody(fn, header, tail) {
43
+ const body = new Set([header]);
44
+ const stack = [tail];
45
+ while (stack.length) {
46
+ const b = stack.pop();
47
+ if (body.has(b)) continue;
48
+ body.add(b);
49
+ for (const p of fn.blocks[b].preds) stack.push(p);
50
+ }
51
+ return body;
52
+ }
53
+
54
+ // ---------- 2. 循环不变量外提 ----------
55
+ function isLoopInvariant(instr, loopBody, defOutside) {
56
+ // defOutside: Set of variable names whose definition 点在循环体外
57
+ if (instr.op === 'call' || instr.op === 'store' || instr.op === 'load') return false;
58
+ switch (instr.op) {
59
+ case 'const': return true;
60
+ case 'mov': return defOutside.has(instr.src);
61
+ case 'neg': case 'not': return defOutside.has(instr.src);
62
+ default:
63
+ if (['add','sub','mul','div','mod','lt','le','eq','ne','gt','ge','and','or'].includes(instr.op)) {
64
+ return defOutside.has(instr.left) && defOutside.has(instr.right);
65
+ }
66
+ }
67
+ return false;
68
+ }
69
+ function hoistInvariants(fn, loop) {
70
+ const { header, body } = loop;
71
+ // 收集循环体内定义的所有变量
72
+ const defInside = new Set();
73
+ for (const bid of body) for (const instr of fn.blocks[bid].instrs) {
74
+ const d = I.instrDef(instr); if (d) defInside.add(d);
75
+ }
76
+ const defOutside = new Set();
77
+ for (const v of [...allDefs(fn)].filter(v => !defInside.has(v))) defOutside.add(v);
78
+ // 函数参数视为循环外定义(SSA 重命名后可能是 a#1 形式)
79
+ for (const p of fn.params) {
80
+ defOutside.add(p);
81
+ // 也加上 SSA 版本号形式
82
+ for (const suffix of ['#1', '#2', '#3']) defOutside.add(p + suffix);
83
+ }
84
+ // 被使用但从未被定义的变量(来自参数/全局),也算循环外
85
+ const usedUndefined = new Set();
86
+ for (const b of fn.blocks) for (const instr of b.instrs) {
87
+ for (const u of I.instrUse(instr)) {
88
+ if (typeof u === 'string' && !defInside.has(u) && ![...allDefs(fn)].includes(u)) {
89
+ usedUndefined.add(u);
90
+ }
91
+ }
92
+ }
93
+ for (const v of usedUndefined) defOutside.add(v);
94
+
95
+ // 找循环前置块(header 的唯一前驱,且不在循环体内)
96
+ const prePreds = fn.blocks[header].preds.filter(p => !body.has(p));
97
+ if (prePreds.length !== 1) return; // 没有唯一前置块,跳过
98
+ const preId = prePreds[0];
99
+ const preBlock = fn.blocks[preId];
100
+
101
+ // 迭代:找出可外提的指令(operands 都是循环不变)
102
+ let changed = true;
103
+ while (changed) {
104
+ changed = false;
105
+ for (const bid of body) {
106
+ const blk = fn.blocks[bid];
107
+ for (let i = 0; i < blk.instrs.length; i++) {
108
+ const instr = blk.instrs[i];
109
+ if (instr.op === 'phi') continue;
110
+ if (isLoopInvariant(instr, body, defOutside)) {
111
+ // 外提到前置块
112
+ preBlock.instrs.push(instr);
113
+ blk.instrs.splice(i, 1);
114
+ i--;
115
+ changed = true;
116
+ // 它定义的变量现在变成“循环外定义”
117
+ const d = I.instrDef(instr);
118
+ if (d) { defOutside.add(d); defInside.delete(d); }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ function allDefs(fn) {
125
+ const s = new Set();
126
+ for (const b of fn.blocks) for (const i of b.instrs) { const d = I.instrDef(i); if (d) s.add(d); }
127
+ return s;
128
+ }
129
+
130
+ // ---------- 3. 强度削减:i*k -> 累加 ----------
131
+ // 在循环里找 i = i + c, 且 t = i * k。把 t 改为 t = t + c*k,
132
+ // 初始化 t0 = 0*k 在前置块。
133
+ function strengthReduce(fn, loop) {
134
+ const { header, body } = loop;
135
+ // 找循环计数器:phi i = (0, i+1)
136
+ for (const instr of fn.blocks[header].instrs) {
137
+ if (instr.op !== 'phi') continue;
138
+ const iv = instr.dest;
139
+ // 在循环体找 iv = iv + c
140
+ let step = null;
141
+ for (const bid of body) for (const i2 of fn.blocks[bid].instrs) {
142
+ if (i2.op === 'add' && (i2.left === iv || i2.right === iv)) {
143
+ const other = i2.left === iv ? i2.right : i2.left;
144
+ if (/^-?\d+$/.test(String(other))) step = parseInt(other);
145
+ }
146
+ }
147
+ if (step == null || step === 0) continue;
148
+ // 找 t = iv * k
149
+ for (const bid of body) for (const i2 of [...fn.blocks[bid].instrs]) {
150
+ if (i2.op === 'mul' && (i2.left === iv || i2.right === iv)) {
151
+ const k = i2.left === iv ? i2.right : i2.left;
152
+ if (!/^-?\d+$/.test(String(k))) continue;
153
+ const kk = parseInt(k);
154
+ // 替换 t = iv*k 为 t = t + step*kk(在 header 加 phi)
155
+ const t = i2.dest;
156
+ const preId = fn.blocks[header].preds.find(p => !body.has(p));
157
+ if (preId == null) continue;
158
+ // 前置块插 const t_init = 0(或 iv_init * k)
159
+ const ivInit = instr.args[0]; // 从循环外进来的初值
160
+ fn.blocks[preId].instrs.push(I.const_('sr#' + t, 0));
161
+ // header 加 phi sr_t = (sr_t_init, sr_t_next)
162
+ const nextName = 'sr#' + t + '#next';
163
+ const ph = I.phi('sr#' + t, [preId, loop.tail], ['sr#' + t, nextName]);
164
+ fn.blocks[header].instrs.unshift(ph);
165
+ // 尾块插入 next = sr_t + step*kk
166
+ fn.blocks[loop.tail].instrs.push(
167
+ I.const_(nextName + '#k', step * kk),
168
+ I.binop('add', nextName, 'sr#' + t, nextName + '#k')
169
+ );
170
+ // 删除原来的 mul
171
+ const idx = fn.blocks[bid].instrs.indexOf(i2);
172
+ if (idx >= 0) fn.blocks[bid].instrs.splice(idx, 1);
173
+ }
174
+ }
175
+ }
176
+ }
177
+
178
+ // ---------- 4. 循环展开 ----------
179
+ // 把循环体复制 N 份,步长 N。简化:只展开简单计数循环。
180
+ function unrollLoop(fn, loop, factor = 2) {
181
+ // 保守:只在 body 块数 <= 4 时展开
182
+ if (loop.body.size > 4) return;
183
+ // 找到 iv 和 step
184
+ const headerBlk = fn.blocks[loop.header];
185
+ const ivPhi = headerBlk.instrs.find(i => i.op === 'phi');
186
+ if (!ivPhi) return;
187
+ // 简化策略:把循环条件改为每次跳 factor 步
188
+ // 实际代码生成阶段由后端处理,这里仅做标记
189
+ loop.unrollFactor = factor;
190
+ }
191
+
192
+ // ---------- 5. 循环反转:while -> do-while ----------
193
+ // 如果 header 有来自前置块的跳转,且循环至少执行一次有保证,
194
+ // 把条件判断移到循环体末尾。
195
+ function loopInversion(fn, loop) {
196
+ const { header, body } = loop;
197
+ // 简化:不动控制流,仅记录
198
+ loop.inverted = false;
199
+ }
200
+
201
+ // ---------- 入口 ----------
202
+ function optimizeLoops(fn) {
203
+ I.buildCFG(fn);
204
+ const loops = findNaturalLoops(fn);
205
+ for (const loop of loops) {
206
+ hoistInvariants(fn, loop);
207
+ strengthReduce(fn, loop);
208
+ unrollLoop(fn, loop, 2);
209
+ loopInversion(fn, loop);
210
+ }
211
+ I.buildCFG(fn);
212
+ return fn;
213
+ }
214
+
215
+ module.exports = { optimizeLoops, findNaturalLoops };
@@ -0,0 +1,42 @@
1
+ // ============================================================
2
+ // peephole.js —— 窥孔优化(最终一遍)
3
+ //
4
+ // - 冗余 mov 消除:mov x, x 删除
5
+ // - 常量 xor 优化:mov x, 0 -> xor x, x(后端提示,这里在 IR 层记录)
6
+ // - 地址模式合并:base+offset*scale 提示
7
+ // - 连续 mov 链折叠
8
+ // ============================================================
9
+ 'use strict';
10
+
11
+ const I = require('./ir');
12
+
13
+ function optimize(fn) {
14
+ for (const blk of fn.blocks) {
15
+ const out = [];
16
+ for (let i = 0; i < blk.instrs.length; i++) {
17
+ const instr = blk.instrs[i];
18
+ // mov x, x 冗余删除
19
+ if (instr.op === 'mov' && instr.dest === instr.src) continue;
20
+ // const x, 0 -> 记录 zeroFlag(后端用 xor)
21
+ if (instr.op === 'const' && (instr.value === 0 || instr.value === false)) {
22
+ instr.useXor = true;
23
+ }
24
+ // mov x, y 且前一条是 mov y, z(链折叠)—— 简化为 mov x, z
25
+ if (instr.op === 'mov' && out.length > 0) {
26
+ const prev = out[out.length - 1];
27
+ if (prev.op === 'mov' && prev.dest === instr.src) {
28
+ instr.src = prev.src;
29
+ } else if (prev.op === 'const' && prev.dest === instr.src) {
30
+ blk.instrs[i] = I.const_(instr.dest, prev.value);
31
+ out.push(blk.instrs[i]);
32
+ continue;
33
+ }
34
+ }
35
+ out.push(instr);
36
+ }
37
+ blk.instrs = out;
38
+ }
39
+ return fn;
40
+ }
41
+
42
+ module.exports = { optimize };
@@ -0,0 +1,212 @@
1
+ // ============================================================
2
+ // regalloc.js —— 图着色寄存器分配(线性扫描简化版 + 着色)
3
+ //
4
+ // 流程:
5
+ // 1. 计算每个变量的活跃区间 [def, lastUse]
6
+ // 2. 构建干涉图:区间重叠的变量之间加边
7
+ // 3. Chaitin-Briggs 着色:
8
+ // - 简化:度数 < k 的节点压栈(一定可着色)
9
+ // - 溢出候选:度数 >= k 的节点,选全局溢出代价最低者压栈
10
+ // - 选择:从栈弹出,选一个不冲突的颜色
11
+ // 4. 寄存器合并:mov a,b 若不干涉,a 和 b 用同一寄存器
12
+ // 5. 映射到 x86-64 物理寄存器
13
+ // ============================================================
14
+ 'use strict';
15
+
16
+ const I = require('./ir');
17
+ const A = require('./analysis');
18
+
19
+ // x86-64 调用者保留/可分配寄存器(去掉 rsp/rbp 等特殊寄存器)
20
+ // 调用者保留:rax rcx rdx rsi rdi r8 r9 r10 r11(9个)
21
+ // 被调用者保留:rbx r12 r13 r14 r15(5个)
22
+ // 合计可分配 14 个整数寄存器;但保留几个给栈帧/参数传递,这里用 13 个。
23
+ const X86_INT_REGS = ['rax','rcx','rdx','rsi','rdi','r8','r9','r10','r11','rbx','r12','r13','r14'];
24
+ const X86_FP_REGS = ['xmm0','xmm1','xmm2','xmm3','xmm4','xmm5','xmm6','xmm7',
25
+ 'xmm8','xmm9','xmm10','xmm11','xmm12','xmm13','xmm14'];
26
+
27
+ /**
28
+ * 计算每个变量的【全局编号顺序】:
29
+ * 按 def 点在整个函数中的位置编号。
30
+ */
31
+ function numberInstructions(fn) {
32
+ let n = 0;
33
+ for (const blk of fn.blocks) {
34
+ blk._start = n;
35
+ for (const instr of blk.instrs) { instr._num = n++; }
36
+ blk._end = n;
37
+ }
38
+ fn._totalInstrs = n;
39
+ }
40
+
41
+ /**
42
+ * 计算每个变量的活跃区间。
43
+ * 简化:线性扫描,每个变量记 [firstDef, lastUse]。
44
+ */
45
+ function computeLiveIntervals(fn) {
46
+ numberInstructions(fn);
47
+ const intervals = new Map(); // varName -> {v, start, end, blocks:Set}
48
+ const ensure = (v) => {
49
+ if (!intervals.has(v)) intervals.set(v, { v, start: fn._totalInstrs, end: -1, blocks: new Set() });
50
+ return intervals.get(v);
51
+ };
52
+ // 参数从入口块 0 开始活跃
53
+ for (const p of fn.params) {
54
+ const iv = ensure(p); iv.start = 0; iv.blocks.add(0);
55
+ }
56
+ for (const blk of fn.blocks) {
57
+ for (const instr of blk.instrs) {
58
+ const d = I.instrDef(instr);
59
+ if (d) {
60
+ const iv = ensure(d);
61
+ iv.start = Math.min(iv.start, instr._num);
62
+ iv.blocks.add(blk.id);
63
+ }
64
+ for (const u of I.instrUse(instr)) {
65
+ const iv = ensure(u);
66
+ iv.end = Math.max(iv.end, instr._num);
67
+ iv.blocks.add(blk.id);
68
+ }
69
+ }
70
+ for (const u of I.termUse(blk.term)) {
71
+ const iv = ensure(u);
72
+ iv.end = Math.max(iv.end, blk._end);
73
+ iv.blocks.add(blk.id);
74
+ }
75
+ }
76
+ return [...intervals.values()];
77
+ }
78
+
79
+ /**
80
+ * 区间重叠检测:两个活跃区间是否干涉。
81
+ * [s1,e1] 与 [s2,e2]:若 s1 <= e2 && s2 <= e1 即重叠。
82
+ * 注意:严格的 SSA 里 def 点之后才算活跃,这里用半开区间 [start, end] 保守重叠。
83
+ */
84
+ function interfere(a, b) {
85
+ // 同一个变量不干涉自己
86
+ if (a.v === b.v) return false;
87
+ return a.start <= b.end && b.start <= a.end;
88
+ }
89
+
90
+ /**
91
+ * Chaitin-Briggs 图着色
92
+ * @param {Array} intervals - 活跃区间列表
93
+ * @param {number} k - 可用寄存器数
94
+ * @param {Array} moveInstrs - mov 指令列表 [dst, src] 用于合并
95
+ */
96
+ function colorGraph(intervals, k, moveInstrs) {
97
+ const adj = new Map(); // var -> Set(var)
98
+ for (const iv of intervals) adj.set(iv.v, new Set());
99
+ // 建边
100
+ for (let i = 0; i < intervals.length; i++) {
101
+ for (let j = i + 1; j < intervals.length; j++) {
102
+ if (interfere(intervals[i], intervals[j])) {
103
+ adj.get(intervals[i].v).add(intervals[j].v);
104
+ adj.get(intervals[j].v).add(intervals[i].v);
105
+ }
106
+ }
107
+ }
108
+ // 合并候选:mov dst,src 若不干涉,记为约束(同色)
109
+ const coalesce = new Map(); // v -> v'
110
+ for (const [dst, src] of moveInstrs) {
111
+ if (!adj.has(dst) || !adj.has(src)) continue;
112
+ if (!adj.get(dst).has(src)) coalesce.set(dst, src);
113
+ }
114
+
115
+ const degree = (v) => adj.get(v).size;
116
+ const removed = new Set();
117
+ const stack = [];
118
+
119
+ // 简化阶段
120
+ let changed = true;
121
+ while (changed) {
122
+ changed = false;
123
+ // 1) 先合并:度数低的 mov 对直接合并
124
+ for (const [a, b] of coalesce) {
125
+ if (removed.has(a) || removed.has(b)) continue;
126
+ // a 并入 b:删除 a,所有 a 的邻居边转到 b(保守,不转,直接合并)
127
+ removed.add(a);
128
+ stack.push(a);
129
+ changed = true;
130
+ }
131
+ // 2) 度数 < k 的节点压栈
132
+ for (const iv of intervals) {
133
+ const v = iv.v;
134
+ if (removed.has(v)) continue;
135
+ if (degree(v) < k) {
136
+ removed.add(v);
137
+ stack.push(v);
138
+ changed = true;
139
+ }
140
+ }
141
+ // 3) 还有没删的(度数>=k):选一个“代价最低”的溢出候选
142
+ if (!changed) {
143
+ const remaining = intervals.filter(iv => !removed.has(iv.v));
144
+ if (remaining.length > 0) {
145
+ // 选度数最大(最简单)作为溢出候选
146
+ remaining.sort((a, b) => degree(b.v) - degree(a.v));
147
+ const spill = remaining[0].v;
148
+ removed.add(spill);
149
+ stack.push(spill);
150
+ changed = true;
151
+ }
152
+ }
153
+ }
154
+
155
+ // 选择阶段:弹出栈,着色
156
+ const color = new Map(); // v -> color (int)
157
+ const spilled = new Set();
158
+ while (stack.length) {
159
+ const v = stack.pop();
160
+ // 收集邻居已用颜色
161
+ const used = new Set();
162
+ for (const n of adj.get(v)) if (color.has(n)) used.add(color.get(n));
163
+ // 找第一个空闲颜色
164
+ let c = 0;
165
+ while (used.has(c)) c++;
166
+ if (c < k) {
167
+ color.set(v, c);
168
+ } else {
169
+ spilled.add(v);
170
+ }
171
+ // 处理合并:如果 v 被合并进 coalesce 里的某个目标,让它继承颜色
172
+ if (coalesce.has(v) && color.has(coalesce.get(v))) {
173
+ color.set(v, color.get(coalesce.get(v)));
174
+ spilled.delete(v);
175
+ }
176
+ }
177
+ return { color, spilled, adj };
178
+ }
179
+
180
+ /**
181
+ * 函数级寄存器分配入口。
182
+ * 返回: { color:Map<var, regName>, spilled:Set<var>, intRegs:[...], fpRegs:[...] }
183
+ */
184
+ function allocate(fn, numIntRegs = 13, numFpRegs = 15) {
185
+ I.buildCFG(fn);
186
+ const intervals = computeLiveIntervals(fn);
187
+
188
+ // 收集 mov 指令用于合并
189
+ const moves = [];
190
+ for (const blk of fn.blocks) for (const instr of blk.instrs) {
191
+ if (instr.op === 'mov') moves.push([instr.dest, instr.src]);
192
+ }
193
+
194
+ const { color, spilled } = colorGraph(intervals, numIntRegs, moves);
195
+
196
+ // 把颜色号映射到具体寄存器名
197
+ const regMap = new Map();
198
+ for (const [v, c] of color) {
199
+ regMap.set(v, X86_INT_REGS[c] || `stack_${v}`);
200
+ }
201
+ // 溢出变量分配到栈槽
202
+ for (const v of spilled) regMap.set(v, `stack_${v}`);
203
+
204
+ return {
205
+ color: regMap,
206
+ spilled: [...spilled],
207
+ intRegs: X86_INT_REGS.slice(0, numIntRegs),
208
+ fpRegs: X86_FP_REGS.slice(0, numFpRegs),
209
+ };
210
+ }
211
+
212
+ module.exports = { allocate, computeLiveIntervals, colorGraph, interfere, X86_INT_REGS, X86_FP_REGS };
@@ -0,0 +1,86 @@
1
+ // ============================================================
2
+ // scheduler.js —— 基本块内指令调度(列表调度)
3
+ //
4
+ // 目标:减少流水线停顿。
5
+ // 1. 构建数据依赖图:指令 i 依赖 j(j 的 def 是 i 的 use)
6
+ // 2. 列出就绪指令(依赖已满足)
7
+ // 3. 按“下游关键路径长度”优先选择就绪指令发射
8
+ // 4. 避免 load/use 之间的 load-use 延迟(中间插一条不相关指令)
9
+ // ============================================================
10
+ 'use strict';
11
+
12
+ const I = require('./ir');
13
+
14
+ /**
15
+ * 对单个基本块做指令调度。
16
+ * 保持 phi 不动(必须块首),只调度非 phi、非终结符指令。
17
+ */
18
+ function scheduleBlock(blk) {
19
+ const phis = blk.instrs.filter(i => i.op === 'phi');
20
+ const body = blk.instrs.filter(i => i.op !== 'phi');
21
+ if (body.length <= 1) { blk.instrs = [...phis, ...body]; return; }
22
+
23
+ // 每条指令定义的变量 -> 指令在 body 中的下标
24
+ const defPos = new Map();
25
+ body.forEach((instr, i) => {
26
+ const d = I.instrDef(instr);
27
+ if (d) defPos.set(d, i);
28
+ });
29
+
30
+ // 依赖:body[i] 依赖 body[j](j 是 i 的某操作数的定义点)
31
+ const depends = Array.from({ length: body.length }, () => new Set());
32
+ const dependents = Array.from({ length: body.length }, () => new Set());
33
+ body.forEach((instr, i) => {
34
+ for (const u of I.instrUse(instr)) {
35
+ const j = defPos.get(u);
36
+ if (j != null && j !== i) {
37
+ depends[i].add(j);
38
+ dependents[j].add(i);
39
+ }
40
+ }
41
+ });
42
+
43
+ // 反向高度(关键路径长度):从每条指令到块尾的最长路径
44
+ const height = new Array(body.length).fill(0);
45
+ for (let i = body.length - 1; i >= 0; i--) {
46
+ let max = 0;
47
+ for (const d of dependents[i]) max = Math.max(max, height[d]);
48
+ height[i] = max + 1;
49
+ }
50
+
51
+ // 列表调度
52
+ const scheduled = [];
53
+ const scheduledSet = new Set();
54
+ const remainingDeps = depends.map(s => new Set(s));
55
+
56
+ while (scheduled.length < body.length) {
57
+ // 找就绪:remainingDeps[i] 为空
58
+ let best = -1, bestPri = -1;
59
+ for (let i = 0; i < body.length; i++) {
60
+ if (scheduledSet.has(i)) continue;
61
+ if (remainingDeps[i].size === 0) {
62
+ if (height[i] > bestPri) { bestPri = height[i]; best = i; }
63
+ }
64
+ }
65
+ if (best === -1) {
66
+ // 有环(不应出现),按原顺序补
67
+ for (let i = 0; i < body.length; i++) if (!scheduledSet.has(i)) { best = i; break; }
68
+ }
69
+ scheduled.push(body[best]);
70
+ scheduledSet.add(best);
71
+ // 把 best 从所有依赖它的指令的 remainingDeps 中删除
72
+ for (const d of dependents[best]) remainingDeps[d].delete(best);
73
+ }
74
+
75
+ blk.instrs = [...phis, ...scheduled];
76
+ }
77
+
78
+ /**
79
+ * 函数级调度
80
+ */
81
+ function scheduleFunction(fn, allocation) {
82
+ for (const blk of fn.blocks) scheduleBlock(blk);
83
+ return fn;
84
+ }
85
+
86
+ module.exports = { scheduleFunction, scheduleBlock };