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
@@ -1,5 +1,7 @@
1
1
  ENC_DEFINE("ASCII-8BIT");
2
2
  ENC_DEFINE("Big5");
3
+ ENC_DEFINE("Big5-HKSCS");
4
+ ENC_DEFINE("Big5-UAO");
3
5
  ENC_DEFINE("CP949");
4
6
  ENC_DEFINE("Emacs-Mule");
5
7
  ENC_DEFINE("EUC-JP");
@@ -76,7 +78,10 @@ ENC_REPLICATE("macRomania", "ASCII-8BIT");
76
78
  ENC_REPLICATE("macThai", "ASCII-8BIT");
77
79
  ENC_REPLICATE("macTurkish", "ASCII-8BIT");
78
80
  ENC_REPLICATE("macUkraine", "ASCII-8BIT");
79
- ENC_ALIAS("CP950", "BIG5");
81
+ ENC_ALIAS("CP950", "Big5");
82
+ ENC_SET_BASE("Big5-HKSCS", "Big5");
83
+ ENC_ALIAS("CP951", "Big5-HKSCS");
84
+ ENC_SET_BASE("Big5-UAO", "Big5");
80
85
  ENC_REPLICATE("stateless-ISO-2022-JP", "Emacs-Mule");
81
86
  ENC_ALIAS("eucJP", "EUC-JP") /* UI-OSF Application Platform Profile for Japanese Environment Version 1.1 */;
82
87
  ENC_REPLICATE("eucJP-ms", "EUC-JP") /* TOG/JVC CDE/Motif Technical WG */;
@@ -92,6 +97,8 @@ ENC_DUMMY("ISO-2022-JP");
92
97
  ENC_ALIAS("ISO2022-JP", "ISO-2022-JP");
93
98
  ENC_REPLICATE("ISO-2022-JP-2", "ISO-2022-JP");
94
99
  ENC_ALIAS("ISO2022-JP2", "ISO-2022-JP-2");
100
+ ENC_REPLICATE("CP50220", "ISO-2022-JP");
101
+ ENC_REPLICATE("CP50221", "ISO-2022-JP");
95
102
  ENC_ALIAS("ISO8859-1", "ISO-8859-1");
96
103
  ENC_REPLICATE("Windows-1252", "ISO-8859-1");
97
104
  ENC_ALIAS("CP1252", "Windows-1252");
@@ -139,9 +146,18 @@ ENC_ALIAS("CP65000", "UTF-7");
139
146
  ENC_ALIAS("CP65001", "UTF-8");
140
147
  ENC_REPLICATE("UTF8-MAC", "UTF-8");
141
148
  ENC_ALIAS("UTF-8-MAC", "UTF8-MAC");
149
+ ENC_ALIAS("UTF-8-HFS", "UTF8-MAC") /* Emacs 23.2 */;
142
150
  ENC_ALIAS("UCS-2BE", "UTF-16BE");
143
151
  ENC_ALIAS("UCS-4BE", "UTF-32BE");
144
152
  ENC_ALIAS("UCS-4LE", "UTF-32LE");
145
153
  ENC_ALIAS("CP1251", "Windows-1251");
154
+ ENC_REPLICATE("UTF8-DoCoMo", "UTF-8");
155
+ ENC_REPLICATE("SJIS-DoCoMo", "Windows-31J");
156
+ ENC_REPLICATE("UTF8-KDDI", "UTF-8");
157
+ ENC_REPLICATE("SJIS-KDDI", "Windows-31J");
158
+ ENC_REPLICATE("ISO-2022-JP-KDDI", "ISO-2022-JP");
159
+ ENC_REPLICATE("stateless-ISO-2022-JP-KDDI", "stateless-ISO-2022-JP");
160
+ ENC_REPLICATE("UTF8-SoftBank", "UTF-8");
161
+ ENC_REPLICATE("SJIS-SoftBank", "Windows-31J");
146
162
 
147
- #define ENCODING_COUNT 83
163
+ #define ENCODING_COUNT 95
@@ -64,28 +64,21 @@ char *strrchr(const char *, const char);
64
64
  #include <net/socket.h>
65
65
  #endif
66
66
 
67
- #ifdef __MACOS__
68
- #include "macruby_private.h"
69
- #endif
70
-
71
- #ifdef __VMS
72
- #include "vmsruby_private.h"
73
- #endif
74
-
75
67
  #define ruby_setjmp(env) RUBY_SETJMP(env)
76
68
  #define ruby_longjmp(env,val) RUBY_LONGJMP(env,val)
