script_core 0.2.2 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (376) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +41 -45
  3. data/.travis.yml +2 -1
  4. data/Gemfile +3 -3
  5. data/README.md +7 -1
  6. data/bootstrap.sh +2 -2
  7. data/ext/enterprise_script_service/libseccomp/.travis.yml +24 -12
  8. data/ext/enterprise_script_service/libseccomp/CHANGELOG +32 -0
  9. data/ext/enterprise_script_service/libseccomp/CONTRIBUTING.md +37 -26
  10. data/ext/enterprise_script_service/libseccomp/CREDITS +11 -0
  11. data/ext/enterprise_script_service/libseccomp/README.md +21 -1
  12. data/ext/enterprise_script_service/libseccomp/configure.ac +13 -8
  13. data/ext/enterprise_script_service/libseccomp/doc/Makefile.am +6 -0
  14. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_api_get.3 +12 -2
  15. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_arch_add.3 +38 -6
  16. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_attr_set.3 +53 -2
  17. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_export_bpf.3 +20 -2
  18. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_init.3 +9 -2
  19. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_load.3 +32 -2
  20. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_merge.3 +16 -2
  21. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_alloc.3 +113 -0
  22. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_fd.3 +1 -0
  23. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_free.3 +1 -0
  24. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_id_valid.3 +1 -0
  25. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_receive.3 +1 -0
  26. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_notify_respond.3 +1 -0
  27. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_rule_add.3 +64 -3
  28. data/ext/enterprise_script_service/libseccomp/doc/man/man3/seccomp_syscall_priority.3 +18 -3
  29. data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +19 -0
  30. data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +116 -0
  31. data/ext/enterprise_script_service/libseccomp/src/.gitignore +2 -0
  32. data/ext/enterprise_script_service/libseccomp/src/Makefile.am +31 -17
  33. data/ext/enterprise_script_service/libseccomp/src/api.c +254 -58
  34. data/ext/enterprise_script_service/libseccomp/src/arch-aarch64.h +1 -9
  35. data/ext/enterprise_script_service/libseccomp/src/arch-arm.c +47 -2
  36. data/ext/enterprise_script_service/libseccomp/src/arch-arm.h +1 -9
  37. data/ext/enterprise_script_service/libseccomp/src/arch-gperf-generate +40 -0
  38. data/ext/enterprise_script_service/libseccomp/src/arch-mips.c +41 -4
  39. data/ext/enterprise_script_service/libseccomp/src/arch-mips.h +2 -10
  40. data/ext/enterprise_script_service/libseccomp/src/arch-mips64.c +41 -4
  41. data/ext/enterprise_script_service/libseccomp/src/arch-mips64.h +3 -11
  42. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32.c +41 -4
  43. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32.h +2 -10
  44. data/ext/enterprise_script_service/libseccomp/src/arch-parisc.h +1 -10
  45. data/ext/enterprise_script_service/libseccomp/src/arch-parisc64.c +3 -3
  46. data/ext/enterprise_script_service/libseccomp/src/arch-parisc64.h +29 -0
  47. data/ext/enterprise_script_service/libseccomp/src/arch-ppc.h +1 -9
  48. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64.c +606 -8
  49. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64.h +2 -10
  50. data/ext/enterprise_script_service/libseccomp/src/arch-riscv64.c +31 -0
  51. data/ext/enterprise_script_service/libseccomp/src/arch-riscv64.h +22 -0
  52. data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +171 -12
  53. data/ext/enterprise_script_service/libseccomp/src/arch-s390.h +1 -17
  54. data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +166 -10
  55. data/ext/enterprise_script_service/libseccomp/src/arch-s390x.h +1 -20
  56. data/ext/enterprise_script_service/libseccomp/src/arch-syscall-dump.c +8 -1
  57. data/ext/enterprise_script_service/libseccomp/src/arch-syscall-validate +359 -143
  58. data/ext/enterprise_script_service/libseccomp/src/arch-x32.c +36 -2
  59. data/ext/enterprise_script_service/libseccomp/src/arch-x32.h +2 -10
  60. data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +172 -10
  61. data/ext/enterprise_script_service/libseccomp/src/arch-x86.h +1 -14
  62. data/ext/enterprise_script_service/libseccomp/src/arch-x86_64.h +1 -9
  63. data/ext/enterprise_script_service/libseccomp/src/arch.c +11 -3
  64. data/ext/enterprise_script_service/libseccomp/src/arch.h +7 -0
  65. data/ext/enterprise_script_service/libseccomp/src/db.c +268 -57
  66. data/ext/enterprise_script_service/libseccomp/src/db.h +16 -2
  67. data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +503 -148
  68. data/ext/enterprise_script_service/libseccomp/src/gen_bpf.h +2 -1
  69. data/ext/enterprise_script_service/libseccomp/src/gen_pfc.c +165 -37
  70. data/ext/enterprise_script_service/libseccomp/src/python/libseccomp.pxd +37 -1
  71. data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +295 -5
  72. data/ext/enterprise_script_service/libseccomp/src/syscalls.c +56 -0
  73. data/ext/enterprise_script_service/libseccomp/src/syscalls.csv +470 -0
  74. data/ext/enterprise_script_service/libseccomp/src/syscalls.h +62 -0
  75. data/ext/enterprise_script_service/libseccomp/src/syscalls.perf.template +82 -0
  76. data/ext/enterprise_script_service/libseccomp/src/system.c +196 -16
  77. data/ext/enterprise_script_service/libseccomp/src/system.h +68 -13
  78. data/ext/enterprise_script_service/libseccomp/tests/.gitignore +10 -2
  79. data/ext/enterprise_script_service/libseccomp/tests/06-sim-actions.tests +1 -1
  80. data/ext/enterprise_script_service/libseccomp/tests/11-basic-basic_errors.c +5 -5
  81. data/ext/enterprise_script_service/libseccomp/tests/13-basic-attrs.c +35 -1
  82. data/ext/enterprise_script_service/libseccomp/tests/13-basic-attrs.py +10 -1
  83. data/ext/enterprise_script_service/libseccomp/tests/15-basic-resolver.c +4 -3
  84. data/ext/enterprise_script_service/libseccomp/tests/16-sim-arch_basic.c +12 -0
  85. data/ext/enterprise_script_service/libseccomp/tests/16-sim-arch_basic.py +1 -0
  86. data/ext/enterprise_script_service/libseccomp/tests/{18-sim-basic_whitelist.c → 18-sim-basic_allowlist.c} +0 -0
  87. data/ext/enterprise_script_service/libseccomp/tests/{18-sim-basic_whitelist.py → 18-sim-basic_allowlist.py} +0 -0
  88. data/ext/enterprise_script_service/libseccomp/tests/18-sim-basic_allowlist.tests +32 -0
  89. data/ext/enterprise_script_service/libseccomp/tests/23-sim-arch_all_le_basic.c +3 -0
  90. data/ext/enterprise_script_service/libseccomp/tests/23-sim-arch_all_le_basic.py +1 -0
  91. data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.c +3 -0
  92. data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.py +1 -0
  93. data/ext/enterprise_script_service/libseccomp/tests/30-sim-socket_syscalls.tests +33 -17
  94. data/ext/enterprise_script_service/libseccomp/tests/{34-sim-basic_blacklist.c → 34-sim-basic_denylist.c} +0 -0
  95. data/ext/enterprise_script_service/libseccomp/tests/{34-sim-basic_blacklist.py → 34-sim-basic_denylist.py} +0 -0
  96. data/ext/enterprise_script_service/libseccomp/tests/34-sim-basic_denylist.tests +32 -0
  97. data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.c +3 -0
  98. data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.py +1 -0
  99. data/ext/enterprise_script_service/libseccomp/tests/36-sim-ipc_syscalls.tests +25 -25
  100. data/ext/enterprise_script_service/libseccomp/tests/39-basic-api_level.c +24 -3
  101. data/ext/enterprise_script_service/libseccomp/tests/39-basic-api_level.py +16 -1
  102. data/ext/enterprise_script_service/libseccomp/tests/47-live-kill_process.c +3 -3
  103. data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.c +112 -0
  104. data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.py +60 -0
  105. data/ext/enterprise_script_service/libseccomp/tests/51-live-user_notification.tests +11 -0
  106. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.c +48 -0
  107. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.py +38 -0
  108. data/ext/enterprise_script_service/libseccomp/tests/52-basic-load.tests +11 -0
  109. data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.c +156 -0
  110. data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.py +95 -0
  111. data/ext/enterprise_script_service/libseccomp/tests/53-sim-binary_tree.tests +65 -0
  112. data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.c +128 -0
  113. data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.py +95 -0
  114. data/ext/enterprise_script_service/libseccomp/tests/54-live-binary_tree.tests +11 -0
  115. data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.c +134 -0
  116. data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.sh +46 -0
  117. data/ext/enterprise_script_service/libseccomp/tests/55-basic-pfc_binary_tree.tests +11 -0
  118. data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.c +90 -0
  119. data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.py +65 -0
  120. data/ext/enterprise_script_service/libseccomp/tests/56-basic-iterate_syscalls.tests +11 -0
  121. data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.c +64 -0
  122. data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.py +46 -0
  123. data/ext/enterprise_script_service/libseccomp/tests/57-basic-rawsysrc.tests +11 -0
  124. data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.c +116 -0
  125. data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.py +61 -0
  126. data/ext/enterprise_script_service/libseccomp/tests/58-live-tsync_notify.tests +11 -0
  127. data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +34 -10
  128. data/ext/enterprise_script_service/libseccomp/tests/regression +10 -3
  129. data/ext/enterprise_script_service/libseccomp/tests/util.c +3 -3
  130. data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -3
  131. data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -1
  132. data/ext/enterprise_script_service/libseccomp/tools/scmp_arch_detect.c +3 -0
  133. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_disasm.c +4 -2
  134. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +4 -0
  135. data/ext/enterprise_script_service/libseccomp/tools/util.c +14 -12
  136. data/ext/enterprise_script_service/libseccomp/tools/util.h +7 -0
  137. data/ext/enterprise_script_service/mruby/.github/workflows/build.yml +106 -0
  138. data/ext/enterprise_script_service/mruby/.github/workflows/codeql-analysis.yml +51 -0
  139. data/ext/enterprise_script_service/mruby/.github/workflows/main.yml +24 -0
  140. data/ext/enterprise_script_service/mruby/.gitignore +3 -0
  141. data/ext/enterprise_script_service/mruby/.travis.yml +6 -9
  142. data/ext/enterprise_script_service/mruby/AUTHORS +1 -0
  143. data/ext/enterprise_script_service/mruby/Doxyfile +1 -1
  144. data/ext/enterprise_script_service/mruby/LICENSE +1 -1
  145. data/ext/enterprise_script_service/mruby/README.md +6 -2
  146. data/ext/enterprise_script_service/mruby/appveyor.yml +9 -12
  147. data/ext/enterprise_script_service/mruby/appveyor_config.rb +9 -0
  148. data/ext/enterprise_script_service/mruby/build_config.rb +6 -6
  149. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +6 -2
  150. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
  151. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +4 -8
  152. data/ext/enterprise_script_service/mruby/doc/limitations.md +10 -10
  153. data/ext/enterprise_script_service/mruby/doc/opcode.md +108 -95
  154. data/ext/enterprise_script_service/mruby/examples/targets/build_config_ArduinoDue.rb +2 -2
  155. data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelEdison.rb +2 -2
  156. data/ext/enterprise_script_service/mruby/examples/targets/build_config_IntelGalileo.rb +2 -2
  157. data/ext/enterprise_script_service/mruby/examples/targets/build_config_RX630.rb +2 -2
  158. data/ext/enterprise_script_service/mruby/examples/targets/build_config_chipKITMax32.rb +2 -2
  159. data/ext/enterprise_script_service/mruby/examples/targets/build_config_dreamcast_shelf.rb +108 -0
  160. data/ext/enterprise_script_service/mruby/include/mrbconf.h +10 -7
  161. data/ext/enterprise_script_service/mruby/include/mruby.h +24 -9
  162. data/ext/enterprise_script_service/mruby/include/mruby/array.h +4 -0
  163. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +11 -2
  164. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +0 -10
  165. data/ext/enterprise_script_service/mruby/include/mruby/common.h +10 -0
  166. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +11 -3
  167. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +1 -17
  168. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +10 -0
  169. data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -1
  170. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +23 -5
  171. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +1 -0
  172. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +3 -2
  173. data/ext/enterprise_script_service/mruby/include/mruby/proc.h +13 -8
  174. data/ext/enterprise_script_service/mruby/include/mruby/string.h +2 -1
  175. data/ext/enterprise_script_service/mruby/include/mruby/value.h +32 -41
  176. data/ext/enterprise_script_service/mruby/include/mruby/version.h +4 -4
  177. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +2 -30
  178. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +21 -46
  179. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +9 -0
  180. data/ext/enterprise_script_service/mruby/lib/mruby/source.rb +3 -1
  181. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +7 -0
  182. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +0 -31
  183. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +5 -8
  184. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +0 -13
  185. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-config/mrbgem.rake +5 -2
  186. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +0 -1
  187. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +5 -1
  188. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +7 -3
  189. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +24 -21
  190. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/mrbgem.rake +0 -1
  191. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +6 -2
  192. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-strip/tools/mruby-strip/mruby-strip.c +6 -2
  193. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +6 -1
  194. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +76 -48
  195. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +107 -32
  196. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/y.tab.c +13153 -0
  197. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/mrbgem.rake +13 -15
  198. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +1 -1
  199. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +1 -2
  200. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +3 -3
  201. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +3 -214
  202. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +21 -0
  203. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +1 -2
  204. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/src/hash-ext.c +1 -3
  205. data/ext/enterprise_script_service/mruby/mrbgems/mruby-inline-struct/test/inline.c +3 -4
  206. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/include/mruby/ext/io.h +39 -7
  207. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +2 -8
  208. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file_constants.rb +0 -16
  209. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +7 -12
  210. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +77 -32
  211. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +18 -36
  212. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +324 -122
  213. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +18 -12
  214. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +32 -0
  215. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +57 -49
  216. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +6 -8
  217. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +15 -17
  218. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +9 -0
  219. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +4 -5
  220. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +3 -12
  221. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +0 -1
  222. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +113 -10
  223. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/src/print.c +6 -3
  224. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +2 -2
  225. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +1 -3
  226. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +1 -3
  227. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +9 -9
  228. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/src/mrb_sleep.c +1 -1
  229. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/mrbgem.rake +1 -1
  230. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/test/sockettest.c +3 -2
  231. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +62 -25
  232. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/test/sprintf.rb +5 -23
  233. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +4 -5
  234. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +5 -11
  235. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +1 -1
  236. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +1 -0
  237. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +11 -15
  238. data/ext/enterprise_script_service/mruby/mrblib/00class.rb +10 -0
  239. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +3 -3
  240. data/ext/enterprise_script_service/mruby/src/array.c +25 -11
  241. data/ext/enterprise_script_service/mruby/src/backtrace.c +2 -2
  242. data/ext/enterprise_script_service/mruby/src/class.c +48 -32
  243. data/ext/enterprise_script_service/mruby/src/codedump.c +4 -0
  244. data/ext/enterprise_script_service/mruby/src/debug.c +8 -5
  245. data/ext/enterprise_script_service/mruby/src/dump.c +3 -65
  246. data/ext/enterprise_script_service/mruby/src/error.c +58 -7
  247. data/ext/enterprise_script_service/mruby/src/etc.c +13 -5
  248. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +98 -21
  249. data/ext/enterprise_script_service/mruby/src/gc.c +15 -280
  250. data/ext/enterprise_script_service/mruby/src/hash.c +13 -21
  251. data/ext/enterprise_script_service/mruby/src/kernel.c +6 -9
  252. data/ext/enterprise_script_service/mruby/src/load.c +56 -30
  253. data/ext/enterprise_script_service/mruby/src/numeric.c +50 -70
  254. data/ext/enterprise_script_service/mruby/src/object.c +23 -5
  255. data/ext/enterprise_script_service/mruby/src/print.c +27 -3
  256. data/ext/enterprise_script_service/mruby/src/proc.c +26 -7
  257. data/ext/enterprise_script_service/mruby/src/range.c +4 -12
  258. data/ext/enterprise_script_service/mruby/src/state.c +34 -11
  259. data/ext/enterprise_script_service/mruby/src/string.c +93 -56
  260. data/ext/enterprise_script_service/mruby/src/symbol.c +13 -12
  261. data/ext/enterprise_script_service/mruby/src/vm.c +48 -53
  262. data/ext/enterprise_script_service/mruby/tasks/gitlab.rake +19 -22
  263. data/ext/enterprise_script_service/mruby/tasks/mrbgems.rake +1 -1
  264. data/ext/enterprise_script_service/mruby/tasks/toolchains/android.rake +46 -1
  265. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +3 -3
  266. data/ext/enterprise_script_service/mruby/tasks/toolchains/openwrt.rake +6 -6
  267. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +8 -8
  268. data/ext/enterprise_script_service/mruby/test/assert.rb +5 -4
  269. data/ext/enterprise_script_service/mruby/test/t/ensure.rb +8 -26
  270. data/ext/enterprise_script_service/mruby/test/t/exception.rb +2 -2
  271. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +15 -24
  272. data/ext/enterprise_script_service/mruby/travis_config.rb +0 -14
  273. data/ext/enterprise_script_service/msgpack/.github/depends/boost.sh +56 -0
  274. data/ext/enterprise_script_service/msgpack/.github/workflows/coverage.yml +62 -0
  275. data/ext/enterprise_script_service/msgpack/.github/workflows/gha.yml +304 -0
  276. data/ext/enterprise_script_service/msgpack/CHANGELOG.md +11 -0
  277. data/ext/enterprise_script_service/msgpack/CMakeLists.txt +82 -39
  278. data/ext/enterprise_script_service/msgpack/Files.cmake +22 -12
  279. data/ext/enterprise_script_service/msgpack/QUICKSTART-C.md +26 -29
  280. data/ext/enterprise_script_service/msgpack/README.md +3 -2
  281. data/ext/enterprise_script_service/msgpack/appveyor.yml +6 -2
  282. data/ext/enterprise_script_service/msgpack/ci/build_cmake.sh +3 -1
  283. data/ext/enterprise_script_service/msgpack/cmake/CodeCoverage.cmake +55 -0
  284. data/ext/enterprise_script_service/msgpack/codecov.yml +36 -0
  285. data/ext/enterprise_script_service/msgpack/example/CMakeLists.txt +9 -5
  286. data/ext/enterprise_script_service/msgpack/example/boost/CMakeLists.txt +1 -1
  287. data/ext/enterprise_script_service/msgpack/example/c/CMakeLists.txt +17 -6
  288. data/ext/enterprise_script_service/msgpack/example/c/boundary.c +296 -0
  289. data/ext/enterprise_script_service/msgpack/example/c/jsonconv.c +419 -0
  290. data/ext/enterprise_script_service/msgpack/example/c/simple_c.c +1 -1
  291. data/ext/enterprise_script_service/msgpack/example/cpp03/CMakeLists.txt +3 -3
  292. data/ext/enterprise_script_service/msgpack/example/cpp11/CMakeLists.txt +2 -2
  293. data/ext/enterprise_script_service/msgpack/example/x3/CMakeLists.txt +2 -2
  294. data/ext/enterprise_script_service/msgpack/include/msgpack/pack.h +24 -1
  295. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +5 -4
  296. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/boost/optional.hpp +4 -4
  297. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp17/vector_byte.hpp +8 -8
  298. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/map.hpp +4 -4
  299. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector.hpp +4 -4
  300. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_char.hpp +8 -8
  301. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/vector_unsigned_char.hpp +8 -8
  302. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +4 -4
  303. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/unpack.hpp +6 -6
  304. data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
  305. data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +4 -4
  306. data/ext/enterprise_script_service/msgpack/make_file_list.sh +38 -11
  307. data/ext/enterprise_script_service/msgpack/src/vrefbuffer.c +6 -0
  308. data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +86 -64
  309. data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +4 -0
  310. data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +4 -0
  311. data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +4 -0
  312. data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +4 -1
  313. data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +4 -0
  314. data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +4 -0
  315. data/ext/enterprise_script_service/msgpack/test/buffer.cpp +4 -47
  316. data/ext/enterprise_script_service/msgpack/test/buffer_c.cpp +148 -0
  317. data/ext/enterprise_script_service/msgpack/test/carray.cpp +4 -0
  318. data/ext/enterprise_script_service/msgpack/test/cases.cpp +8 -4
  319. data/ext/enterprise_script_service/msgpack/test/convert.cpp +8 -4
  320. data/ext/enterprise_script_service/msgpack/test/fixint.cpp +4 -0
  321. data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +4 -0
  322. data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +4 -0
  323. data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +4 -0
  324. data/ext/enterprise_script_service/msgpack/test/json.cpp +4 -0
  325. data/ext/enterprise_script_service/msgpack/test/limit.cpp +8 -4
  326. data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +4 -0
  327. data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +159 -0
  328. data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +4 -0
  329. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +32 -27
  330. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +4 -0
  331. data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +4 -0
  332. data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +4 -1
  333. data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +4 -0
  334. data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +4 -0
  335. data/ext/enterprise_script_service/msgpack/test/object.cpp +4 -1
  336. data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +12 -8
  337. data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +30 -26
  338. data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +4 -0
  339. data/ext/enterprise_script_service/msgpack/test/raw.cpp +4 -0
  340. data/ext/enterprise_script_service/msgpack/test/reference.cpp +4 -0
  341. data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +4 -0
  342. data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +4 -0
  343. data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +4 -0
  344. data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +4 -0
  345. data/ext/enterprise_script_service/msgpack/test/streaming.cpp +8 -4
  346. data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +4 -0
  347. data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +4 -0
  348. data/ext/enterprise_script_service/msgpack/test/user_class.cpp +16 -12
  349. data/ext/enterprise_script_service/msgpack/test/version.cpp +4 -0
  350. data/ext/enterprise_script_service/msgpack/test/visitor.cpp +4 -0
  351. data/ext/enterprise_script_service/msgpack/test/zone.cpp +4 -0
  352. data/lib/script_core/engine.rb +24 -5
  353. data/lib/script_core/executable.rb +4 -3
  354. data/lib/script_core/result.rb +1 -5
  355. data/lib/script_core/service_channel.rb +1 -0
  356. data/lib/script_core/version.rb +1 -1
  357. data/lib/tasks/script_core.rake +3 -1
  358. data/script_core.gemspec +2 -2
  359. data/spec/dummy/app/lib/script_engine.rb +64 -5
  360. metadata +68 -30
  361. data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +0 -559
  362. data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +0 -570
  363. data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +0 -562
  364. data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +0 -562
  365. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +0 -562
  366. data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +0 -542
  367. data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +0 -559
  368. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +0 -559
  369. data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +0 -626
  370. data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +0 -626
  371. data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +0 -558
  372. data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +0 -692
  373. data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +0 -559
  374. data/ext/enterprise_script_service/libseccomp/tests/18-sim-basic_whitelist.tests +0 -32
  375. data/ext/enterprise_script_service/libseccomp/tests/34-sim-basic_blacklist.tests +0 -32
  376. data/ext/enterprise_script_service/msgpack/.travis.yml +0 -258
