ruby-internal 0.7.3 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. data/bin/ruby-internal-node-dump +1 -1
  2. data/bin/ruby-internal-obfuscate +1 -1
  3. data/ext/cached/ruby-1.8.4/internal/method/{method.h → internal_method.h} +12 -0
  4. data/ext/cached/ruby-1.8.4/internal/module/getcfp.h +13 -0
  5. data/ext/cached/ruby-1.8.4/internal/node/global_entry.h +94 -0
  6. data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +41 -41
  7. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +288 -273
  8. data/ext/cached/ruby-1.8.4/internal/vm/instruction/insns_info.c +3 -0
  9. data/ext/cached/ruby-1.8.4/internal/vm/iseq/iseq_load.inc +21 -2
  10. data/ext/cached/{ruby-1.8.3/internal/method/method.h → ruby-1.8.5/internal/method/internal_method.h} +12 -0
  11. data/ext/cached/ruby-1.8.5/internal/module/getcfp.h +13 -0
  12. data/ext/cached/ruby-1.8.5/internal/node/global_entry.h +94 -0
  13. data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +45 -45
  14. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +310 -295
  15. data/ext/cached/ruby-1.8.5/internal/vm/instruction/insns_info.c +3 -0
  16. data/ext/cached/ruby-1.8.5/internal/vm/iseq/iseq_load.inc +21 -2
  17. data/ext/cached/{ruby-1.8.5/internal/method/method.h → ruby-1.8.6/internal/method/internal_method.h} +12 -0
  18. data/ext/cached/ruby-1.8.6/internal/module/getcfp.h +13 -0
  19. data/ext/cached/ruby-1.8.6/internal/node/global_entry.h +94 -0
  20. data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +48 -48
  21. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +323 -308
  22. data/ext/cached/ruby-1.8.6/internal/vm/instruction/insns_info.c +3 -0
  23. data/ext/cached/ruby-1.8.6/internal/vm/iseq/iseq_load.inc +21 -2
  24. data/ext/cached/{ruby-1.8.6/internal/method/method.h → ruby-1.8.7/internal/method/internal_method.h} +12 -0
  25. data/ext/cached/ruby-1.8.7/internal/module/getcfp.h +13 -0
  26. data/ext/cached/ruby-1.8.7/internal/node/global_entry.h +98 -0
  27. data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +42 -42
  28. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +276 -261
  29. data/ext/cached/ruby-1.8.7/internal/vm/instruction/insns_info.c +3 -0
  30. data/ext/cached/ruby-1.8.7/internal/vm/iseq/iseq_load.inc +21 -2
  31. data/ext/cached/{ruby-1.9.0/internal/method/method.h → ruby-1.9.1/internal/method/internal_method.h} +12 -0
  32. data/ext/cached/ruby-1.9.1/internal/module/classpath.c +12 -14
  33. data/ext/cached/ruby-1.9.1/internal/module/getcfp.h +25 -0
  34. data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +86 -0
  35. data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +46 -48
  36. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +311 -412
  37. data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.c +3 -0
  38. data/ext/cached/ruby-1.9.1/internal/vm/iseq/iseq_load.inc +28 -6
  39. data/ext/cached/ruby-1.9.1/internal/yarv-headers/iseq.h +1 -0
  40. data/ext/cached/ruby-1.9.1/internal/yarv-headers/parse.h +6 -6
  41. data/ext/cached/ruby-1.9.1/internal/yarv-headers/revision.h +1 -1
  42. data/ext/cached/ruby-1.9.1/internal/yarv-headers/version.h +6 -5
  43. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_core.h +3 -2
  44. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_insnhelper.h +1 -0
  45. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/binding/block.h +0 -0
  46. data/ext/cached/{ruby-1.9.1/internal/method/method.h → ruby-1.9.2/internal/method/internal_method.h} +16 -5
  47. data/ext/cached/ruby-1.9.2/internal/module/classpath.c +40 -0
  48. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/module/classpath.h +0 -0
  49. data/ext/cached/ruby-1.9.2/internal/module/getcfp.h +25 -0
  50. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/block.h +0 -0
  51. data/ext/cached/ruby-1.9.2/internal/node/global_entry.h +93 -0
  52. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/node_type_descrip.c +44 -48
  53. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.c +291 -439
  54. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/node/nodeinfo.h +0 -0
  55. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/proc/block.h +0 -0
  56. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/tag/tag.h +0 -0
  57. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.c +141 -64
  58. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/instruction/insns_info.h +88 -80
  59. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/vm/iseq/insns_info.inc +77 -70
  60. data/ext/cached/ruby-1.9.2/internal/vm/iseq/iseq_load.inc +426 -0
  61. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/debug.h +1 -1
  62. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/dln.h +3 -3
  63. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/encdb.h +18 -2
  64. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/eval_intern.h +39 -28
  65. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/gc.h +7 -5
  66. data/ext/cached/ruby-1.9.2/internal/yarv-headers/id.h +170 -0
  67. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/iseq.h +20 -10
  68. data/ext/cached/ruby-1.9.2/internal/yarv-headers/method.h +103 -0
  69. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/node.h +14 -47
  70. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/parse.h +31 -148
  71. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regenc.h +7 -3
  72. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regint.h +16 -17
  73. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/regparse.h +4 -1
  74. data/ext/cached/ruby-1.9.2/internal/yarv-headers/revision.h +1 -0
  75. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_pthread.h +4 -1
  76. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/thread_win32.h +1 -1
  77. data/ext/cached/ruby-1.9.2/internal/yarv-headers/timev.h +21 -0
  78. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/transcode_data.h +20 -10
  79. data/ext/cached/ruby-1.9.2/internal/yarv-headers/transdb.h +179 -0
  80. data/ext/cached/ruby-1.9.2/internal/yarv-headers/version.h +55 -0
  81. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_core.h +127 -84
  82. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_exec.h +4 -7
  83. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_insnhelper.h +53 -36
  84. data/ext/cached/{ruby-1.9.0 → ruby-1.9.2}/internal/yarv-headers/vm_opts.h +1 -1
  85. data/ext/cached/ruby-1.9.3/internal/binding/block.h +12 -0
  86. data/ext/cached/ruby-1.9.3/internal/method/internal_method.h +32 -0
  87. data/ext/cached/ruby-1.9.3/internal/module/classpath.c +40 -0
  88. data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/module/classpath.h +5 -2
  89. data/ext/cached/ruby-1.9.3/internal/module/getcfp.h +25 -0
  90. data/ext/cached/ruby-1.9.3/internal/node/block.h +12 -0
  91. data/ext/cached/ruby-1.9.3/internal/node/global_entry.h +93 -0
  92. data/ext/cached/{ruby-1.8.3 → ruby-1.9.3}/internal/node/node_type_descrip.c +48 -57
  93. data/ext/cached/{ruby-1.6.8 → ruby-1.9.3}/internal/node/nodeinfo.c +589 -740
  94. data/ext/cached/{ruby-1.8.0 → ruby-1.9.3}/internal/node/nodeinfo.h +4 -3
  95. data/ext/cached/ruby-1.9.3/internal/proc/block.h +12 -0
  96. data/ext/cached/ruby-1.9.3/internal/tag/tag.h +6 -0
  97. data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.c +6013 -0
  98. data/ext/cached/ruby-1.9.3/internal/vm/instruction/insns_info.h +899 -0
  99. data/ext/cached/ruby-1.9.3/internal/vm/iseq/insns_info.inc +707 -0
  100. data/ext/cached/ruby-1.9.3/internal/vm/iseq/iseq_load.inc +423 -0
  101. data/ext/cached/ruby-1.9.3/internal/yarv-headers/addr2line.h +21 -0
  102. data/ext/cached/ruby-1.9.3/internal/yarv-headers/atomic.h +56 -0
  103. data/ext/cached/ruby-1.9.3/internal/yarv-headers/constant.h +34 -0
  104. data/ext/cached/ruby-1.9.3/internal/yarv-headers/debug.h +41 -0
  105. data/ext/cached/ruby-1.9.3/internal/yarv-headers/dln.h +50 -0
  106. data/ext/cached/ruby-1.9.3/internal/yarv-headers/encdb.h +167 -0
  107. data/ext/cached/ruby-1.9.3/internal/yarv-headers/eval_intern.h +234 -0
  108. data/ext/cached/ruby-1.9.3/internal/yarv-headers/gc.h +98 -0
  109. data/ext/cached/ruby-1.9.3/internal/yarv-headers/id.h +175 -0
  110. data/ext/cached/ruby-1.9.3/internal/yarv-headers/internal.h +232 -0
  111. data/ext/cached/ruby-1.9.3/internal/yarv-headers/iseq.h +125 -0
  112. data/ext/cached/ruby-1.9.3/internal/yarv-headers/method.h +105 -0
  113. data/ext/cached/ruby-1.9.3/internal/yarv-headers/node.h +503 -0
  114. data/ext/cached/ruby-1.9.3/internal/yarv-headers/parse.h +186 -0
  115. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regenc.h +219 -0
  116. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regint.h +850 -0
  117. data/ext/cached/ruby-1.9.3/internal/yarv-headers/regparse.h +362 -0
  118. data/ext/cached/ruby-1.9.3/internal/yarv-headers/revision.h +1 -0
  119. data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_pthread.h +51 -0
  120. data/ext/cached/ruby-1.9.3/internal/yarv-headers/thread_win32.h +40 -0
  121. data/ext/cached/ruby-1.9.3/internal/yarv-headers/timev.h +21 -0
  122. data/ext/cached/ruby-1.9.3/internal/yarv-headers/transcode_data.h +117 -0
  123. data/ext/cached/ruby-1.9.3/internal/yarv-headers/transdb.h +189 -0
  124. data/ext/cached/ruby-1.9.3/internal/yarv-headers/version.h +52 -0
  125. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_core.h +756 -0
  126. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_exec.h +184 -0
  127. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_insnhelper.h +220 -0
  128. data/ext/cached/ruby-1.9.3/internal/yarv-headers/vm_opts.h +51 -0
  129. data/ext/internal/binding/block.h +20 -0
  130. data/ext/internal/method/internal_method.h +5 -38
  131. data/ext/internal/method/internal_method.h.rpp +0 -7
  132. data/ext/internal/method/method.c +52 -32
  133. data/ext/internal/module/classpath.c +18 -13
  134. data/ext/internal/module/classpath.h +3 -3
  135. data/ext/internal/module/extconf.rb +3 -2
  136. data/ext/internal/module/getcfp.h +13 -0
  137. data/ext/internal/module/getcfp.h.rpp +44 -0
  138. data/ext/internal/module/module.c +58 -21
  139. data/ext/internal/node/block.h +20 -0
  140. data/ext/internal/node/extconf.rb +2 -0
  141. data/ext/internal/node/global_entry.h +69 -13
  142. data/ext/internal/node/global_entry.h.rpp +11 -2
  143. data/ext/internal/node/node.c +30 -3
  144. data/ext/internal/node/node_type_descrip.c +47 -38
  145. data/ext/internal/node/nodeinfo.c +622 -306
  146. data/ext/internal/node/nodeinfo.h +1 -4
  147. data/ext/internal/proc/block.h +20 -0
  148. data/ext/internal/tag/tag.h +10 -0
  149. data/ext/internal/thread/thread.c +9 -3
  150. data/ext/internal/vm/extconf.rb +1 -0
  151. data/ext/internal/vm/instruction/insns_info.c +3 -5974
  152. data/ext/internal/vm/instruction/insns_info.h +0 -878
  153. data/ext/internal/vm/iseq/extconf.rb +1 -0
  154. data/ext/internal/vm/iseq/iseq.c +38 -4
  155. data/ext/internal/vm/iseq/iseq_load.inc.rpp +23 -5
  156. data/ext/internal/vm/vm.c +28 -0
  157. data/lib/internal/classtree.rb +28 -0
  158. data/lib/internal/debug.rb +10 -2
  159. data/lib/internal/method/as_code.rb +25 -0
  160. data/lib/internal/method/as_expression.rb +2 -3
  161. data/lib/internal/method/origin.rb +29 -0
  162. data/lib/internal/method/signature.rb +5 -300
  163. data/lib/internal/method/signature/argument.rb +102 -0
  164. data/lib/internal/method/signature/iseq.rb +52 -0
  165. data/lib/internal/method/signature/node.rb +160 -0
  166. data/lib/internal/method/signature/signature.rb +23 -0
  167. data/lib/internal/proc/as_code.rb +2 -0
  168. data/lib/internal/proc/as_expression.rb +2 -0
  169. data/lib/internal/vm/bytedecoder.rb +5 -5
  170. data/lib/internal/vm/iseq/as_code.rb +2 -2
  171. data/lib/internal/vm/iseq/as_expression.rb +2 -2
  172. data/test/test_dump_method.rb +1 -1
  173. data/test/test_method.rb +21 -3
  174. data/test/test_node.rb +20 -4
  175. metadata +152 -155
  176. data/ext/cached/ruby-1.6.8/internal/binding/block.h +0 -35
  177. data/ext/cached/ruby-1.6.8/internal/method/method.h +0 -19
  178. data/ext/cached/ruby-1.6.8/internal/module/classpath.c +0 -3
  179. data/ext/cached/ruby-1.6.8/internal/module/classpath.h +0 -8
  180. data/ext/cached/ruby-1.6.8/internal/node/block.h +0 -35
  181. data/ext/cached/ruby-1.6.8/internal/node/global_entry.h +0 -15
  182. data/ext/cached/ruby-1.6.8/internal/node/node_type_descrip.c +0 -149
  183. data/ext/cached/ruby-1.6.8/internal/node/nodeinfo.h +0 -69
  184. data/ext/cached/ruby-1.6.8/internal/proc/block.h +0 -35
  185. data/ext/cached/ruby-1.6.8/internal/tag/tag.h +0 -15
  186. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.c +0 -39
  187. data/ext/cached/ruby-1.6.8/internal/vm/instruction/insns_info.h +0 -21
  188. data/ext/cached/ruby-1.6.8/internal/vm/iseq/insns_info.inc +0 -12
  189. data/ext/cached/ruby-1.6.8/internal/vm/iseq/iseq_load.inc +0 -9
  190. data/ext/cached/ruby-1.8.0/internal/binding/block.h +0 -37
  191. data/ext/cached/ruby-1.8.0/internal/method/method.h +0 -19
  192. data/ext/cached/ruby-1.8.0/internal/module/classpath.c +0 -27
  193. data/ext/cached/ruby-1.8.0/internal/node/block.h +0 -37
  194. data/ext/cached/ruby-1.8.0/internal/node/global_entry.h +0 -10
  195. data/ext/cached/ruby-1.8.0/internal/node/node_type_descrip.c +0 -155
  196. data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.c +0 -5744
  197. data/ext/cached/ruby-1.8.0/internal/proc/block.h +0 -37
  198. data/ext/cached/ruby-1.8.0/internal/tag/tag.h +0 -15
  199. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.c +0 -39
  200. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.h +0 -21
  201. data/ext/cached/ruby-1.8.0/internal/vm/iseq/insns_info.inc +0 -12
  202. data/ext/cached/ruby-1.8.0/internal/vm/iseq/iseq_load.inc +0 -9
  203. data/ext/cached/ruby-1.8.1/internal/binding/block.h +0 -31
  204. data/ext/cached/ruby-1.8.1/internal/method/method.h +0 -19
  205. data/ext/cached/ruby-1.8.1/internal/module/classpath.c +0 -27
  206. data/ext/cached/ruby-1.8.1/internal/module/classpath.h +0 -14
  207. data/ext/cached/ruby-1.8.1/internal/node/block.h +0 -31
  208. data/ext/cached/ruby-1.8.1/internal/node/global_entry.h +0 -10
  209. data/ext/cached/ruby-1.8.1/internal/node/node_type_descrip.c +0 -154
  210. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.c +0 -5736
  211. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.h +0 -69
  212. data/ext/cached/ruby-1.8.1/internal/proc/block.h +0 -31
  213. data/ext/cached/ruby-1.8.1/internal/tag/tag.h +0 -16
  214. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.c +0 -39
  215. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.h +0 -21
  216. data/ext/cached/ruby-1.8.1/internal/vm/iseq/insns_info.inc +0 -12
  217. data/ext/cached/ruby-1.8.1/internal/vm/iseq/iseq_load.inc +0 -9
  218. data/ext/cached/ruby-1.8.2/internal/binding/block.h +0 -32
  219. data/ext/cached/ruby-1.8.2/internal/method/method.h +0 -19
  220. data/ext/cached/ruby-1.8.2/internal/module/classpath.c +0 -45
  221. data/ext/cached/ruby-1.8.2/internal/module/classpath.h +0 -17
  222. data/ext/cached/ruby-1.8.2/internal/node/block.h +0 -32
  223. data/ext/cached/ruby-1.8.2/internal/node/global_entry.h +0 -10
  224. data/ext/cached/ruby-1.8.2/internal/node/node_type_descrip.c +0 -154
  225. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.c +0 -5736
  226. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.h +0 -69
  227. data/ext/cached/ruby-1.8.2/internal/proc/block.h +0 -32
  228. data/ext/cached/ruby-1.8.2/internal/tag/tag.h +0 -16
  229. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.c +0 -39
  230. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.h +0 -21
  231. data/ext/cached/ruby-1.8.2/internal/vm/iseq/insns_info.inc +0 -12
  232. data/ext/cached/ruby-1.8.2/internal/vm/iseq/iseq_load.inc +0 -9
  233. data/ext/cached/ruby-1.8.3/internal/binding/block.h +0 -32
  234. data/ext/cached/ruby-1.8.3/internal/module/classpath.c +0 -45
  235. data/ext/cached/ruby-1.8.3/internal/module/classpath.h +0 -17
  236. data/ext/cached/ruby-1.8.3/internal/node/block.h +0 -32
  237. data/ext/cached/ruby-1.8.3/internal/node/global_entry.h +0 -10
  238. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.c +0 -5736
  239. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.h +0 -69
  240. data/ext/cached/ruby-1.8.3/internal/proc/block.h +0 -32
  241. data/ext/cached/ruby-1.8.3/internal/tag/tag.h +0 -16
  242. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.c +0 -39
  243. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.h +0 -21
  244. data/ext/cached/ruby-1.8.3/internal/vm/iseq/insns_info.inc +0 -12
  245. data/ext/cached/ruby-1.8.3/internal/vm/iseq/iseq_load.inc +0 -9
  246. data/ext/cached/ruby-1.8.7/internal/method/method.h +0 -20
  247. data/ext/cached/ruby-1.9.0/internal/module/classpath.c +0 -42
  248. data/ext/cached/ruby-1.9.0/internal/node/global_entry.h +0 -10
  249. data/ext/cached/ruby-1.9.0/internal/vm/iseq/iseq_load.inc +0 -13
  250. data/ext/cached/ruby-1.9.0/internal/yarv-headers/id.h +0 -83
  251. data/ext/cached/ruby-1.9.0/internal/yarv-headers/revision.h +0 -1
  252. data/ext/cached/ruby-1.9.0/internal/yarv-headers/transdb.h +0 -67
  253. data/ext/cached/ruby-1.9.0/internal/yarv-headers/version.h +0 -57
  254. data/ext/internal/module/cfp.h +0 -13