77
69
  #ifdef __CYGWIN__
78
- int _setjmp(), _longjmp();
70
+ # ifndef _setjmp
71
+ int _setjmp(jmp_buf);
72
+ # endif
73
+ # ifndef _longjmp
74
+ NORETURN(void _longjmp(jmp_buf, int));
75
+ # endif
79
76
  #endif
80
77
 
81
78
  #include <sys/types.h>
82
79
  #include <signal.h>
83
80
  #include <errno.h>
84
81
 
85
- #if defined(__VMS)
86
- #pragma nostandard
87
- #endif
88
-
89
82
  #ifdef HAVE_SYS_SELECT_H
90
83
  #include <sys/select.h>
91
84
  #endif
@@ -164,7 +157,7 @@ enum ruby_tag_type {
164
157
  #define TAG_MASK RUBY_TAG_MASK
165
158
 
166
159
  #define NEW_THROW_OBJECT(val, pt, st) \
167
- ((VALUE)NEW_NODE(NODE_LIT, (val), (pt), (st)))
160
+ ((VALUE)rb_node_newnode(NODE_LIT, (VALUE)(val), (VALUE)(pt), (VALUE)(st)))
168
161
  #define SET_THROWOBJ_CATCH_POINT(obj, val) \
169
162
  (RNODE((obj))->u2.value = (val))
170
163
  #define SET_THROWOBJ_STATE(obj, val) \
@@ -174,12 +167,12 @@ enum ruby_tag_type {
174
167
  #define GET_THROWOBJ_CATCH_POINT(obj) ((VALUE*)RNODE((obj))->u2.value)
175
168
  #define GET_THROWOBJ_STATE(obj) ((int)RNODE((obj))->u3.value)
176
169
 
177
- #define SCOPE_TEST(f) (vm_cref()->nd_visi & (f))
178
- #define SCOPE_CHECK(f) (vm_cref()->nd_visi == (f))
179
- #define SCOPE_SET(f) (vm_cref()->nd_visi = (f))
170
+ #define SCOPE_TEST(f) (rb_vm_cref()->nd_visi & (f))
171
+ #define SCOPE_CHECK(f) (rb_vm_cref()->nd_visi == (f))
172
+ #define SCOPE_SET(f) (rb_vm_cref()->nd_visi = (f))
180
173
 
181
174
  #define CHECK_STACK_OVERFLOW(cfp, margin) do \
182
- if (((VALUE *)(cfp)->sp) + (margin) + sizeof(rb_control_frame_t) >= ((VALUE *)cfp)) { \
175
+ if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)cfp)) { \
183
176
  rb_exc_raise(sysstack_error); \
184
177
  } \
185
178
  while (0)
@@ -192,8 +185,8 @@ enum {
192
185
  RAISED_STACKOVERFLOW = 2,
193
186
  RAISED_NOMEMORY = 4
194
187
  };
195
- int rb_thread_set_raised(rb_thread_t *th);
196
- int rb_thread_reset_raised(rb_thread_t *th);
188
+ int rb_threadptr_set_raised(rb_thread_t *th);
189
+ int rb_threadptr_reset_raised(rb_thread_t *th);
197
190
  #define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f))
198
191
  #define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f))
199
192
  #define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0)
@@ -205,17 +198,35 @@ VALUE rb_make_exception(int argc, VALUE *argv);
205
198
  NORETURN(void rb_fiber_start(void));
206
199
 
207
200
  NORETURN(void rb_print_undef(VALUE, ID, int));
208
- NORETURN(void vm_localjump_error(const char *,VALUE, int));
209
- NORETURN(void vm_jump_tag_but_local_jump(int, VALUE));
210
-
211
- VALUE vm_make_jump_tag_but_local_jump(int state, VALUE val);
212
- NODE *vm_cref(void);
213
- rb_control_frame_t *vm_get_ruby_level_caller_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
214
- VALUE rb_obj_is_proc(VALUE);
215
- VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
201
+ NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
202
+ NORETURN(void rb_vm_jump_tag_but_local_jump(int, VALUE));
203
+ NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, VALUE *argv,
204
+ VALUE obj, int call_status));
205
+
206
+ VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
207
+ NODE *rb_vm_cref(void);
208
+ VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename, VALUE filepath);
209
+ void rb_vm_set_progname(VALUE filename);
216
210
  void rb_thread_terminate_all(void);
217
211
  VALUE rb_vm_top_self();
218
212
  VALUE rb_vm_cbase(void);