@@ -4,20 +4,23 @@ os: Visual Studio 2017
4
4
 
5
5
  shallow_clone: true
6
6
 
7
-
8
- cache:
9
- - win_flex_bison
10
-
11
-
12
7
  environment:
13
8
  matrix:
14
9
  # Visual Studio 2017 64bit
15
10
  - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
16
11
 
12
+ # Visual Studio 2017 32bit
13
+ - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
14
+ machine: x86
15
+
17
16
  # Visual Studio 2015 64bit
18
17
  - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
19
18
  machine: amd64
20
19
 
20
+ # Visual Studio 2015 32bit
21
+ - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
22
+ machine: x86
23
+
21
24
  # Visual Studio 2013 64bit
22
25
  - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat
23
26
  machine: amd64
@@ -30,13 +33,7 @@ init:
30
33
  - ruby --version
31
34
 
32
35
 
33
- install:
34
- - if not exist win_flex_bison (
35
- appveyor DownloadFile "https://github.com/lexxmark/winflexbison/releases/download/v.2.5.10/win_flex_bison-2.5.10.zip" &
36
- 7z x -y -owin_flex_bison win_flex_bison-2.5.10.zip
37
- )
38
-
39
36
  build_script:
40
- - set YACC=.\win_flex_bison\win_bison.exe
41
37
  - set MRUBY_CONFIG=appveyor_config.rb