@@ -11,884 +11,6 @@
11
11
  #include "vm.h"
12
12
  #endif
13
13
 
14
- /** -*-c-*-
15
- This file contains YARV instructions list.
16
-
17
- ----
18
- This file is auto generated by insns2vm.rb
19
- DO NOT TOUCH!
20
-
21
- If you want to fix something, you must edit 'template/insns.inc.tmpl'
22
- or insns2vm.rb
23
- */
24
-
25
-
26
- /* BIN : Basic Instruction Name */
27
- #define BIN(n) YARVINSN_##n
28
-
29
- enum ruby_vminsn_type {
30
- BIN(nop) = 0,
31
-
32
- BIN(getlocal) = 1,
33
-
34
- BIN(setlocal) = 2,
35
-
36
- BIN(getspecial) = 3,
37
-
38
- BIN(setspecial) = 4,
39
-
40
- BIN(getdynamic) = 5,
41
-
42
- BIN(setdynamic) = 6,
43
-
44
- BIN(getinstancevariable) = 7,
45
-
46
- BIN(setinstancevariable) = 8,
47
-
48
- BIN(getclassvariable) = 9,
49
-
50
- BIN(setclassvariable) = 10,
51
-
52
- BIN(getconstant) = 11,
53
-
54
- BIN(setconstant) = 12,
55
-
56
- BIN(getglobal) = 13,
57
-
58
- BIN(setglobal) = 14,
59
-
60
- BIN(putnil) = 15,
61
-
62
- BIN(putself) = 16,
63
-
64
- BIN(putobject) = 17,
65
-
66
- BIN(putspecialobject) = 18,
67
-
68
- BIN(putiseq) = 19,
69
-
70
- BIN(putstring) = 20,
71
-
72
- BIN(concatstrings) = 21,
73
-
74
- BIN(tostring) = 22,
75
-
76
- BIN(toregexp) = 23,
77
-
78
- BIN(newarray) = 24,
79
-
80
- BIN(duparray) = 25,
81
-
82
- BIN(expandarray) = 26,
83
-
84
- BIN(concatarray) = 27,
85
-
86
- BIN(splatarray) = 28,
87
-
88
- BIN(checkincludearray) = 29,
89
-
90
- BIN(newhash) = 30,
91
-
92
- BIN(newrange) = 31,
93
-
94
- BIN(pop) = 32,
95
-
96
- BIN(dup) = 33,
97
-
98
- BIN(dupn) = 34,
99
-
100
- BIN(swap) = 35,
101
-
102
- BIN(reput) = 36,
103
-
104
- BIN(topn) = 37,
105
-
106
- BIN(setn) = 38,
107
-
108
- BIN(adjuststack) = 39,
109
-
110
- BIN(defined) = 40,
111
-
112
- BIN(trace) = 41,
113
-
114
- BIN(defineclass) = 42,
115
-
116
- BIN(send) = 43,
117
-
118
- BIN(invokesuper) = 44,
119
-
120
- BIN(invokeblock) = 45,
121
-
122
- BIN(leave) = 46,
123
-
124
- BIN(finish) = 47,
125
-
126
- BIN(throw) = 48,
127
-
128
- BIN(jump) = 49,
129
-
130
- BIN(branchif) = 50,
131
-
132
- BIN(branchunless) = 51,
133
-
134
- BIN(getinlinecache) = 52,
135
-
136
- BIN(onceinlinecache) = 53,
137
-
138
- BIN(setinlinecache) = 54,
139
-
140
- BIN(opt_case_dispatch) = 55,
141
-
142
- BIN(opt_checkenv) = 56,
143
-
144
- BIN(opt_plus) = 57,
145
-
146
- BIN(opt_minus) = 58,
147
-
148
- BIN(opt_mult) = 59,
149
-
150
- BIN(opt_div) = 60,
151
-
152
- BIN(opt_mod) = 61,
153
-
154
- BIN(opt_eq) = 62,
155
-
156
- BIN(opt_neq) = 63,
157
-
158
- BIN(opt_lt) = 64,
159
-
160
- BIN(opt_le) = 65,
161
-
162
- BIN(opt_gt) = 66,
163
-
164
- BIN(opt_ge) = 67,
165
-
166
- BIN(opt_ltlt) = 68,
167
-
168
- BIN(opt_aref) = 69,
169
-
170
- BIN(opt_aset) = 70,
171
-
172
- BIN(opt_length) = 71,
173
-
174
- BIN(opt_size) = 72,
175
-
176
- BIN(opt_succ) = 73,
177
-
178
- BIN(opt_not) = 74,
179
-
180
- BIN(opt_regexpmatch1) = 75,
181
-
182
- BIN(opt_regexpmatch2) = 76,
183
-
184
- BIN(opt_call_c_function) = 77,
185
-
186
- BIN(bitblt) = 78,
187
-
188
- BIN(answer) = 79,
189
-
190
- VM_INSTRUCTION_SIZE = 80
191
- };
192
-
193
- /** -*-c-*-
194
- This file contains instruction information for yarv instruction sequence.
195
-
196
- ----
197
- This file is auto generated by insns2vm.rb
198
- DO NOT TOUCH!
199
-
200
- If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
201
- or insns2vm.rb
202
- */
203
-
204
- #define TS_OFFSET 'O'
205
- #define TS_NUM 'N'
206
- #define TS_LINDEX 'L'
207
- #define TS_DINDEX 'D'
208
- #define TS_VALUE 'V'
209
- #define TS_ID 'I'
210
- #define TS_GENTRY 'G'
211
- #define TS_IC 'C'
212
- #define TS_CDHASH 'H'
213
- #define TS_ISEQ 'S'
214
- #define TS_VARIABLE '.'
215
- #define TS_FUNCPTR 'F'
216
-
217
- static const char *const insn_name_info[] = {
218
- "nop",
219
- "getlocal",
220
- "setlocal",
221
- "getspecial",
222
- "setspecial",
223
- "getdynamic",
224
- "setdynamic",
225
- "getinstancevariable",
226
- "setinstancevariable",
227
- "getclassvariable",
228
- "setclassvariable",
229
- "getconstant",
230
- "setconstant",
231
- "getglobal",
232
- "setglobal",
233
- "putnil",
234
- "putself",
235
- "putobject",
236
- "putspecialobject",
237
- "putiseq",
238
- "putstring",
239
- "concatstrings",
240
- "tostring",
241
- "toregexp",
242
- "newarray",
243
- "duparray",
244
- "expandarray",
245
- "concatarray",
246
- "splatarray",
247
- "checkincludearray",
248
- "newhash",
249
- "newrange",
250
- "pop",
251
- "dup",
252
- "dupn",
253
- "swap",
254
- "reput",
255
- "topn",
256
- "setn",
257
- "adjuststack",
258
- "defined",
259
- "trace",
260
- "defineclass",
261
- "send",
262
- "invokesuper",
263
- "invokeblock",
264
- "leave",
265
- "finish",
266
- "throw",
267
- "jump",
268
- "branchif",
269
- "branchunless",
270
- "getinlinecache",
271
- "onceinlinecache",
272
- "setinlinecache",
273
- "opt_case_dispatch",
274
- "opt_checkenv",
275
- "opt_plus",
276
- "opt_minus",
277
- "opt_mult",
278
- "opt_div",
279
- "opt_mod",
280
- "opt_eq",
281
- "opt_neq",
282
- "opt_lt",
283
- "opt_le",
284
- "opt_gt",
285
- "opt_ge",
286
- "opt_ltlt",
287
- "opt_aref",
288
- "opt_aset",
289
- "opt_length",
290
- "opt_size",
291
- "opt_succ",
292
- "opt_not",
293
- "opt_regexpmatch1",
294
- "opt_regexpmatch2",
295
- "opt_call_c_function",
296
- "bitblt",
297
- "answer",
298
-
299
- };
300
-
301
- static const char *const insn_operand_info[] = {
302
- "",
303
- "L",
304
- "L",
305
- "VN",
306
- "V",
307
- "DN",
308
- "DN",
309
- "IC",
310
- "IC",
311
- "I",
312
- "I",
313
- "I",
314
- "I",
315
- "G",
316
- "G",
317
- "",
318
- "",
319
- "V",
320
- "N",
321
- "S",
322
- "V",
323
- "N",
324
- "",
325
- "NN",
326
- "N",
327
- "V",
328
- "NN",
329
- "",
330
- "V",
331
- "V",
332
- "N",
333
- "N",
334
- "",
335
- "",
336
- "N",
337
- "",
338
- "",
339
- "N",
340
- "N",
341
- "N",
342
- "NVV",
343
- "N",
344
- "ISN",
345
- "INSNC",
346
- "NSN",
347
- "NN",
348
- "",
349
- "",
350
- "N",
351
- "O",
352
- "O",
353
- "O",
354
- "OC",
355
- "OC",
356
- "C",
357
- "HO",
358
- "",
359
- "C",
360
- "C",
361
- "C",
362
- "C",
363
- "C",
364
- "C",
365
- "CC",
366
- "C",
367
- "C",
368
- "C",
369
- "C",
370
- "C",
371
- "C",
372
- "C",
373
- "C",
374
- "C",
375
- "C",
376
- "C",
377
- "V",
378
- "",
379
- "F",
380
- "",
381
- "",
382
-
383
- };
384
-
385
- static const int insn_len_info[] = {
386
- 1,
387
- 2,
388
- 2,
389
- 3,
390
- 2,
391
- 3,
392
- 3,
393
- 3,
394
- 3,
395
- 2,
396
- 2,
397
- 2,
398
- 2,
399
- 2,
400
- 2,
401
- 1,
402
- 1,
403
- 2,
404
- 2,
405
- 2,
406
- 2,
407
- 2,
408
- 1,
409
- 3,
410
- 2,
411
- 2,
412
- 3,
413
- 1,
414
- 2,
415
- 2,
416
- 2,
417
- 2,
418
- 1,
419
- 1,
420
- 2,
421
- 1,
422
- 1,
423
- 2,
424
- 2,
425
- 2,
426
- 4,
427
- 2,
428
- 4,
429
- 6,
430
- 4,
431
- 3,
432
- 1,
433
- 1,
434
- 2,
435
- 2,
436
- 2,
437
- 2,
438
- 3,
439
- 3,
440
- 2,
441
- 3,
442
- 1,
443
- 2,
444
- 2,
445
- 2,
446
- 2,
447
- 2,
448
- 2,
449
- 3,
450
- 2,
451
- 2,
452
- 2,
453
- 2,
454
- 2,
455
- 2,
456
- 2,
457
- 2,
458
- 2,
459
- 2,
460
- 2,
461
- 2,
462
- 1,
463
- 2,
464
- 1,
465
- 1,
466
-
467
- };
468
-
469
- #ifdef USE_INSN_RET_NUM
470
- static const int insn_stack_push_num_info[] = {
471
- 0,
472
- 1,
473
- 0,
474
- 1,
475
- 0,
476
- 1,
477
- 0,
478
- 1,
479
- 0,
480
- 1,
481
- 0,
482
- 1,
483
- 0,
484
- 1,
485
- 0,
486
- 1,
487
- 1,
488
- 1,
489
- 1,
490
- 1,
491
- 1,
492
- 1,
493
- 1,
494
- 1,
495
- 1,
496
- 1,
497
- 1,
498
- 1,
499
- 1,
500
- 2,
501
- 1,
502
- 1,
503
- 0,
504
- 2,
505
- 1,
506
- 2,
507
- 1,
508
- 1,
509
- 1,
510
- 1,
511
- 1,
512
- 0,
513
- 1,
514
- 1,
515
- 1,
516
- 1,
517
- 1,
518
- 1,
519
- 1,
520
- 0,
521
- 0,
522
- 0,
523
- 1,
524
- 1,
525
- 1,
526
- 0,
527
- 0,
528
- 1,
529
- 1,
530
- 1,
531
- 1,
532
- 1,
533
- 1,
534
- 1,
535
- 1,
536
- 1,
537
- 1,
538
- 1,
539
- 1,
540
- 1,
541
- 1,
542
- 1,
543
- 1,
544
- 1,
545
- 1,
546
- 1,
547
- 1,
548
- 0,
549
- 1,
550
- 1,
551
-
552
- };
553
- #endif
554
-
555
- #ifdef USE_INSN_STACK_INCREASE
556
- static int
557
- insn_stack_increase(int depth, int insn, VALUE *opes)
558
- {
559
- switch(insn){
560
- case BIN(nop):{
561
- return depth + 0;
562
- }
563
- case BIN(getlocal):{
564
- return depth + 1;
565
- }
566
- case BIN(setlocal):{
567
- return depth + -1;
568
- }
569
- case BIN(getspecial):{
570
- return depth + 1;
571
- }
572
- case BIN(setspecial):{
573
- return depth + -1;
574
- }
575
- case BIN(getdynamic):{
576
- return depth + 1;
577
- }
578
- case BIN(setdynamic):{
579
- return depth + -1;
580
- }
581
- case BIN(getinstancevariable):{
582
- return depth + 1;
583
- }
584
- case BIN(setinstancevariable):{
585
- return depth + -1;
586
- }
587
- case BIN(getclassvariable):{
588
- return depth + 1;
589
- }
590
- case BIN(setclassvariable):{
591
- return depth + -1;
592
- }
593
- case BIN(getconstant):{
594
- return depth + 0;
595
- }
596
- case BIN(setconstant):{
597
- return depth + -2;
598
- }
599
- case BIN(getglobal):{
600
- return depth + 1;
601
- }
602
- case BIN(setglobal):{
603
- return depth + -1;
604
- }
605
- case BIN(putnil):{
606
- return depth + 1;
607
- }
608
- case BIN(putself):{
609
- return depth + 1;
610
- }
611
- case BIN(putobject):{
612
- return depth + 1;
613
- }
614
- case BIN(putspecialobject):{
615
- return depth + 1;
616
- }
617
- case BIN(putiseq):{
618
- return depth + 1;
619
- }
620
- case BIN(putstring):{
621
- return depth + 1;
622
- }
623
- case BIN(concatstrings):{
624
- int inc = 0;
625
- int num = FIX2INT(opes[0]);
626
- inc += 1 - num;;
627
- return depth + inc;
628
- }
629
- case BIN(tostring):{
630
- return depth + 0;
631
- }
632
- case BIN(toregexp):{
633
- int inc = 0;
634
- int cnt = FIX2INT(opes[1]);
635
- inc += 1 - cnt;;
636
- return depth + inc;
637
- }
638
- case BIN(newarray):{
639
- int inc = 0;
640
- int num = FIX2INT(opes[0]);
641
- inc += 1 - num;;
642
- return depth + inc;
643
- }
644
- case BIN(duparray):{
645
- return depth + 1;
646
- }
647
- case BIN(expandarray):{
648
- int inc = 0;
649
- int num = FIX2INT(opes[0]);
650
- int flag = FIX2INT(opes[1]);
651
- inc += num - 1 + (flag & 1 ? 1 : 0);;
652
- return depth + inc;
653
- }
654
- case BIN(concatarray):{
655
- return depth + -1;
656
- }
657
- case BIN(splatarray):{
658
- return depth + 0;
659
- }
660
- case BIN(checkincludearray):{
661
- return depth + 0;
662
- }
663
- case BIN(newhash):{
664
- int inc = 0;
665
- int num = FIX2INT(opes[0]);
666
- inc += 1 - num;;
667
- return depth + inc;
668
- }
669
- case BIN(newrange):{
670
- return depth + -1;
671
- }
672
- case BIN(pop):{
673
- return depth + -1;
674
- }
675
- case BIN(dup):{
676
- return depth + 1;
677
- }
678
- case BIN(dupn):{
679
- int inc = 0;
680
- int n = FIX2INT(opes[0]);
681
- inc += n;;
682
- return depth + inc;
683
- }
684
- case BIN(swap):{
685
- return depth + 0;
686
- }
687
- case BIN(reput):{
688
- int inc = 0;
689
- inc += 0;;
690
- return depth + inc;
691
- }
692
- case BIN(topn):{
693
- int inc = 0;
694
- inc += 1;;
695
- return depth + inc;
696
- }
697
- case BIN(setn):{
698
- int inc = 0;
699
- inc += 0;
700
- return depth + inc;
701
- }
702
- case BIN(adjuststack):{
703
- int inc = 0;
704
- int n = FIX2INT(opes[0]);
705
- inc -= n;
706
- return depth + inc;
707
- }
708
- case BIN(defined):{
709
- return depth + 0;
710
- }
711
- case BIN(trace):{
712
- return depth + 0;
713
- }
714
- case BIN(defineclass):{
715
- return depth + -1;
716
- }
717
- case BIN(send):{
718
- int inc = 0;
719
- int op_argc = FIX2INT(opes[1]);
720
- int op_flag = FIX2INT(opes[3]);
721
- inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
722
- return depth + inc;
723
- }
724
- case BIN(invokesuper):{
725
- int inc = 0;
726
- int op_argc = FIX2INT(opes[0]);
727
- int op_flag = FIX2INT(opes[2]);
728
- inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
729
- return depth + inc;
730
- }
731
- case BIN(invokeblock):{
732
- int inc = 0;
733
- int num = FIX2INT(opes[0]);
734
- inc += 1 - num;;
735
- return depth + inc;
736
- }
737
- case BIN(leave):{
738
- return depth + 0;
739
- }
740
- case BIN(finish):{
741
- return depth + 0;
742
- }
743
- case BIN(throw):{
744
- return depth + 0;
745
- }
746
- case BIN(jump):{
747
- return depth + 0;
748
- }
749
- case BIN(branchif):{
750
- return depth + -1;
751
- }
752
- case BIN(branchunless):{
753
- return depth + -1;
754
- }
755
- case BIN(getinlinecache):{
756
- return depth + 1;
757
- }
758
- case BIN(onceinlinecache):{
759
- return depth + 1;
760
- }
761
- case BIN(setinlinecache):{
762
- return depth + 0;
763
- }
764
- case BIN(opt_case_dispatch):{
765
- int inc = 0;
766
- inc += -1;;
767
- return depth + inc;
768
- }
769
- case BIN(opt_checkenv):{
770
- return depth + 0;
771
- }
772
- case BIN(opt_plus):{
773
- return depth + -1;
774
- }
775
- case BIN(opt_minus):{
776
- return depth + -1;
777
- }
778
- case BIN(opt_mult):{
779
- return depth + -1;
780
- }
781
- case BIN(opt_div):{
782
- return depth + -1;
783
- }
784
- case BIN(opt_mod):{
785
- return depth + -1;
786
- }
787
- case BIN(opt_eq):{
788
- return depth + -1;
789
- }
790
- case BIN(opt_neq):{
791
- return depth + -1;
792
- }
793
- case BIN(opt_lt):{
794
- return depth + -1;
795
- }
796
- case BIN(opt_le):{
797
- return depth + -1;
798
- }
799
- case BIN(opt_gt):{
800
- return depth + -1;
801
- }
802
- case BIN(opt_ge):{
803
- return depth + -1;
804
- }
805
- case BIN(opt_ltlt):{
806
- return depth + -1;
807
- }
808
- case BIN(opt_aref):{
809
- return depth + -1;
810
- }
811
- case BIN(opt_aset):{
812
- return depth + -2;
813
- }
814
- case BIN(opt_length):{
815
- return depth + 0;
816
- }
817
- case BIN(opt_size):{
818
- return depth + 0;
819
- }
820
- case BIN(opt_succ):{
821
- return depth + 0;
822
- }
823
- case BIN(opt_not):{
824
- return depth + 0;
825
- }
826
- case BIN(opt_regexpmatch1):{
827
- return depth + 0;
828
- }
829
- case BIN(opt_regexpmatch2):{
830
- return depth + -1;
831
- }
832
- case BIN(opt_call_c_function):{
833
- return depth + 0;
834
- }
835
- case BIN(bitblt):{
836
- return depth + 1;
837
- }
838
- case BIN(answer):{
839
- return depth + 1;
840
- }
841
-
842
- default:
843
- rb_bug("insn_sp_increase: unreachable");
844
- }
845
- return 0;
846
- }
847
- #endif
848
-
849
- /* some utilities */
850
-
851
- static int
852
- insn_len(VALUE insn)
853
- {
854
- return insn_len_info[(int)insn];
855
- }
856
-
857
- static const char *
858
- insn_name(VALUE insn)
859
- {
860
- return insn_name_info[(int)insn];
861
- }
862
-
863
- static const char *
864
- insn_op_types(VALUE insn)
865
- {
866
- return insn_operand_info[(int)insn];
867
- }
868
-
869
- static int
870
- insn_op_type(VALUE insn, long pos)
871
- {
872
- int len = insn_len(insn) - 1;
873
- if(pos < len){
874
- return insn_operand_info[(int)insn][pos];
875
- }
876
- else{
877
- return 0;
878
- }
879
- }
880
-
881
- #ifdef USE_INSN_RET_NUM
882
- static int
883
- insn_ret_num(VALUE insn)
884
- {
885
- return insn_stack_push_num_info[(int)insn];
886
- }
887
- #endif
888
- void
889
- make_compile_option(rb_compile_option_t *option, VALUE opt);
890
- void
891
- make_compile_option_value(rb_compile_option_t *option);
892
14
 
893
15
  extern VALUE instruction_class[VM_INSTRUCTION_SIZE];
894
16
  void define_instruction_subclasses(VALUE rb_cInstruction);