213
+ int rb_vm_get_sourceline(const rb_control_frame_t *);
219
214
  void rb_trap_restore_mask(void);
220
215
 
216
+ #ifndef CharNext /* defined as CharNext[AW] on Windows. */
217
+ #define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE))
218
+ #endif
219
+
220
+ #if defined DOSISH || defined __CYGWIN__
221
+ static inline void
222
+ translit_char(char *p, int from, int to)
223
+ {
224
+ while (*p) {
225
+ if ((unsigned char)*p == from)
226
+ *p = to;
227
+ p = CharNext(p);
228
+ }
229
+ }
230
+ #endif
231
+
221
232
  #endif /* RUBY_EVAL_INTERN_H */
@@ -2,8 +2,10 @@
2
2
  #ifndef RUBY_GC_H
3
3
  #define RUBY_GC_H 1
4
4
 
5
- #if defined(__i386) && defined(__GNUC__)
6
- #define SET_MACHINE_STACK_END(p) __asm__("mov %%esp, %0" : "=r" (*p))
5
+ #if defined(__x86_64__) && defined(__GNUC__)
6
+ #define SET_MACHINE_STACK_END(p) __asm__("movq\t%%rsp, %0" : "=r" (*p))
7
+ #elif defined(__i386) && defined(__GNUC__)
8
+ #define SET_MACHINE_STACK_END(p) __asm__("movl\t%%esp, %0" : "=r" (*p))
7
9
  #else
8
10
  NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
9
11
  #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
@@ -26,7 +28,7 @@ rb_gc_debug_indent(void)
26
28
  }
27
29
 
28
30
  static void