38
+ - rake -m
42
39
  - rake -E $stdout.sync=true test
@@ -1,3 +1,9 @@
1
+ def setup_option(conf)
2
+ conf.cc.flags[0].delete("/Zi") unless ENV['CFLAGS']
3
+ conf.cxx.flags[0].delete("/Zi") unless ENV['CFLAGS'] || ENV['CXXFLAGS']
4
+ conf.linker.flags << "/DEBUG:NONE" unless ENV['LDFLAGS']
5
+ end
6
+
1
7
  MRuby::Build.new('full-debug') do |conf|
2
8
  toolchain :visualcpp
3
9
  enable_debug
@@ -5,6 +11,7 @@
5
11
  # include all core GEMs
6
12
  conf.gembox 'full-core'
7
13
  conf.cc.defines += %w(MRB_GC_STRESS MRB_METHOD_CACHE MRB_ENABLE_DEBUG_HOOK)
14
+ setup_option(conf)
8
15
 
9
16
  conf.enable_test
10
17
  end
@@ -17,6 +24,7 @@
17
24
  conf.compilers.each do |c|
18
25
  c.defines += %w(MRB_GC_FIXED_ARENA)
19
26
  end
27
+ setup_option(conf)
20
28
  conf.enable_bintest
21
29
  conf.enable_test
