ruby-internal 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. data/COPYING +59 -0
  2. data/LGPL +515 -0
  3. data/LICENSE +9 -0
  4. data/README +31 -0
  5. data/Rakefile +20 -0
  6. data/TODO +9 -0
  7. data/example/README +5 -0
  8. data/example/simple_client.rb +12 -0
  9. data/example/simple_server.rb +11 -0
  10. data/example/triangle_client.rb +7 -0
  11. data/example/triangle_server.rb +24 -0
  12. data/ext/cached/ruby-1.8.0/internal/binding/block.h +37 -0
  13. data/ext/cached/ruby-1.8.0/internal/method/method.h +19 -0
  14. data/ext/cached/ruby-1.8.0/internal/module/classpath.c +27 -0
  15. data/ext/cached/ruby-1.8.0/internal/module/classpath.h +14 -0
  16. data/ext/cached/ruby-1.8.0/internal/node/block.h +37 -0
  17. data/ext/cached/ruby-1.8.0/internal/node/global_entry.h +10 -0
  18. data/ext/cached/ruby-1.8.0/internal/node/node_type_descrip.c +155 -0
  19. data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.c +5741 -0
  20. data/ext/cached/ruby-1.8.0/internal/node/nodeinfo.h +69 -0
  21. data/ext/cached/ruby-1.8.0/internal/proc/block.h +37 -0
  22. data/ext/cached/ruby-1.8.0/internal/tag/tag.h +15 -0
  23. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.c +39 -0
  24. data/ext/cached/ruby-1.8.0/internal/vm/instruction/insns_info.h +21 -0
  25. data/ext/cached/ruby-1.8.0/internal/vm/iseq/insns_info.inc +12 -0
  26. data/ext/cached/ruby-1.8.1/internal/binding/block.h +31 -0
  27. data/ext/cached/ruby-1.8.1/internal/method/method.h +19 -0
  28. data/ext/cached/ruby-1.8.1/internal/module/classpath.c +27 -0
  29. data/ext/cached/ruby-1.8.1/internal/module/classpath.h +14 -0
  30. data/ext/cached/ruby-1.8.1/internal/node/block.h +31 -0
  31. data/ext/cached/ruby-1.8.1/internal/node/global_entry.h +10 -0
  32. data/ext/cached/ruby-1.8.1/internal/node/node_type_descrip.c +154 -0
  33. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.c +5733 -0
  34. data/ext/cached/ruby-1.8.1/internal/node/nodeinfo.h +69 -0
  35. data/ext/cached/ruby-1.8.1/internal/proc/block.h +31 -0
  36. data/ext/cached/ruby-1.8.1/internal/tag/tag.h +16 -0
  37. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.c +39 -0
  38. data/ext/cached/ruby-1.8.1/internal/vm/instruction/insns_info.h +21 -0
  39. data/ext/cached/ruby-1.8.1/internal/vm/iseq/insns_info.inc +12 -0
  40. data/ext/cached/ruby-1.8.2/internal/binding/block.h +32 -0
  41. data/ext/cached/ruby-1.8.2/internal/method/method.h +19 -0
  42. data/ext/cached/ruby-1.8.2/internal/module/classpath.c +45 -0
  43. data/ext/cached/ruby-1.8.2/internal/module/classpath.h +17 -0
  44. data/ext/cached/ruby-1.8.2/internal/node/block.h +32 -0
  45. data/ext/cached/ruby-1.8.2/internal/node/global_entry.h +10 -0
  46. data/ext/cached/ruby-1.8.2/internal/node/node_type_descrip.c +154 -0
  47. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.c +5733 -0
  48. data/ext/cached/ruby-1.8.2/internal/node/nodeinfo.h +69 -0
  49. data/ext/cached/ruby-1.8.2/internal/proc/block.h +32 -0
  50. data/ext/cached/ruby-1.8.2/internal/tag/tag.h +16 -0
  51. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.c +39 -0
  52. data/ext/cached/ruby-1.8.2/internal/vm/instruction/insns_info.h +21 -0
  53. data/ext/cached/ruby-1.8.2/internal/vm/iseq/insns_info.inc +12 -0
  54. data/ext/cached/ruby-1.8.3/internal/binding/block.h +32 -0
  55. data/ext/cached/ruby-1.8.3/internal/method/method.h +20 -0
  56. data/ext/cached/ruby-1.8.3/internal/module/classpath.c +45 -0
  57. data/ext/cached/ruby-1.8.3/internal/module/classpath.h +17 -0
  58. data/ext/cached/ruby-1.8.3/internal/node/block.h +32 -0
  59. data/ext/cached/ruby-1.8.3/internal/node/global_entry.h +10 -0
  60. data/ext/cached/ruby-1.8.3/internal/node/node_type_descrip.c +154 -0
  61. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.c +5733 -0
  62. data/ext/cached/ruby-1.8.3/internal/node/nodeinfo.h +69 -0
  63. data/ext/cached/ruby-1.8.3/internal/proc/block.h +32 -0
  64. data/ext/cached/ruby-1.8.3/internal/tag/tag.h +16 -0
  65. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.c +39 -0
  66. data/ext/cached/ruby-1.8.3/internal/vm/instruction/insns_info.h +21 -0
  67. data/ext/cached/ruby-1.8.3/internal/vm/iseq/insns_info.inc +12 -0
  68. data/ext/cached/ruby-1.8.4/internal/binding/block.h +32 -0
  69. data/ext/cached/ruby-1.8.4/internal/method/method.h +20 -0
  70. data/ext/cached/ruby-1.8.4/internal/module/classpath.c +45 -0
  71. data/ext/cached/ruby-1.8.4/internal/module/classpath.h +17 -0
  72. data/ext/cached/ruby-1.8.4/internal/node/block.h +32 -0
  73. data/ext/cached/ruby-1.8.4/internal/node/global_entry.h +10 -0
  74. data/ext/cached/ruby-1.8.4/internal/node/node_type_descrip.c +154 -0
  75. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.c +5733 -0
  76. data/ext/cached/ruby-1.8.4/internal/node/nodeinfo.h +69 -0
  77. data/ext/cached/ruby-1.8.4/internal/proc/block.h +32 -0
  78. data/ext/cached/ruby-1.8.4/internal/tag/tag.h +16 -0
  79. data/ext/cached/ruby-1.8.4/internal/vm/instruction/insns_info.c +39 -0
  80. data/ext/cached/ruby-1.8.4/internal/vm/instruction/insns_info.h +21 -0
  81. data/ext/cached/ruby-1.8.4/internal/vm/iseq/insns_info.inc +12 -0
  82. data/ext/cached/ruby-1.8.5/internal/binding/block.h +32 -0
  83. data/ext/cached/ruby-1.8.5/internal/method/method.h +20 -0
  84. data/ext/cached/ruby-1.8.5/internal/module/classpath.c +45 -0
  85. data/ext/cached/ruby-1.8.5/internal/module/classpath.h +17 -0
  86. data/ext/cached/ruby-1.8.5/internal/node/block.h +32 -0
  87. data/ext/cached/ruby-1.8.5/internal/node/global_entry.h +10 -0
  88. data/ext/cached/ruby-1.8.5/internal/node/node_type_descrip.c +154 -0
  89. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.c +5732 -0
  90. data/ext/cached/ruby-1.8.5/internal/node/nodeinfo.h +67 -0
  91. data/ext/cached/ruby-1.8.5/internal/proc/block.h +32 -0
  92. data/ext/cached/ruby-1.8.5/internal/tag/tag.h +16 -0
  93. data/ext/cached/ruby-1.8.5/internal/vm/instruction/insns_info.c +39 -0
  94. data/ext/cached/ruby-1.8.5/internal/vm/instruction/insns_info.h +21 -0
  95. data/ext/cached/ruby-1.8.5/internal/vm/iseq/insns_info.inc +12 -0
  96. data/ext/cached/ruby-1.8.6/internal/binding/block.h +32 -0
  97. data/ext/cached/ruby-1.8.6/internal/method/method.h +20 -0
  98. data/ext/cached/ruby-1.8.6/internal/module/classpath.c +45 -0
  99. data/ext/cached/ruby-1.8.6/internal/module/classpath.h +17 -0
  100. data/ext/cached/ruby-1.8.6/internal/node/block.h +32 -0
  101. data/ext/cached/ruby-1.8.6/internal/node/global_entry.h +10 -0
  102. data/ext/cached/ruby-1.8.6/internal/node/node_type_descrip.c +154 -0
  103. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.c +5732 -0
  104. data/ext/cached/ruby-1.8.6/internal/node/nodeinfo.h +67 -0
  105. data/ext/cached/ruby-1.8.6/internal/proc/block.h +32 -0
  106. data/ext/cached/ruby-1.8.6/internal/tag/tag.h +16 -0
  107. data/ext/cached/ruby-1.8.6/internal/vm/instruction/insns_info.c +39 -0
  108. data/ext/cached/ruby-1.8.6/internal/vm/instruction/insns_info.h +21 -0
  109. data/ext/cached/ruby-1.8.6/internal/vm/iseq/insns_info.inc +12 -0
  110. data/ext/cached/ruby-1.8.7/internal/binding/block.h +32 -0
  111. data/ext/cached/ruby-1.8.7/internal/method/method.h +20 -0
  112. data/ext/cached/ruby-1.8.7/internal/module/classpath.c +45 -0
  113. data/ext/cached/ruby-1.8.7/internal/module/classpath.h +17 -0
  114. data/ext/cached/ruby-1.8.7/internal/node/block.h +32 -0
  115. data/ext/cached/ruby-1.8.7/internal/node/global_entry.h +10 -0
  116. data/ext/cached/ruby-1.8.7/internal/node/node_type_descrip.c +154 -0
  117. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.c +5732 -0
  118. data/ext/cached/ruby-1.8.7/internal/node/nodeinfo.h +67 -0
  119. data/ext/cached/ruby-1.8.7/internal/proc/block.h +32 -0
  120. data/ext/cached/ruby-1.8.7/internal/tag/tag.h +16 -0
  121. data/ext/cached/ruby-1.8.7/internal/vm/instruction/insns_info.c +39 -0
  122. data/ext/cached/ruby-1.8.7/internal/vm/instruction/insns_info.h +21 -0
  123. data/ext/cached/ruby-1.8.7/internal/vm/iseq/insns_info.inc +12 -0
  124. data/ext/cached/ruby-1.9.0/internal/binding/block.h +12 -0
  125. data/ext/cached/ruby-1.9.0/internal/method/method.h +20 -0
  126. data/ext/cached/ruby-1.9.0/internal/module/classpath.c +42 -0
  127. data/ext/cached/ruby-1.9.0/internal/module/classpath.h +17 -0
  128. data/ext/cached/ruby-1.9.0/internal/node/block.h +12 -0
  129. data/ext/cached/ruby-1.9.0/internal/node/global_entry.h +10 -0
  130. data/ext/cached/ruby-1.9.0/internal/node/node_type_descrip.c +149 -0
  131. data/ext/cached/ruby-1.9.0/internal/node/nodeinfo.c +5579 -0
  132. data/ext/cached/ruby-1.9.0/internal/node/nodeinfo.h +70 -0
  133. data/ext/cached/ruby-1.9.0/internal/proc/block.h +12 -0
  134. data/ext/cached/ruby-1.9.0/internal/tag/tag.h +6 -0
  135. data/ext/cached/ruby-1.9.0/internal/vm/instruction/insns_info.c +5936 -0
  136. data/ext/cached/ruby-1.9.0/internal/vm/instruction/insns_info.h +891 -0
  137. data/ext/cached/ruby-1.9.0/internal/vm/iseq/insns_info.inc +700 -0
  138. data/ext/cached/ruby-1.9.0/internal/yarv-headers/debug.h +36 -0
  139. data/ext/cached/ruby-1.9.0/internal/yarv-headers/dln.h +41 -0
  140. data/ext/cached/ruby-1.9.0/internal/yarv-headers/encdb.h +147 -0
  141. data/ext/cached/ruby-1.9.0/internal/yarv-headers/eval_intern.h +221 -0
  142. data/ext/cached/ruby-1.9.0/internal/yarv-headers/gc.h +75 -0
  143. data/ext/cached/ruby-1.9.0/internal/yarv-headers/id.h +83 -0
  144. data/ext/cached/ruby-1.9.0/internal/yarv-headers/iseq.h +94 -0
  145. data/ext/cached/ruby-1.9.0/internal/yarv-headers/node.h +516 -0
  146. data/ext/cached/ruby-1.9.0/internal/yarv-headers/parse.h +303 -0
  147. data/ext/cached/ruby-1.9.0/internal/yarv-headers/regenc.h +207 -0
  148. data/ext/cached/ruby-1.9.0/internal/yarv-headers/regint.h +842 -0
  149. data/ext/cached/ruby-1.9.0/internal/yarv-headers/regparse.h +351 -0
  150. data/ext/cached/ruby-1.9.0/internal/yarv-headers/revision.h +1 -0
  151. data/ext/cached/ruby-1.9.0/internal/yarv-headers/thread_pthread.h +24 -0
  152. data/ext/cached/ruby-1.9.0/internal/yarv-headers/thread_win32.h +33 -0
  153. data/ext/cached/ruby-1.9.0/internal/yarv-headers/transcode_data.h +99 -0
  154. data/ext/cached/ruby-1.9.0/internal/yarv-headers/transdb.h +67 -0
  155. data/ext/cached/ruby-1.9.0/internal/yarv-headers/version.h +57 -0
  156. data/ext/cached/ruby-1.9.0/internal/yarv-headers/vm_core.h +663 -0
  157. data/ext/cached/ruby-1.9.0/internal/yarv-headers/vm_exec.h +187 -0
  158. data/ext/cached/ruby-1.9.0/internal/yarv-headers/vm_insnhelper.h +191 -0
  159. data/ext/cached/ruby-1.9.0/internal/yarv-headers/vm_opts.h +51 -0
  160. data/ext/cached/ruby-1.9.1/internal/binding/block.h +12 -0
  161. data/ext/cached/ruby-1.9.1/internal/method/method.h +20 -0
  162. data/ext/cached/ruby-1.9.1/internal/module/classpath.c +42 -0
  163. data/ext/cached/ruby-1.9.1/internal/module/classpath.h +17 -0
  164. data/ext/cached/ruby-1.9.1/internal/node/block.h +12 -0
  165. data/ext/cached/ruby-1.9.1/internal/node/global_entry.h +10 -0
  166. data/ext/cached/ruby-1.9.1/internal/node/node_type_descrip.c +149 -0
  167. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.c +5579 -0
  168. data/ext/cached/ruby-1.9.1/internal/node/nodeinfo.h +70 -0
  169. data/ext/cached/ruby-1.9.1/internal/proc/block.h +12 -0
  170. data/ext/cached/ruby-1.9.1/internal/tag/tag.h +6 -0
  171. data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.c +5936 -0
  172. data/ext/cached/ruby-1.9.1/internal/vm/instruction/insns_info.h +891 -0
  173. data/ext/cached/ruby-1.9.1/internal/vm/iseq/insns_info.inc +700 -0
  174. data/ext/cached/ruby-1.9.1/internal/yarv-headers/debug.h +36 -0
  175. data/ext/cached/ruby-1.9.1/internal/yarv-headers/dln.h +41 -0
  176. data/ext/cached/ruby-1.9.1/internal/yarv-headers/encdb.h +147 -0
  177. data/ext/cached/ruby-1.9.1/internal/yarv-headers/eval_intern.h +209 -0
  178. data/ext/cached/ruby-1.9.1/internal/yarv-headers/gc.h +75 -0
  179. data/ext/cached/ruby-1.9.1/internal/yarv-headers/id.h +184 -0
  180. data/ext/cached/ruby-1.9.1/internal/yarv-headers/iseq.h +94 -0
  181. data/ext/cached/ruby-1.9.1/internal/yarv-headers/node.h +516 -0
  182. data/ext/cached/ruby-1.9.1/internal/yarv-headers/parse.h +303 -0
  183. data/ext/cached/ruby-1.9.1/internal/yarv-headers/regenc.h +207 -0
  184. data/ext/cached/ruby-1.9.1/internal/yarv-headers/regint.h +842 -0
  185. data/ext/cached/ruby-1.9.1/internal/yarv-headers/regparse.h +351 -0
  186. data/ext/cached/ruby-1.9.1/internal/yarv-headers/revision.h +1 -0
  187. data/ext/cached/ruby-1.9.1/internal/yarv-headers/thread_pthread.h +24 -0
  188. data/ext/cached/ruby-1.9.1/internal/yarv-headers/thread_win32.h +33 -0
  189. data/ext/cached/ruby-1.9.1/internal/yarv-headers/transcode_data.h +99 -0
  190. data/ext/cached/ruby-1.9.1/internal/yarv-headers/transdb.h +85 -0
  191. data/ext/cached/ruby-1.9.1/internal/yarv-headers/version.h +60 -0
  192. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_core.h +655 -0
  193. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_exec.h +187 -0
  194. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_insnhelper.h +194 -0
  195. data/ext/cached/ruby-1.9.1/internal/yarv-headers/vm_opts.h +51 -0
  196. data/ext/internal/binding/binding.c +45 -0
  197. data/ext/internal/binding/block.h.rpp +44 -0
  198. data/ext/internal/binding/extconf.rb +6 -0
  199. data/ext/internal/method/extconf.rb +8 -0
  200. data/ext/internal/method/method.c +269 -0
  201. data/ext/internal/method/method.h.rpp +58 -0
  202. data/ext/internal/module/classpath.c.rpp +29 -0
  203. data/ext/internal/module/classpath.h.rpp +36 -0
  204. data/ext/internal/module/extconf.rb +11 -0
  205. data/ext/internal/module/module.c +797 -0
  206. data/ext/internal/module/module.h +7 -0
  207. data/ext/internal/node/block.h.rpp +44 -0
  208. data/ext/internal/node/builtins.h +41 -0
  209. data/ext/internal/node/extconf.rb +66 -0
  210. data/ext/internal/node/global_entry.h.rpp +26 -0
  211. data/ext/internal/node/node.c +1147 -0
  212. data/ext/internal/node/node_type_descrip.c.rpp +72 -0
  213. data/ext/internal/node/node_type_descrip.h +17 -0
  214. data/ext/internal/node/node_type_descrip.rb +39 -0
  215. data/ext/internal/node/nodeinfo.c.rpp +587 -0
  216. data/ext/internal/node/nodeinfo.h.rpp +30 -0
  217. data/ext/internal/node/nodes.rb +78 -0
  218. data/ext/internal/node/read_node_h.rb +34 -0
  219. data/ext/internal/node/ruby_internal_node.h +31 -0
  220. data/ext/internal/noex/extconf.rb +6 -0
  221. data/ext/internal/noex/noex.c +44 -0
  222. data/ext/internal/object/extconf.rb +4 -0
  223. data/ext/internal/object/object.c +75 -0
  224. data/ext/internal/proc/block.h.rpp +44 -0
  225. data/ext/internal/proc/extconf.rb +9 -0
  226. data/ext/internal/proc/proc.c +331 -0
  227. data/ext/internal/tag/extconf.rb +3 -0
  228. data/ext/internal/tag/tag.c +17 -0
  229. data/ext/internal/tag/tag.h.rpp +22 -0
  230. data/ext/internal/thread/extconf.rb +3 -0
  231. data/ext/internal/thread/thread.c +107 -0
  232. data/ext/internal/vm/constants/constants.c +33 -0
  233. data/ext/internal/vm/constants/extconf.rb +3 -0
  234. data/ext/internal/vm/control_frame/control_frame.c +185 -0
  235. data/ext/internal/vm/control_frame/control_frame.h +18 -0
  236. data/ext/internal/vm/control_frame/extconf.rb +3 -0
  237. data/ext/internal/vm/extconf.rb +3 -0
  238. data/ext/internal/vm/inline_cache/extconf.rb +6 -0
  239. data/ext/internal/vm/inline_cache/inline_cache.c +79 -0
  240. data/ext/internal/vm/instruction/extconf.rb +6 -0
  241. data/ext/internal/vm/instruction/insns_info.c.rpp +213 -0
  242. data/ext/internal/vm/instruction/insns_info.h.rpp +53 -0
  243. data/ext/internal/vm/instruction/instruction.c +78 -0
  244. data/ext/internal/vm/instruction/instruction.h +10 -0
  245. data/ext/internal/vm/iseq/extconf.rb +7 -0
  246. data/ext/internal/vm/iseq/insns_info.inc.rpp +30 -0
  247. data/ext/internal/vm/iseq/internal_iseq.h +9 -0
  248. data/ext/internal/vm/iseq/iseq.c +555 -0
  249. data/ext/internal/vm/vm.c +55 -0
  250. data/ext/mkmf-ruby-internal.rb +111 -0
  251. data/ext/ruby_source_dir.rb +24 -0
  252. data/ext/rubypp.rb +97 -0
  253. data/generate_rdoc.rb +33 -0
  254. data/lib/internal/binding.rb +1 -0
  255. data/lib/internal/classtree.rb +55 -0
  256. data/lib/internal/debug.rb +16 -0
  257. data/lib/internal/method.rb +1 -0
  258. data/lib/internal/method/as_code.rb +33 -0
  259. data/lib/internal/method/as_expression.rb +34 -0
  260. data/lib/internal/method/signature.rb +442 -0
  261. data/lib/internal/module.rb +1 -0
  262. data/lib/internal/module/as_code.rb +45 -0
  263. data/lib/internal/node.rb +3 -0
  264. data/lib/internal/node/as_code.rb +233 -0
  265. data/lib/internal/node/as_expression.rb +619 -0
  266. data/lib/internal/node/dump.rb +53 -0
  267. data/lib/internal/node/pp.rb +72 -0
  268. data/lib/internal/node/to_a.rb +52 -0
  269. data/lib/internal/noex.rb +1 -0
  270. data/lib/internal/obfusc.rb +57 -0
  271. data/lib/internal/object.rb +1 -0
  272. data/lib/internal/object/as_code.rb +10 -0
  273. data/lib/internal/proc.rb +1 -0
  274. data/lib/internal/proc/as_code.rb +21 -0
  275. data/lib/internal/proc/as_expression.rb +14 -0
  276. data/lib/internal/proc/signature.rb +184 -0
  277. data/lib/internal/tag.rb +1 -0
  278. data/lib/internal/thread.rb +1 -0
  279. data/lib/internal/vm.rb +1 -0
  280. data/lib/internal/vm/bytedecoder.rb +866 -0
  281. data/lib/internal/vm/constants.rb +1 -0
  282. data/lib/internal/vm/control_frame.rb +1 -0
  283. data/lib/internal/vm/inline_cache.rb +1 -0
  284. data/lib/internal/vm/instruction.rb +1 -0
  285. data/lib/internal/vm/iseq.rb +1 -0
  286. data/lib/internal/vm/iseq/as_code.rb +27 -0
  287. data/lib/internal/vm/iseq/as_expression.rb +26 -0
  288. data/metaconfig +19 -0
  289. data/post-config.rb +1 -0
  290. data/post-install.rb +4 -0
  291. data/post-setup.rb +7 -0
  292. data/pre-config.rb +96 -0
  293. data/pre-install.rb +13 -0
  294. data/pre-setup.rb +8 -0
  295. data/run_tests.rb +26 -0
  296. data/setup.rb +1599 -0
  297. data/test/expression_samples.rb +160 -0
  298. data/test/node_samples.rb +122 -0
  299. data/test/test_as_code.rb +261 -0
  300. data/test/test_as_expression.rb +229 -0
  301. data/test/test_dump_class.rb +187 -0
  302. data/test/test_dump_method.rb +144 -0
  303. data/test/test_dump_proc.rb +118 -0
  304. data/test/test_helpers.rb +61 -0
  305. data/test/test_method.rb +72 -0
  306. data/test/test_methodsig.rb +267 -0
  307. data/test/test_module.rb +49 -0
  308. data/test/test_node.rb +77 -0
  309. data/test/test_proc.rb +47 -0
  310. metadata +377 -0