29
- rb_gc_debug_body(char *mode, char *msg, int st, void *ptr)
31
+ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
30
32
  {
31
33
  if (st == 0) {
32
34
  ruby_gc_debug_indent--;
@@ -56,7 +58,7 @@ rb_gc_debug_body(char *mode, char *msg, int st, void *ptr)
56
58
  #endif
57
59
 
58
60
  #define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
59
- #define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);}
61
+ #define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
60
62
 
61
63
  #if STACK_GROW_DIRECTION > 0
62
64
  # define STACK_UPPER(x, a, b) a
@@ -64,7 +66,7 @@ rb_gc_debug_body(char *mode, char *msg, int st, void *ptr)
64
66
  # define STACK_UPPER(x, a, b) b
65
67
  #else
66
68
  RUBY_EXTERN int ruby_stack_grow_direction;
67
- int ruby_get_stack_grow_direction(VALUE *addr);
69
+ int ruby_get_stack_grow_direction(volatile VALUE *addr);
68
70
  # define stack_growup_p(x) ( \
69
71
  (ruby_stack_grow_direction ? \
70
72
  ruby_stack_grow_direction : \
@@ -0,0 +1,170 @@
1
+ /* DO NOT EDIT THIS FILE DIRECTLY */
2
+ /**********************************************************************
3
+
4
+ id.h -
5
+
6
+ $Author: akr $
7
+ created at: Sun Oct 19 21:12:51 2008
8
+
9
+ Copyright (C) 2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ #ifndef RUBY_ID_H
14
+ #define RUBY_ID_H
15
+
16
+ #define ID_SCOPE_SHIFT 3
17
+ #define ID_SCOPE_MASK 0x07
18
+ #define ID_LOCAL 0x00
19
+ #define ID_INSTANCE 0x01
20
+ #define ID_GLOBAL 0x03
21
+ #define ID_ATTRSET 0x04
22
+ #define ID_CONST 0x05
23
+ #define ID_CLASS 0x06
24
+ #define ID_JUNK 0x07
25
+ #define ID_INTERNAL ID_JUNK
26
+
27
+ #ifdef USE_PARSE_H
28
+ #include "parse.h"
29
+ #endif
30
+
31
+ #define symIFUNC ID2SYM(idIFUNC)
32
+ #define symCFUNC ID2SYM(idCFUNC)
33
+
34
+ #if !defined tLAST_TOKEN && defined YYTOKENTYPE
35
+ #define tLAST_TOKEN tLAST_TOKEN
36
+ #endif
37
+
38
+ enum ruby_method_ids {
39
+ #ifndef tLAST_TOKEN
40
+ tUPLUS = 321,
41
+ tUMINUS = 322,
42
+ tPOW = 323,
43
+ tCMP = 324,
44
+ tEQ = 325,
45
+ tEQQ = 326,
46
+ tNEQ = 327,
47
+ tGEQ = 328,
48
+ tLEQ = 329,
49
+ tANDOP = 330,
50
+ tOROP = 331,
51
+ tMATCH = 332,
52
+ tNMATCH = 333,
53
+ tDOT2 = 334,
54
+ tDOT3 = 335,
55
+ tAREF = 336,
56
+ tASET = 337,
57
+ tLSHFT = 338,
58
+ tRSHFT = 339,
59
+ tLAMBDA = 352,
60
+ idNULL = 365,
61
+ idRespond_to = 366,
62
+ idIFUNC = 367,
63
+ idCFUNC = 368,
64
+ id_core_set_method_alias = 369,
65
+ id_core_set_variable_alias = 370,
66
+ id_core_undef_method = 371,
67
+ id_core_define_method = 372,
68
+ id_core_define_singleton_method = 373,
69
+ id_core_set_postexe = 374,
70
+ tLAST_TOKEN = 375,
71
+ #endif
72
+ idDot2 = tDOT2,
73
+ idDot3 = tDOT3,
74
+ idUPlus = tUPLUS,
75
+ idUMinus = tUMINUS,
76
+ idPow = tPOW,
77
+ idCmp = tCMP,
78
+ idPLUS = '+',
79
+ idMINUS = '-',
80
+ idMULT = '*',
81
+ idDIV = '/',
82
+ idMOD = '%',
83
+ idLT = '<',
84
+ idLTLT = tLSHFT,
85
+ idLE = tLEQ,
86
+ idGT = '>',
87
+ idGE = tGEQ,
88
+ idEq = tEQ,
89
+ idEqq = tEQQ,
90
+ idNeq = tNEQ,
91
+ idNot = '!',
92
+ idBackquote = '`',
93
+ idEqTilde = tMATCH,
94
+ idNeqTilde = tNMATCH,
95
+ idAREF = tAREF,
96
+ idASET = tASET,
97
+ idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
98
+ tIntern,
99
+ tMethodMissing,
100
+ tLength,
101
+ tSize,
102
+ tGets,
103
+ tSucc,
104
+ tEach,
105
+ tLambda,
106
+ tSend,
107
+ t__send__,
108
+ tInitialize,
109
+ #if SUPPORT_JOKE
110
+ tBitblt,
111
+ tAnswer,
112
+ #endif
113
+ tLAST_ID,
114
+ #define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
115
+ #if SUPPORT_JOKE
116
+ TOKEN2ID(Bitblt),
117
+ TOKEN2ID(Answer),
118
+ #endif
119
+ TOKEN2ID(Intern),
120
+ TOKEN2ID(MethodMissing),
121
+ TOKEN2ID(Length),
122
+ TOKEN2ID(Size),
123
+ TOKEN2ID(Gets),
124
+ TOKEN2ID(Succ),
125
+ TOKEN2ID(Each),
126
+ TOKEN2ID(Lambda),
127
+ TOKEN2ID(Send),
128
+ TOKEN2ID(__send__),
129
+ TOKEN2ID(Initialize)
130
+ };
131
+
132
+ #ifdef tLAST_TOKEN
133
+ struct ruby_method_ids_check {
134
+ #define ruby_method_id_check_for(name, value) \
135
+ int checking_for_##name[name == value ? 1 : -1]
136
+ ruby_method_id_check_for(tUPLUS, 321);
137
+ ruby_method_id_check_for(tUMINUS, 322);
138
+ ruby_method_id_check_for(tPOW, 323);
139
+ ruby_method_id_check_for(tCMP, 324);
140
+ ruby_method_id_check_for(tEQ, 325);
141
+ ruby_method_id_check_for(tEQQ, 326);
142
+ ruby_method_id_check_for(tNEQ, 327);
143
+ ruby_method_id_check_for(tGEQ, 328);
144
+ ruby_method_id_check_for(tLEQ, 329);
145
+ ruby_method_id_check_for(tANDOP, 330);
146
+ ruby_method_id_check_for(tOROP, 331);
147
+ ruby_method_id_check_for(tMATCH, 332);
148
+ ruby_method_id_check_for(tNMATCH, 333);
149
+ ruby_method_id_check_for(tDOT2, 334);
150
+ ruby_method_id_check_for(tDOT3, 335);
151
+ ruby_method_id_check_for(tAREF, 336);
152
+ ruby_method_id_check_for(tASET, 337);
153
+ ruby_method_id_check_for(tLSHFT, 338);
154
+ ruby_method_id_check_for(tRSHFT, 339);
155
+ ruby_method_id_check_for(tLAMBDA, 352);
156
+ ruby_method_id_check_for(idNULL, 365);
157
+ ruby_method_id_check_for(idRespond_to, 366);
158
+ ruby_method_id_check_for(idIFUNC, 367);
159
+ ruby_method_id_check_for(idCFUNC, 368);
160
+ ruby_method_id_check_for(id_core_set_method_alias, 369);
161
+ ruby_method_id_check_for(id_core_set_variable_alias, 370);
162
+ ruby_method_id_check_for(id_core_undef_method, 371);
163
+ ruby_method_id_check_for(id_core_define_method, 372);
164
+ ruby_method_id_check_for(id_core_define_singleton_method, 373);
165
+ ruby_method_id_check_for(id_core_set_postexe, 374);
166
+ ruby_method_id_check_for(tLAST_TOKEN, 375);
167
+ };
168
+ #endif
169
+
170
+ #endif /* RUBY_ID_H */
@@ -2,7 +2,7 @@
2
2
 
3
3
  iseq.h -
4
4
 
5
- $Author: ko1 $
5
+ $Author: mame $
6
6
  created at: 04/01/01 23:36:57 JST
7
7
 
8
8
  Copyright (C) 2004-2008 Koichi Sasada
@@ -12,7 +12,15 @@
12
12
  #ifndef RUBY_COMPILE_H
13
13
  #define RUBY_COMPILE_H
14
14
 
15
- VALUE iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt);
15
+ /* compile.c */
16
+ VALUE rb_iseq_compile_node(VALUE self, NODE *node);
17
+ int rb_iseq_translate_threaded_code(rb_iseq_t *iseq);
18
+ VALUE rb_iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args,
19
+ VALUE exception, VALUE body);
20
+
21
+ /* iseq.c */
22
+ VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
23
+ struct st_table *ruby_insn_make_insn_table(void);
16
24
 
17
25
  #define ISEQ_TYPE_TOP INT2FIX(1)
18
26
  #define ISEQ_TYPE_METHOD INT2FIX(2)
@@ -21,14 +29,15 @@ VALUE iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt);
21
29
  #define ISEQ_TYPE_RESCUE INT2FIX(5)