22
30
  end
@@ -28,6 +36,7 @@
28
36
  conf.compilers.each do |c|
29
37
  c.defines += %w(MRB_GC_FIXED_ARENA)
30
38
  end
39
+ setup_option(conf)
31
40
  conf.enable_bintest
32
41
  conf.enable_test
33
42
 
@@ -30,9 +30,9 @@
30
30
  # cc.flags = [ENV['CFLAGS'] || %w()]
31
31
  # cc.include_paths = ["#{root}/include"]
32
32
  # cc.defines = %w()
33
- # cc.option_include_path = '-I%s'
33
+ # cc.option_include_path = %q[-I"%s"]
34
34
  # cc.option_define = '-D%s'
35
- # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
35
+ # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
36
36
  # end
37
37
 
38
38
  # mrbc settings
@@ -50,25 +50,25 @@
50
50
  # linker.library_paths = []
51
51
  # linker.option_library = '-l%s'
52
52
  # linker.option_library_path = '-L%s'
53
- # linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
53
+ # linker.link_options = "%{flags} -o "%{outfile}" %{objs} %{libs}"
54
54
  # end
55
55
 
56
56
  # Archiver settings
57
57
  # conf.archiver do |archiver|
58
58
  # archiver.command = ENV['AR'] || 'ar'