@@ -0,0 +1,700 @@
1
+ #ifndef ruby_internal_insns_info__inc_
2
+ #define ruby_internal_insns_info__inc_
3
+
4
+ #include <ruby.h>
5
+
6
+ #ifndef RUBY_VM
7
+ #include "env.h"
8
+ #endif
9
+
10
+ /** -*-c-*-
11
+ This file contains instruction information for yarv instruction sequence.
12
+
13
+ ----
14
+ This file is auto generated by insns2vm.rb
15
+ DO NOT TOUCH!
16
+
17
+ If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
18
+ or insns2vm.rb
19
+ */
20
+
21
+ #define TS_ISEQ 'S'
22
+ #define TS_OFFSET 'O'
23
+ #define TS_GENTRY 'G'
24
+ #define TS_DINDEX 'D'
25
+ #define TS_VARIABLE '.'
26
+ #define TS_CDHASH 'H'
27
+ #define TS_IC 'C'
28
+ #define TS_ID 'I'
29
+ #define TS_NUM 'N'
30
+ #define TS_FUNCPTR 'F'
31
+ #define TS_VALUE 'V'
32
+ #define TS_LINDEX 'L'
33
+
34
+ static const char *const insn_name_info[] = {
35
+ "nop",
36
+ "getlocal",
37
+ "setlocal",
38
+ "getspecial",
39
+ "setspecial",
40
+ "getdynamic",
41
+ "setdynamic",
42
+ "getinstancevariable",
43
+ "setinstancevariable",
44
+ "getclassvariable",
45
+ "setclassvariable",
46
+ "getconstant",
47
+ "setconstant",
48
+ "getglobal",
49
+ "setglobal",
50
+ "putnil",
51
+ "putself",
52
+ "putobject",
53
+ "putspecialobject",
54
+ "putiseq",
55
+ "putstring",
56
+ "concatstrings",
57
+ "tostring",
58
+ "toregexp",
59
+ "newarray",
60
+ "duparray",
61
+ "expandarray",
62
+ "concatarray",
63
+ "splatarray",
64
+ "checkincludearray",
65
+ "newhash",
66
+ "newrange",
67
+ "pop",
68
+ "dup",
69
+ "dupn",
70
+ "swap",
71
+ "reput",
72
+ "topn",
73
+ "setn",
74
+ "adjuststack",
75
+ "defined",
76
+ "trace",
77
+ "defineclass",
78
+ "send",
79
+ "invokesuper",
80
+ "invokeblock",
81
+ "leave",
82
+ "finish",
83
+ "throw",
84
+ "jump",
85
+ "branchif",
86
+ "branchunless",
87
+ "getinlinecache",
88
+ "onceinlinecache",
89
+ "setinlinecache",
90
+ "opt_case_dispatch",
91
+ "opt_checkenv",
92
+ "opt_plus",
93
+ "opt_minus",
94
+ "opt_mult",
95
+ "opt_div",
96
+ "opt_mod",
97
+ "opt_eq",
98
+ "opt_neq",
99
+ "opt_lt",
100
+ "opt_le",
101
+ "opt_gt",
102
+ "opt_ge",
103
+ "opt_ltlt",
104
+ "opt_aref",
105
+ "opt_aset",
106
+ "opt_length",
107
+ "opt_succ",
108
+ "opt_not",
109
+ "opt_regexpmatch1",
110
+ "opt_regexpmatch2",
111
+ "opt_call_c_function",
112
+ "bitblt",
113
+ "answer",
114
+
115
+ };
116
+
117
+ static const char *const insn_operand_info[] = {
118
+ "",
119
+ "L",
120
+ "L",
121
+ "VN",
122
+ "V",
123
+ "DN",
124
+ "DN",
125
+ "I",
126
+ "I",
127
+ "I",
128
+ "I",
129
+ "I",
130
+ "I",
131
+ "G",
132
+ "G",
133
+ "",
134
+ "",
135
+ "V",
136
+ "N",
137
+ "S",
138
+ "V",
139
+ "N",
140
+ "",
141
+ "NN",
142
+ "N",
143
+ "V",
144
+ "NN",
145
+ "",
146
+ "V",
147
+ "V",
148
+ "N",
149
+ "N",
150
+ "",
151
+ "",
152
+ "N",
153
+ "",
154
+ "",
155
+ "N",
156
+ "N",
157
+ "N",
158
+ "NVV",
159
+ "N",
160
+ "ISN",
161
+ "INSNC",
162
+ "NSN",
163
+ "NN",
164
+ "",
165
+ "",
166
+ "N",
167
+ "O",
168
+ "O",
169
+ "O",
170
+ "CO",
171
+ "CO",
172
+ "O",
173
+ "HO",
174
+ "",
175
+ "",
176
+ "",
177
+ "",
178
+ "",
179
+ "",
180
+ "C",
181
+ "CC",
182
+ "",
183
+ "",
184
+ "",
185
+ "",
186
+ "",
187
+ "",
188
+ "",
189
+ "",
190
+ "",
191
+ "C",
192
+ "V",
193
+ "",
194
+ "F",
195
+ "",
196
+ "",
197
+
198
+ };
199
+
200
+ static const int insn_len_info[] = {
201
+ 1,
202
+ 2,
203
+ 2,
204
+ 3,
205
+ 2,
206
+ 3,
207
+ 3,
208
+ 2,
209
+ 2,
210
+ 2,
211
+ 2,
212
+ 2,
213
+ 2,
214
+ 2,
215
+ 2,
216
+ 1,
217
+ 1,
218
+ 2,
219
+ 2,
220
+ 2,
221
+ 2,
222
+ 2,
223
+ 1,
224
+ 3,
225
+ 2,
226
+ 2,
227
+ 3,
228
+ 1,
229
+ 2,
230
+ 2,
231
+ 2,
232
+ 2,
233
+ 1,
234
+ 1,
235
+ 2,
236
+ 1,
237
+ 1,
238
+ 2,
239
+ 2,
240
+ 2,
241
+ 4,
242
+ 2,
243
+ 4,
244
+ 6,
245
+ 4,
246
+ 3,
247
+ 1,
248
+ 1,
249
+ 2,
250
+ 2,
251
+ 2,
252
+ 2,
253
+ 3,
254
+ 3,
255
+ 2,
256
+ 3,
257
+ 1,
258
+ 1,
259
+ 1,
260
+ 1,
261
+ 1,
262
+ 1,
263
+ 2,
264
+ 3,
265
+ 1,
266
+ 1,
267
+ 1,
268
+ 1,
269
+ 1,
270
+ 1,
271
+ 1,
272
+ 1,
273
+ 1,
274
+ 2,
275
+ 2,
276
+ 1,
277
+ 2,
278
+ 1,
279
+ 1,
280
+
281
+ };
282
+
283
+ #ifdef USE_INSN_RET_NUM
284
+ static const int insn_stack_push_num_info[] = {
285
+ 0,
286
+ 1,
287
+ 0,
288
+ 1,
289
+ 0,
290
+ 1,
291
+ 0,
292
+ 1,
293
+ 0,
294
+ 1,
295
+ 0,
296
+ 1,
297
+ 0,
298
+ 1,
299
+ 0,
300
+ 1,
301
+ 1,
302
+ 1,
303
+ 1,
304
+ 1,
305
+ 1,
306
+ 1,
307
+ 1,
308
+ 1,
309
+ 1,
310
+ 1,
311
+ 1,
312
+ 1,
313
+ 1,
314
+ 2,
315
+ 1,
316
+ 1,
317
+ 0,
318
+ 2,
319
+ 1,
320
+ 2,
321
+ 1,
322
+ 1,
323
+ 1,
324
+ 1,
325
+ 1,
326
+ 0,
327
+ 1,
328
+ 1,
329
+ 1,
330
+ 1,
331
+ 1,
332
+ 1,
333
+ 1,
334
+ 0,
335
+ 0,
336
+ 0,
337
+ 1,
338
+ 1,
339
+ 1,
340
+ 0,
341
+ 0,
342
+ 1,
343
+ 1,
344
+ 1,
345
+ 1,
346
+ 1,
347
+ 1,
348
+ 1,
349
+ 1,
350
+ 1,
351
+ 1,
352
+ 1,
353
+ 1,
354
+ 1,
355
+ 1,
356
+ 1,
357
+ 1,
358
+ 1,
359
+ 1,
360
+ 1,
361
+ 0,
362
+ 1,
363
+ 1,
364
+
365
+ };
366
+ #endif
367
+
368
+ #ifdef USE_INSN_STACK_INCREASE
369
+ static int
370
+ insn_stack_increase(int depth, int insn, VALUE *opes)
371
+ {
372
+ switch(insn){
373
+ case BIN(nop):{
374
+ return depth + 0;
375
+ }
376
+ case BIN(getlocal):{
377
+ return depth + 1;
378
+ }
379
+ case BIN(setlocal):{
380
+ return depth + -1;
381
+ }
382
+ case BIN(getspecial):{
383
+ return depth + 1;
384
+ }
385
+ case BIN(setspecial):{
386
+ return depth + -1;
387
+ }
388
+ case BIN(getdynamic):{
389
+ return depth + 1;
390
+ }
391
+ case BIN(setdynamic):{
392
+ return depth + -1;
393
+ }
394
+ case BIN(getinstancevariable):{
395
+ return depth + 1;
396
+ }
397
+ case BIN(setinstancevariable):{
398
+ return depth + -1;
399
+ }
400
+ case BIN(getclassvariable):{
401
+ return depth + 1;
402
+ }
403
+ case BIN(setclassvariable):{
404
+ return depth + -1;
405
+ }
406
+ case BIN(getconstant):{
407
+ return depth + 0;
408
+ }
409
+ case BIN(setconstant):{
410
+ return depth + -2;
411
+ }
412
+ case BIN(getglobal):{
413
+ return depth + 1;
414
+ }
415
+ case BIN(setglobal):{
416
+ return depth + -1;
417
+ }
418
+ case BIN(putnil):{
419
+ return depth + 1;
420
+ }
421
+ case BIN(putself):{
422
+ return depth + 1;
423
+ }
424
+ case BIN(putobject):{
425
+ return depth + 1;
426
+ }
427
+ case BIN(putspecialobject):{
428
+ return depth + 1;
429
+ }
430
+ case BIN(putiseq):{
431
+ return depth + 1;
432
+ }
433
+ case BIN(putstring):{
434
+ return depth + 1;
435
+ }
436
+ case BIN(concatstrings):{
437
+ int inc = 0;
438
+ rb_num_t num = FIX2INT(opes[0]);
439
+ inc += 1 - num;;
440
+ return depth + inc;
441
+ }
442
+ case BIN(tostring):{
443
+ return depth + 0;
444
+ }
445
+ case BIN(toregexp):{
446
+ int inc = 0;
447
+ rb_num_t cnt = FIX2INT(opes[1]);
448
+ inc += 1 - cnt;;
449
+ return depth + inc;
450
+ }
451
+ case BIN(newarray):{
452
+ int inc = 0;
453
+ rb_num_t num = FIX2INT(opes[0]);
454
+ inc += 1 - num;;
455
+ return depth + inc;
456
+ }
457
+ case BIN(duparray):{
458
+ return depth + 1;
459
+ }
460
+ case BIN(expandarray):{
461
+ int inc = 0;
462
+ rb_num_t num = FIX2INT(opes[0]);
463
+ rb_num_t flag = FIX2INT(opes[1]);
464
+ inc += num - 1 + (flag & 1 ? 1 : 0);;
465
+ return depth + inc;
466
+ }
467
+ case BIN(concatarray):{
468
+ return depth + -1;
469
+ }
470
+ case BIN(splatarray):{
471
+ return depth + 0;
472
+ }
473
+ case BIN(checkincludearray):{
474
+ return depth + 0;
475
+ }
476
+ case BIN(newhash):{
477
+ int inc = 0;
478
+ rb_num_t num = FIX2INT(opes[0]);
479
+ inc += 1 - num;;
480
+ return depth + inc;
481
+ }
482
+ case BIN(newrange):{
483
+ return depth + -1;
484
+ }
485
+ case BIN(pop):{
486
+ return depth + -1;
487
+ }
488
+ case BIN(dup):{
489
+ return depth + 1;
490
+ }
491
+ case BIN(dupn):{
492
+ int inc = 0;
493
+ rb_num_t n = FIX2INT(opes[0]);
494
+ inc += n;;
495
+ return depth + inc;
496
+ }
497
+ case BIN(swap):{
498
+ return depth + 0;
499
+ }
500
+ case BIN(reput):{
501
+ int inc = 0;
502
+ inc += 0;;
503
+ return depth + inc;
504
+ }
505
+ case BIN(topn):{
506
+ int inc = 0;
507
+ inc += 1;;
508
+ return depth + inc;
509
+ }
510
+ case BIN(setn):{
511
+ int inc = 0;
512
+ inc += 0;
513
+ return depth + inc;
514
+ }
515
+ case BIN(adjuststack):{
516
+ int inc = 0;
517
+ rb_num_t n = FIX2INT(opes[0]);
518
+ inc -= n;
519
+ return depth + inc;
520
+ }
521
+ case BIN(defined):{
522
+ return depth + 0;
523
+ }
524
+ case BIN(trace):{
525
+ return depth + 0;
526
+ }
527
+ case BIN(defineclass):{
528
+ return depth + -1;
529
+ }
530
+ case BIN(send):{
531
+ int inc = 0;
532
+ rb_num_t op_argc = FIX2INT(opes[1]);
533
+ rb_num_t op_flag = FIX2INT(opes[3]);
534
+ inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
535
+ return depth + inc;
536
+ }
537
+ case BIN(invokesuper):{
538
+ int inc = 0;
539
+ rb_num_t op_argc = FIX2INT(opes[0]);
540
+ rb_num_t op_flag = FIX2INT(opes[2]);
541
+ inc += - (op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
542
+ return depth + inc;
543
+ }
544
+ case BIN(invokeblock):{
545
+ int inc = 0;
546
+ rb_num_t num = FIX2INT(opes[0]);
547
+ inc += 1 - num;;
548
+ return depth + inc;
549
+ }
550
+ case BIN(leave):{
551
+ return depth + 0;
552
+ }
553
+ case BIN(finish):{
554
+ return depth + 0;
555
+ }
556
+ case BIN(throw):{
557
+ return depth + 0;
558
+ }
559
+ case BIN(jump):{
560
+ return depth + 0;
561
+ }
562
+ case BIN(branchif):{
563
+ return depth + -1;
564
+ }
565
+ case BIN(branchunless):{
566
+ return depth + -1;
567
+ }
568
+ case BIN(getinlinecache):{
569
+ return depth + 1;
570
+ }
571
+ case BIN(onceinlinecache):{
572
+ return depth + 1;
573
+ }
574
+ case BIN(setinlinecache):{
575
+ return depth + 0;
576
+ }
577
+ case BIN(opt_case_dispatch):{
578
+ int inc = 0;
579
+ inc += -1;;
580
+ return depth + inc;
581
+ }
582
+ case BIN(opt_checkenv):{
583
+ return depth + 0;
584
+ }
585
+ case BIN(opt_plus):{
586
+ return depth + -1;
587
+ }
588
+ case BIN(opt_minus):{
589
+ return depth + -1;
590
+ }
591
+ case BIN(opt_mult):{
592
+ return depth + -1;
593
+ }
594
+ case BIN(opt_div):{
595
+ return depth + -1;
596
+ }
597
+ case BIN(opt_mod):{
598
+ return depth + -1;
599
+ }
600
+ case BIN(opt_eq):{
601
+ return depth + -1;
602
+ }
603
+ case BIN(opt_neq):{
604
+ return depth + -1;
605
+ }
606
+ case BIN(opt_lt):{
607
+ return depth + -1;
608
+ }
609
+ case BIN(opt_le):{
610
+ return depth + -1;
611
+ }
612
+ case BIN(opt_gt):{
613
+ return depth + -1;
614
+ }
615
+ case BIN(opt_ge):{
616
+ return depth + -1;
617
+ }
618
+ case BIN(opt_ltlt):{
619
+ return depth + -1;
620
+ }
621
+ case BIN(opt_aref):{
622
+ return depth + -1;
623
+ }
624
+ case BIN(opt_aset):{
625
+ return depth + -2;
626
+ }
627
+ case BIN(opt_length):{
628
+ return depth + 0;
629
+ }
630
+ case BIN(opt_succ):{
631
+ return depth + 0;
632
+ }
633
+ case BIN(opt_not):{
634
+ return depth + 0;
635
+ }
636
+ case BIN(opt_regexpmatch1):{
637
+ return depth + 0;
638
+ }
639
+ case BIN(opt_regexpmatch2):{
640
+ return depth + -1;
641
+ }
642
+ case BIN(opt_call_c_function):{
643
+ return depth + 0;
644
+ }
645
+ case BIN(bitblt):{
646
+ return depth + 1;
647
+ }
648
+ case BIN(answer):{
649
+ return depth + 1;
650
+ }
651
+
652
+ default:
653
+ rb_bug("insn_sp_increase: unreachable");
654
+ }
655
+ return 0;
656
+ }
657
+ #endif
658
+
659
+ /* some utilities */
660
+
661
+ static int
662
+ insn_len(int insn)
663
+ {
664
+ return insn_len_info[insn];
665
+ }
666
+
667
+ static const char *
668
+ insn_name(int insn)
669
+ {
670
+ return insn_name_info[insn];
671
+ }
672
+
673
+ static const char *
674
+ insn_op_types(int insn)
675
+ {
676
+ return insn_operand_info[insn];
677
+ }
678
+
679
+ static int
680
+ insn_op_type(int insn, int pos)
681
+ {
682
+ int len = insn_len(insn) - 1;
683
+ if(pos < len){
684
+ return insn_operand_info[insn][pos];
685
+ }
686
+ else{
687
+ return 0;
688
+ }
689
+ }
690
+
691
+ #ifdef USE_INSN_RET_NUM
692
+ static int
693
+ insn_ret_num(int insn)
694
+ {
695
+ return insn_stack_push_num_info[insn];
696
+ }
697
+ #endif
698
+
699
+ #endif
700
+