22
30
  #define ISEQ_TYPE_ENSURE INT2FIX(6)
23
31
  #define ISEQ_TYPE_EVAL INT2FIX(7)
24
- #define ISEQ_TYPE_DEFINED_GUARD INT2FIX(8)
32
+ #define ISEQ_TYPE_MAIN INT2FIX(8)
33
+ #define ISEQ_TYPE_DEFINED_GUARD INT2FIX(9)
25
34
 
26
- #define CATCH_TYPE_RESCUE INT2FIX(1)
27
- #define CATCH_TYPE_ENSURE INT2FIX(2)
28
- #define CATCH_TYPE_RETRY INT2FIX(3)
29
- #define CATCH_TYPE_BREAK INT2FIX(4)
30
- #define CATCH_TYPE_REDO INT2FIX(5)
31
- #define CATCH_TYPE_NEXT INT2FIX(6)
35
+ #define CATCH_TYPE_RESCUE ((int)INT2FIX(1))
36
+ #define CATCH_TYPE_ENSURE ((int)INT2FIX(2))
37
+ #define CATCH_TYPE_RETRY ((int)INT2FIX(3))
38
+ #define CATCH_TYPE_BREAK ((int)INT2FIX(4))
39
+ #define CATCH_TYPE_REDO ((int)INT2FIX(5))
40
+ #define CATCH_TYPE_NEXT ((int)INT2FIX(6))
32
41
 