59
- # archiver.archive_options = 'rs %{outfile} %{objs}'
59
+ # archiver.archive_options = 'rs "%{outfile}" %{objs}'
60
60
  # end
61
61
 
62
62
  # Parser generator settings
63
63
  # conf.yacc do |yacc|
64
64
  # yacc.command = ENV['YACC'] || 'bison'
65
- # yacc.compile_options = '-o %{outfile} %{infile}'
65
+ # yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
66
66
  # end
67
67
 
68
68
  # gperf settings
69
69
  # conf.gperf do |gperf|
70
70
  # gperf.command = 'gperf'
71
- # gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'
71
+ # gperf.compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
72
72
  # end
73
73
 
74
74
  # file extensions
@@ -6,12 +6,16 @@ binaries.
6
6
  ## Prerequisites
7
7
 
8
8
  To compile mruby out of the source code you need the following tools:
9
- * C Compiler (e.g. `gcc`)
10
- * Linker (e.g. `gcc`)
9
+ * C Compiler (e.g. `gcc` or `clang`)
10
+ * Linker (e.g. `gcc` or `clang`)
11
11
  * Archive utility (e.g. `ar`)
12
12
  * Parser generator (e.g. `bison`)
13
13
  * Ruby 2.0 or later (e.g. `ruby` or `jruby`)
14
14
 
15
+ Note that `bison` bundled with MacOS is too old to compile `mruby`.
16
+ Try `brew install bison` and follow the instuction shown to update
17
+ the `$PATH` to compile `mruby`.
18
+
15
19
  Optional:
16
20
  * GIT (to update mruby source and integrate mrbgems easier)
17
21
  * C++ compiler (to use GEMs which include \*.cpp, \*.cxx, \*.cc)
@@ -38,7 +38,7 @@ To confirm mrdb was installed properly, run mrdb with the `--version` option:
38
38
 
39
39
  ```bash
40
40
  $ mrdb --version
41
- mruby 2.1.0 (2019-11-19)
41
+ mruby 2.1.2 (2020-08-06)
42
42
  ```
43
43
 
44
44
  ## 2.2 Basic Operation
@@ -54,17 +54,13 @@ You can use mrbconfs with following ways:
54
54
  * When defined removes floating point numbers from mruby.
55
55
  * It makes mruby easier to handle in "Microcontroller without FPU" and "Kernel Space".
56
56
 
57
- `MRB_INT16`
58
- * When defined `int16_t` will be defined as `mrb_int`.
59
- * Conflicts with `MRB_INT32` and `MRB_INT64`.
60
-
61
57
  `MRB_INT32`
62
- * When defined, or both `MRB_INT16` and `MRB_INT64` are not defined on 32-bit CPU mode, `int32_t` will be defined as `mrb_int`.
63
- * Conflicts with `MRB_INT16` and `MRB_INT64`.
58
+ * When defined, or `MRB_INT64` are not defined on 32-bit CPU mode, `mrb_int` will be defined as `int32_t`.
59
+ * Conflicts with `MRB_INT64`.
64
60
 
65
61
  `MRB_INT64`
66
- * When defined, or both `MRB_INT16` and `MRB_INT32` are not defined on 64-bit CPU mode, `int64_t` will be defined as `mrb_int`.
67
- * Conflicts with `MRB_INT16` and `MRB_INT32`.
62
+ * When defined, or `MRB_INT32` are not defined on 64-bit CPU mode, `mrb_int` will be defined as `int64_t`.
63
+ * Conflicts with `MRB_INT32`.
68
64
 
69
65
  ## Garbage collector configuration.
70
66
 
@@ -38,7 +38,7 @@ puts [1,2,3]
38
38
  3
39
39
  ```
40
40
 
41
- #### mruby [2.1.0 (2019-11-19)]
41
+ #### mruby [2.1.2 (2020-08-06)]
42
42
 
43
43
  ```
44
44
  [1, 2, 3]
@@ -61,7 +61,7 @@ end
61
61
 
62
62
  `ZeroDivisionError` is raised.
63
63
 
64
- #### mruby [2.1.0 (2019-11-19)]
64
+ #### mruby [2.1.2 (2020-08-06)]
65
65
 
66
66
  No exception is raised.
67
67
 
@@ -89,7 +89,7 @@ p Liste.new "foobar"
89
89
 
90
90
  ` [] `
91
91
 
92
- #### mruby [2.1.0 (2019-11-19)]
92
+ #### mruby [2.1.2 (2020-08-06)]
93
93
 
94
94
  `ArgumentError` is raised.
95
95
 
@@ -119,7 +119,7 @@ false
119
119
  true
120
120
  ```
121
121
 
122
- #### mruby [2.1.0 (2019-11-19)]
122
+ #### mruby [2.1.2 (2020-08-06)]
123
123
 
124
124
  ```
125
125
  true
@@ -156,7 +156,7 @@ p 'ok'
156
156
  ok
157
157
  ```
158
158
 
159
- #### mruby [2.1.0 (2019-11-19)]
159
+ #### mruby [2.1.2 (2020-08-06)]
160
160
 
161
161
  ```
162
162
  test.rb:8: undefined method 'test_func' (NoMethodError)
@@ -178,7 +178,7 @@ defined?(Foo)
178
178
  nil
179
179
  ```
180
180
 
181
- #### mruby [2.1.0 (2019-11-19)]
181
+ #### mruby [2.1.2 (2020-08-06)]
182
182
 
183
183
  `NameError` is raised.
184
184
 
@@ -195,7 +195,7 @@ alias $a $__a__
195
195
 
196
196
  ` nil `
197
197
 
198
- #### mruby [2.1.0 (2019-11-19)]
198
+ #### mruby [2.1.2 (2020-08-06)]
199
199
 
200
200
  Syntax error
201
201
 
@@ -217,7 +217,7 @@ end
217
217
  `ArgumentError` is raised.
218
218
  The re-defined `+` operator does not accept any arguments.
219
219
 
220
- #### mruby [2.1.0 (2019-11-19)]
220
+ #### mruby [2.1.2 (2020-08-06)]
221
221
 
222
222
  ` 'ab' `
223
223
  Behavior of the operator wasn't changed.
@@ -233,7 +233,7 @@ $ ruby -e 'puts Proc.new {}.binding'
233
233
  #<Binding:0x00000e9deabb9950>
234
234
  ```
235
235
 
236
- #### mruby [2.1.0 (2019-11-19)]
236
+ #### mruby [2.1.2 (2020-08-06)]
237
237
 
238
238
  ```
239
239
  $ ./bin/mruby -e 'puts Proc.new {}.binding'
@@ -255,7 +255,7 @@ $ ruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)'
255
255
  [[{"a"=>1}], {:b=>2}]
256
256
  ```
257
257
 
258
- #### mruby [mruby 2.1.0]
258
+ #### mruby [mruby 2.1.2]
259
259
 
260
260
  ```
261
261
  $ ./bin/mruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)'
@@ -16,7 +16,6 @@ In the table.1 below, the second field describes the size (and
16
16
  sign) of operands.
17
17
 
18
18
  * B: 8bit
19
- * sB: signed 8bit
20
19
  * S: 16bit
21
20
  * sS: signed 16bit
22
21
  * W: 24bit
@@ -31,97 +30,111 @@ with `"`, either `OP_EXT1` or `OP_EXT2` or `OP_EXT2` can be prefixed.
31
30
 
32
31
  ## table.1 Instruction Table
33
32
 