33
42
  struct iseq_insn_info_entry {
34
43
  unsigned short position;
@@ -65,14 +74,15 @@ struct iseq_compile_data {
65
74
  struct iseq_label_data *end_label;
66
75
  struct iseq_label_data *redo_label;
67
76
  VALUE current_block;
68
- VALUE loopval_popped; /* used by NODE_BREAK */
69
77
  VALUE ensure_node;
70
78
  VALUE for_iseq;
71
79
  struct iseq_compile_data_ensure_node_stack *ensure_node_stack;
80
+ int loopval_popped; /* used by NODE_BREAK */
72
81
  int cached_const;
73
82
  struct iseq_compile_data_storage *storage_head;
74
83
  struct iseq_compile_data_storage *storage_current;
75
84
  int last_line;
85
+ int last_coverable_line;
76
86
  int flip_cnt;
77
87
  int label_no;
78
88
  int node_level;
@@ -0,0 +1,103 @@
1
+ /**********************************************************************
2
+
3
+ method.h -
4
+
5
+ $Author: ko1 $
6
+ created at: Wed Jul 15 20:02:33 2009
7
+
8
+ Copyright (C) 2009 Koichi Sasada
9
+
10
+ **********************************************************************/
11
+ #ifndef METHOD_H
12
+ #define METHOD_H
13
+
14
+ typedef enum {
15
+ NOEX_PUBLIC = 0x00,
16
+ NOEX_NOSUPER = 0x01,
17
+ NOEX_PRIVATE = 0x02,
18
+ NOEX_PROTECTED = 0x04,
19
+ NOEX_MASK = 0x06,
20
+ NOEX_BASIC = 0x08,
21
+ NOEX_UNDEF = NOEX_NOSUPER,
22
+ NOEX_MODFUNC = 0x12,
23
+ NOEX_SUPER = 0x20,
24
+ NOEX_VCALL = 0x40,
25
+ NOEX_RESPONDS = 0x80
26
+ } rb_method_flag_t;
27
+
28
+ #define NOEX_SAFE(n) ((int)((n) >> 8) & 0x0F)
29
+ #define NOEX_WITH(n, s) ((s << 8) | (n) | (ruby_running ? 0 : NOEX_BASIC))
30
+ #define NOEX_WITH_SAFE(n) NOEX_WITH(n, rb_safe_level())
31
+
32
+ /* method data type */
33
+
34
+ typedef enum {
35
+ VM_METHOD_TYPE_ISEQ,
36
+ VM_METHOD_TYPE_CFUNC,
37
+ VM_METHOD_TYPE_ATTRSET,
38
+ VM_METHOD_TYPE_IVAR,
39
+ VM_METHOD_TYPE_BMETHOD,
40
+ VM_METHOD_TYPE_ZSUPER,
41
+ VM_METHOD_TYPE_UNDEF,
42
+ VM_METHOD_TYPE_NOTIMPLEMENTED,
43
+ VM_METHOD_TYPE_OPTIMIZED, /* Kernel#send, Proc#call, etc */
44
+ VM_METHOD_TYPE_MISSING /* wrapper for method_missing(id) */
45
+ } rb_method_type_t;
46
+
47
+ typedef struct rb_method_cfunc_struct {
48
+ VALUE (*func)(ANYARGS);
49
+ int argc;
50
+ } rb_method_cfunc_t;
51
+
52
+ typedef struct rb_method_attr_struct {
53
+ ID id;
54
+ VALUE location;
55
+ } rb_method_attr_t;
56
+
57
+ typedef struct rb_iseq_struct rb_iseq_t;
58
+
59
+ typedef struct rb_method_definition_struct {
60
+ rb_method_type_t type; /* method type */
61
+ ID original_id;
62
+ union {
63
+ rb_iseq_t *iseq; /* should be mark */
64
+ rb_method_cfunc_t cfunc;
65
+ rb_method_attr_t attr;
66
+ VALUE proc; /* should be mark */
67
+ enum method_optimized_type {
68
+ OPTIMIZED_METHOD_TYPE_SEND,
69
+ OPTIMIZED_METHOD_TYPE_CALL
70
+ } optimize_type;
71
+ } body;
72
+ int alias_count;
73
+ } rb_method_definition_t;
74
+
75
+ typedef struct rb_method_entry_struct {
76
+ rb_method_flag_t flag;
77
+ char mark;
78
+ rb_method_definition_t *def;
79
+ ID called_id;
80
+ VALUE klass; /* should be mark */
81
+ } rb_method_entry_t;
82
+
83
+ struct unlinked_method_entry_list_entry {
84
+ struct unlinked_method_entry_list_entry *next;
85
+ rb_method_entry_t *me;
86
+ };
87
+
88
+ #define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
89
+
90
+ void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
91
+ rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);
92
+ rb_method_entry_t *rb_method_entry(VALUE klass, ID id);
93
+
94
+ rb_method_entry_t *rb_method_entry_get_without_cache(VALUE klass, ID id);
95
+ rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex);
96
+
97
+ int rb_method_entry_arity(const rb_method_entry_t *me);
98
+
99
+ void rb_mark_method_entry(const rb_method_entry_t *me);
100
+ void rb_free_method_entry(rb_method_entry_t *me);
101
+ void rb_sweep_method_entry(void *vm);
102
+
103
+ #endif /* METHOD_H */