34
- | Instruction Name | Operand type | Semantics |
35
- |:-----------------|--------------|---------------------|
36
- | OP_NOP | - | |
37
- | OP_MOVE" | BB | R(a) = R(b)
38
- | OP_LOADL" | BB | R(a) = Pool(b)
39
- | OP_LOADI" | BsB | R(a) = mrb_int(b)
40
- | OP_LOADI_0' | B | R(a) = 0
41
- | OP_LOADI_1' | B | R(a) = 1
42
- | OP_LOADI_2' | B | R(a) = 2
43
- | OP_LOADI_3' | B | R(a) = 3
44
- | OP_LOADSYM" | BB | R(a) = Syms(b)
45
- | OP_LOADNIL' | B | R(a) = nil
46
- | OP_LOADSELF' | B | R(a) = self
47
- | OP_LOADT' | B | R(a) = true
48
- | OP_LOADF' | B | R(a) = false
49
- | OP_GETGV" | BB | R(a) = getglobal(Syms(b))
50
- | OP_SETGV" | BB | setglobal(Syms(b), R(a))
51
- | OP_GETSV" | BB | R(a) = Special[b]
52
- | OP_SETSV" | BB | Special[b] = R(a)
53
- | OP_GETIV" | BB | R(a) = ivget(Syms(b))
54
- | OP_SETIV" | BB | ivset(Syms(b),R(a))
55
- | OP_GETCV" | BB | R(a) = cvget(Syms(b))
56
- | OP_SETCV" | BB | cvset(Syms(b),R(a))
57
- | OP_GETCONST" | BB | R(a) = constget(Syms(b))
58
- | OP_SETCONST" | BB | constset(Syms(b),R(a))
59
- | OP_GETMCNST" | BB | R(a) = R(a)::Syms(b)
60
- | OP_SETMCNST" | BB | R(a+1)::Syms(b) = R(a)
61
- | OP_GETUPVAR' | BBB | R(a) = uvget(b,c)
62
- | OP_SETUPVAR' | BBB | uvset(b,c,R(a))
63
- | OP_JMP | S | pc+=a
64
- | OP_JMPIF' | SB | if R(b) pc+=a
65
- | OP_JMPNOT' | SB | if !R(b) pc+=a
66
- | OP_ONERR | sS | rescue_push(pc+a)
67
- | OP_EXCEPT' | B | R(a) = exc
68
- | OP_RESCUE" | BB | R(b) = R(a).isa?(R(b))
69
- | OP_POPERR | B | a.times{rescue_pop()}
70
- | OP_RAISE' | B | raise(R(a))
71
- | OP_EPUSH' | B | ensure_push(SEQ[a])
72
- | OP_EPOP | B | A.times{ensure_pop().call}
73
- | OP_SENDV" | BB | R(a) = call(R(a),Syms(b),*R(a+1))
74
- | OP_SENDVB" | BB | R(a) = call(R(a),Syms(b),*R(a+1),&R(a+2))
75
- | OP_SEND" | BBB | R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c))
76
- | OP_SENDB" | BBB | R(a) = call(R(a),Syms(Bx),R(a+1),...,R(a+c),&R(a+c+1))
77
- | OP_CALL' | B | R(a) = self.call(frame.argc, frame.argv)
78
- | OP_SUPER' | BB | R(a) = super(R(a+1),... ,R(a+b+1))
79
- | OP_ARGARY' | BS | R(a) = argument array (16=5:1:5:1:4)
80
- | OP_ENTER | W | arg setup according to flags (23=5:5:1:5:5:1:1)
81
- | OP_KARG" | BB | R(a) = kdict[Syms(Bx)] # todo
82
- | OP_KARG2" | BB | R(a) = kdict[Syms(Bx)]; kdict.rm(Syms(b)) # todo
83
- | OP_RETURN' | B | return R(a) (normal)
84
- | OP_RETURN_BLK' | B | return R(a) (in-block return)
85
- | OP_BREAK' | B | break R(a)
86
- | OP_BLKPUSH' | BS | R(a) = block (16=5:1:5:1:4)
87
- | OP_ADD" | BB | R(a) = R(a)+R(a+1)
88
- | OP_ADDI" | BBB | R(a) = R(a)+mrb_int(c)
89
- | OP_SUB" | BB | R(a) = R(a)-R(a+1)
90
- | OP_SUBI" | BB | R(a) = R(a)-C
91
- | OP_MUL" | BB | R(a) = R(a)*R(a+1)
92
- | OP_DIV" | BB | R(a) = R(a)/R(a+1)
93
- | OP_EQ" | BB | R(a) = R(a)==R(a+1)
94
- | OP_LT" | BB | R(a) = R(a)<R(a+1)
95
- | OP_LE" | BB | R(a) = R(a)<=R(a+1)
96
- | OP_GT" | BB | R(a) = R(a)>R(a+1)
97
- | OP_GE" | BB | R(a) = R(a)>=R(a+1)
98
- | OP_ARRAY' | BB | R(a) = ary_new(R(a),R(a+1)..R(a+b))
99
- | OP_ARRAY2" | BB | R(a) = ary_new(R(b),R(b+1)..R(b+c))
100
- | OP_ARYCAT' | B | ary_cat(R(a),R(a+1))
101
- | OP_ARYPUSH' | B | ary_push(R(a),R(a+1))
102
- | OP_AREF' | BB | R(a) = R(a)[b]
103
- | OP_ASET' | BB | R(a)[b] = R(a+1)
104
- | OP_APOST' | BB | *R(a),R(A+1)..R(A+C) = R(a)[B..]
105
- | OP_STRING" | BB | R(a) = str_dup(Lit(b))
106
- | OP_STRCAT' | B | str_cat(R(a),R(a+1))
107
- | OP_HASH' | BB | R(a) = hash_new(R(a),R(a+1)..R(a+b))
108
- | OP_HASHADD' | BB | R(a) = hash_push(R(a),R(a+1)..R(a+b))
109
- | OP_LAMBDA" | BB | R(a) = lambda(SEQ[b],OP_L_LAMBDA)
110
- | OP_BLOCK" | BB | R(a) = lambda(SEQ[b],OP_L_BLOCK)
111
- | OP_METHOD" | BB | R(a) = lambda(SEQ[b],OP_L_METHOD)
112
- | OP_RANGE_INC' | B | R(a) = range_new(R(a),R(a+1),FALSE)
113
- | OP_RANGE_EXC' | B | R(a) = range_new(R(a),R(a+1),TRUE)
114
- | OP_OCLASS' | B | R(a) = ::Object
115
- | OP_CLASS" | BB | R(a) = newclass(R(a),Syms(b),R(a+1))
116
- | OP_MODULE" | BB | R(a) = newmodule(R(a),Syms(b))
117
- | OP_EXEC" | BB | R(a) = blockexec(R(a),SEQ[b])
118
- | OP_DEF" | BB | R(a).newmethod(Syms(b),R(a+1))
119
- | OP_ALIAS' | B | alias_method(R(a),R(a+1),R(a+2))
120
- | OP_UNDEF" | BB | undef_method(R(a),Syms(b))
121
- | OP_SCLASS' | B | R(a) = R(a).singleton_class
122
- | OP_TCLASS' | B | R(a) = target_class
123
- | OP_ERR' | B | raise(RuntimeError, Lit(Bx))
124
- | OP_EXT1 | - | make 1st operand 16bit
125
- | OP_EXT2 | - | make 2nd operand 16bit
126
- | OP_EXT3 | - | make 1st and 2nd operands 16bit
127
- | OP_STOP | - | stop VM
33
+ | Instruction Name | Operand type | Semantics |
34
+ |------------------|--------------|--------------------------------------------------------|
35
+ | OP_NOP | - | no operation |
36
+ | OP_MOVE" | BB | R(a) = R(b) |
37
+ | OP_LOADL" | BB | R(a) = Pool(b) |
38
+ | OP_LOADI" | BB | R(a) = mrb_int(b) |
39
+ | OP_LOADINEG" | BB | R(a) = mrb_int(-b) |
40
+ | OP_LOADI__1' | B | R(a) = mrb_int(-1) |
41
+ | OP_LOADI_0' | B | R(a) = mrb_int(0) |
42
+ | OP_LOADI_1' | B | R(a) = mrb_int(1) |
43
+ | OP_LOADI_2' | B | R(a) = mrb_int(2) |
44
+ | OP_LOADI_3' | B | R(a) = mrb_int(3) |
45
+ | OP_LOADI_4' | B | R(a) = mrb_int(4) |
46
+ | OP_LOADI_5' | B | R(a) = mrb_int(5) |
47
+ | OP_LOADI_6' | B | R(a) = mrb_int(6) |
48
+ | OP_LOADI_7' | B | R(a) = mrb_int(7) |
49
+ | OP_LOADI16' | BsS | R(a) = mrb_int(b) |
50
+ | OP_LOADSYM" | BB | R(a) = Syms(b) |
51
+ | OP_LOADNIL' | B | R(a) = nil |
52
+ | OP_LOADSELF' | B | R(a) = self |
53
+ | OP_LOADT' | B | R(a) = true |
54
+ | OP_LOADF' | B | R(a) = false |
55
+ | OP_GETGV" | BB | R(a) = getglobal(Syms(b)) |
56
+ | OP_SETGV" | BB | setglobal(Syms(b), R(a)) |
57
+ | OP_GETSV" | BB | R(a) = Special[Syms(b)] |
58
+ | OP_SETSV" | BB | Special[Syms(b)] = R(a) |
59
+ | OP_GETIV" | BB | R(a) = ivget(Syms(b)) |
60
+ | OP_SETIV" | BB | ivset(Syms(b),R(a)) |
61
+ | OP_GETCV" | BB | R(a) = cvget(Syms(b)) |
62
+ | OP_SETCV" | BB | cvset(Syms(b),R(a)) |
63
+ | OP_GETCONST" | BB | R(a) = constget(Syms(b)) |
64
+ | OP_SETCONST" | BB | constset(Syms(b),R(a)) |
65
+ | OP_GETMCNST" | BB | R(a) = R(a)::Syms(b) |
66
+ | OP_SETMCNST" | BB | R(a+1)::Syms(b) = R(a) |
67
+ | OP_GETUPVAR" | BBB | R(a) = uvget(b,c) |
68
+ | OP_SETUPVAR" | BBB | uvset(b,c,R(a)) |
69
+ | OP_JMP | S | pc=a |
70
+ | OP_JMPIF' | BS | if R(a) pc=b |
71
+ | OP_JMPNOT' | BS | if !R(a) pc=b |
72
+ | OP_JMPNIL' | BS | if R(a)==nil pc=b |
73
+ | OP_ONERR | S | rescue_push(a) |
74
+ | OP_EXCEPT' | B | R(a) = exc |
75
+ | OP_RESCUE" | BB | R(b) = R(a).isa?(R(b)) |
76
+ | OP_POPERR' | B | a.times{rescue_pop()} |
77
+ | OP_RAISE' | B | raise(R(a)) |
78
+ | OP_EPUSH' | B | ensure_push(SEQ[a]) |
79
+ | OP_EPOP' | B | A.times{ensure_pop().call} |
80
+ | OP_SENDV" | BB | R(a) = call(R(a),Syms(b),*R(a+1)) |
81
+ | OP_SENDVB" | BB | R(a) = call(R(a),Syms(b),*R(a+1),&R(a+2)) |
82
+ | OP_SEND" | BBB | R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c)) |
83
+ | OP_SENDB" | BBB | R(a) = call(R(a),Syms(b),R(a+1),...,R(a+c),&R(a+c+1)) |
84
+ | OP_CALL | - | R(0) = self.call(frame.argc, frame.argv) |
85
+ | OP_SUPER" | BB | R(a) = super(R(a+1),... ,R(a+b+1)) |
86
+ | OP_ARGARY' | BS | R(a) = argument array (16=5:1:5:1:4) |
87
+ | OP_ENTER | W | arg setup according to flags (23=5:5:1:5:5:1:1) |
88
+ | OP_KEY_P" | BB | R(a) = kdict.key?(Syms(b)) |
89
+ | OP_KEYEND | - | raise unless kdict.empty? |
90
+ | OP_KARG" | BB | R(a) = kdict[Syms(b)]; kdict.delete(Syms(b)) |
91
+ | OP_RETURN' | B | return R(a) (normal) |
92
+ | OP_RETURN_BLK' | B | return R(a) (in-block return) |
93
+ | OP_BREAK' | B | break R(a) |
94
+ | OP_BLKPUSH' | BS | R(a) = block (16=5:1:5:1:4) |
95
+ | OP_ADD' | B | R(a) = R(a)+R(a+1) |
96
+ | OP_ADDI" | BB | R(a) = R(a)+mrb_int(b) |
97
+ | OP_SUB' | B | R(a) = R(a)-R(a+1) |
98
+ | OP_SUBI" | BB | R(a) = R(a)-mrb_int(b) |
99
+ | OP_MUL' | B | R(a) = R(a)*R(a+1) |
100
+ | OP_DIV' | B | R(a) = R(a)/R(a+1) |
101
+ | OP_EQ' | B | R(a) = R(a)==R(a+1) |
102
+ | OP_LT' | B | R(a) = R(a)<R(a+1) |
103
+ | OP_LE' | B | R(a) = R(a)<=R(a+1) |
104
+ | OP_GT' | B | R(a) = R(a)>R(a+1) |
105
+ | OP_GE' | B | R(a) = R(a)>=R(a+1) |
106
+ | OP_ARRAY" | BB | R(a) = ary_new(R(a),R(a+1)..R(a+b)) |
107
+ | OP_ARRAY2" | BBB | R(a) = ary_new(R(b),R(b+1)..R(b+c)) |
108
+ | OP_ARYCAT' | B | ary_cat(R(a),R(a+1)) |
109
+ | OP_ARYPUSH' | B | ary_push(R(a),R(a+1)) |
110
+ | OP_ARYDUP' | B | R(a) = ary_dup(R(a)) |
111
+ | OP_AREF" | BBB | R(a) = R(b)[c] |
112
+ | OP_ASET" | BBB | R(a)[c] = R(b) |
113
+ | OP_APOST" | BBB | *R(a),R(a+1)..R(a+c) = R(a)[b..] |
114
+ | OP_INTERN' | B | R(a) = intern(R(a)) |
115
+ | OP_STRING" | BB | R(a) = str_dup(Lit(b)) |
116
+ | OP_STRCAT' | B | str_cat(R(a),R(a+1)) |
117
+ | OP_HASH" | BB | R(a) = hash_new(R(a),R(a+1)..R(a+b)) |
118
+ | OP_HASHADD" | BB | R(a) = hash_push(R(a),R(a+1)..R(a+b)) |
119
+ | OP_HASHCAT' | B | R(a) = hash_cat(R(a),R(a+1)) |
120
+ | OP_LAMBDA" | BB | R(a) = lambda(SEQ[b],OP_L_LAMBDA) |
121
+ | OP_BLOCK" | BB | R(a) = lambda(SEQ[b],OP_L_BLOCK) |
122
+ | OP_METHOD" | BB | R(a) = lambda(SEQ[b],OP_L_METHOD) |
123
+ | OP_RANGE_INC' | B | R(a) = range_new(R(a),R(a+1),FALSE) |
124
+ | OP_RANGE_EXC' | B | R(a) = range_new(R(a),R(a+1),TRUE) |
125
+ | OP_OCLASS' | B | R(a) = ::Object |
126
+ | OP_CLASS" | BB | R(a) = newclass(R(a),Syms(b),R(a+1)) |
127
+ | OP_MODULE" | BB | R(a) = newmodule(R(a),Syms(b)) |
128
+ | OP_EXEC" | BB | R(a) = blockexec(R(a),SEQ[b]) |
129
+ | OP_DEF" | BB | R(a).newmethod(Syms(b),R(a+1)) |
130
+ | OP_ALIAS" | BB | alias_method(target_class,Syms(a),Syms(b)) |
131
+ | OP_UNDEF' | B | undef_method(target_class,Syms(a)) |
132
+ | OP_SCLASS' | B | R(a) = R(a).singleton_class |
133
+ | OP_TCLASS' | B | R(a) = target_class |
134
+ | OP_DEBUG" | BBB | print a,b,c |
135
+ | OP_ERR' | B | raise(LocalJumpError, Lit(a)) |
136
+ | OP_EXT1 | - | make 1st operand 16bit |
137
+ | OP_EXT2 | - | make 2nd operand 16bit |
138
+ | OP_EXT3 | - | make 1st and 2nd operands 16bit |
139
+ | OP_STOP | - | stop VM |
140
+ |------------------|--------------|--------------------------------------------------------|