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
@@ -192,7 +192,7 @@ typedef struct {
192
192
  AbsAddrType call_addr;
193
193
  /* for multiple call reference */
194
194
  OnigDistance min_len; /* min length (byte) */
195
- OnigDistance max_len; /* max length (byte) */
195
+ OnigDistance max_len; /* max length (byte) */
196
196
  int char_len; /* character length */
197
197
  int opt_count; /* referenced count in optimize_node_left() */
198
198
  } EncloseNode;
@@ -306,6 +306,9 @@ typedef struct {
306
306
  int curr_max_regnum;
307
307
  int has_recursion;
308
308
  #endif
309
+ int warnings_flag;
310
+ const char* sourcefile;
311
+ int sourceline;
309
312
  } ScanEnv;
310
313
 
311
314
 
@@ -0,0 +1 @@
1
+ #define RUBY_REVISION 34678
@@ -2,7 +2,7 @@
2
2
 
3
3
  thread_pthread.h -
4
4
 
5
- $Author: nobu $
5
+ $Author: naruse $
6
6
 
7
7
  Copyright (C) 2004-2007 Koichi Sasada
8
8
 
@@ -12,6 +12,9 @@
12
12
  #define RUBY_THREAD_PTHREAD_H
13
13
 
14
14
  #include <pthread.h>
15
+ #ifdef HAVE_PTHREAD_NP_H
16
+ #include <pthread_np.h>
17
+ #endif
15
18
  typedef pthread_t rb_thread_id_t;
16
19
  typedef pthread_mutex_t rb_thread_lock_t;
17
20
  typedef pthread_cond_t rb_thread_cond_t;
@@ -2,7 +2,7 @@
2
2
 
3
3
  thread_win32.h -
4
4
 
5
- $Author: usa $
5
+ $Author: akr $
6
6
 
7
7
  Copyright (C) 2004-2007 Koichi Sasada
8
8
 
@@ -0,0 +1,21 @@
1
+ #ifndef RUBY_TIMEV_H
2
+ #define RUBY_TIMEV_H
3
+
4
+ struct vtm {
5
+ VALUE year; /* 2000 for example. Integer. */
6
+ int mon; /* 1..12 */
7
+ int mday; /* 1..31 */
8
+ int hour; /* 0..23 */
9
+ int min; /* 0..59 */
10
+ int sec; /* 0..60 */
11
+ VALUE subsecx; /* 0 <= subsecx < TIME_SCALE. possibly Rational. */
12
+ VALUE utc_offset; /* -3600 as -01:00 for example. possibly Rational. */
13
+ int wday; /* 0:Sunday, 1:Monday, ..., 6:Saturday */
14
+ int yday; /* 1..366 */
15
+ int isdst; /* 0:StandardTime 1:DayLightSavingTime */
16
+ const char *zone; /* "JST", "EST", "EDT", etc. */
17
+ };
18
+
19
+ #define TIME_SCALE 1000000000
20
+
21
+ #endif
@@ -2,7 +2,7 @@
2
2
 
3
3
  transcode_data.h -
4
4
 
5
- $Author: akr $
5
+ $Author: duerst $
6
6
  created at: Mon 10 Dec 2007 14:01:47 JST 2007
7
7
 
8
8
  Copyright (C) 2007 Martin Duerst
@@ -22,7 +22,7 @@
22
22
 
23
23
  #define PType (unsigned int)
24
24
 
25
- #define NOMAP (PType 0x01) /* single byte direct map */
25
+ #define NOMAP (PType 0x01) /* direct map */
26
26
  #define ONEbt (0x02) /* one byte payload */
27
27
  #define TWObt (0x03) /* two bytes payload */
28
28
  #define THREEbt (0x05) /* three bytes payload */
@@ -35,21 +35,30 @@
35
35
  #define FUNio (PType 0x0E) /* function from info to output */
36
36
  #define FUNso (PType 0x0F) /* function from start to output */
37
37
  #define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
38
+ #define GB4bt (PType 0x12) /* GB18030 four bytes payload */
39
+ #define FUNsio (PType 0x13) /* function from start and info to output */
38
40
 
39
- #define STR1_LENGTH(byte_addr) (*(byte_addr) + 4)
41
+ #define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
40
42
  #define STR1_BYTEINDEX(w) ((w) >> 6)
41
43
  #define makeSTR1(bi) (((bi) << 6) | STR1)
42
44
  #define makeSTR1LEN(len) ((len)-4)
43
45
 
44
46
  #define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
45
47
  #define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
46
- #define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt)&0xffffffffU))
47
- #define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU))
48
+ #define o3(b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned int)(unsigned char)(b3))<<24)|THREEbt)&0xffffffffU))
49
+ #define o4(b0,b1,b2,b3) (PType(((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt)&0xffffffffU))
50
+ #define g4(b0,b1,b2,b3) (PType(((((unsigned char)(b0))<<8)|(((unsigned char)(b2))<<16)|((((unsigned char)(b1))&0x0f)<<24)|((((unsigned int)(unsigned char)(b3))&0x0f)<<28)|GB4bt)&0xffffffffU))
51
+ #define funsio(diff) (PType((((unsigned int)(diff))<<8)|FUNsio))
48
52
 
49
- #define getBT1(a) (((a)>> 8)&0xFF)
50
- #define getBT2(a) (((a)>>16)&0xFF)
51
- #define getBT3(a) (((a)>>24)&0xFF)
52
- #define getBT0(a) ((((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
53
+ #define getBT1(a) ((unsigned char)((a)>> 8))
54
+ #define getBT2(a) ((unsigned char)((a)>>16))
55
+ #define getBT3(a) ((unsigned char)((a)>>24))
56
+ #define getBT0(a) (((unsigned char)((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
57
+
58
+ #define getGB4bt0(a) ((unsigned char)((a)>> 8))
59
+ #define getGB4bt1(a) ((unsigned char)((a)>>24)&0x0F|0x30)
60
+ #define getGB4bt2(a) ((unsigned char)((a)>>16))
61
+ #define getGB4bt3(a) ((unsigned char)((a)>>28)&0x0F|0x30)
53
62
 
54
63
  #define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
55
64
 
@@ -62,7 +71,7 @@ typedef enum {
62
71
  asciicompat_converter, /* ASCII-compatible -> ASCII-compatible */
63
72
  asciicompat_decoder, /* ASCII-incompatible -> ASCII-compatible */
64
73
  asciicompat_encoder /* ASCII-compatible -> ASCII-incompatible */
65
- /* ASCII-incompatible -> ASCII-incompatible is intentionally ommitted. */
74
+ /* ASCII-incompatible -> ASCII-incompatible is intentionally omitted. */
66
75
  } rb_transcoder_asciicompat_type_t;
67
76
 
68
77
  typedef struct rb_transcoder rb_transcoder;
@@ -91,6 +100,7 @@ struct rb_transcoder {
91
100
  ssize_t (*finish_func)(void*, unsigned char*, size_t); /* -> output */
92
101
  ssize_t (*resetsize_func)(void*); /* -> len */
93
102
  ssize_t (*resetstate_func)(void*, unsigned char*, size_t); /* -> output */
103
+ ssize_t (*func_sio)(void*, const unsigned char*, size_t, VALUE, unsigned char*, size_t); /* start -> output */
94
104
  };
95
105
 
96
106
  void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);
@@ -0,0 +1,179 @@
1
+ rb_declare_transcoder("Big5", "UTF-8", "big5");
2
+ rb_declare_transcoder("UTF-8", "Big5", "big5");
3
+ rb_declare_transcoder("Big5-HKSCS", "UTF-8", "big5");
4
+ rb_declare_transcoder("UTF-8", "Big5-HKSCS", "big5");
5
+ rb_declare_transcoder("Big5-UAO", "UTF-8", "big5");
6
+ rb_declare_transcoder("UTF-8", "Big5-UAO", "big5");
7
+ rb_declare_transcoder("GB2312", "UTF-8", "chinese");
8
+ rb_declare_transcoder("GB12345", "UTF-8", "chinese");
9
+ rb_declare_transcoder("UTF-8", "GB2312", "chinese");
10
+ rb_declare_transcoder("UTF-8", "GB12345", "chinese");
11
+ rb_declare_transcoder("UTF8-DoCoMo", "UTF8-KDDI", "emoji");
12
+ rb_declare_transcoder("UTF8-DoCoMo", "UTF8-SoftBank", "emoji");
13
+ rb_declare_transcoder("UTF8-DoCoMo", "UTF-8", "emoji");
14
+ rb_declare_transcoder("UTF8-KDDI", "UTF8-DoCoMo", "emoji");
15
+ rb_declare_transcoder("UTF8-KDDI", "UTF8-SoftBank", "emoji");
16
+ rb_declare_transcoder("UTF8-KDDI", "UTF-8", "emoji");
17
+ rb_declare_transcoder("UTF8-SoftBank", "UTF8-DoCoMo", "emoji");
18
+ rb_declare_transcoder("UTF8-SoftBank", "UTF8-KDDI", "emoji");
19
+ rb_declare_transcoder("UTF8-SoftBank", "UTF-8", "emoji");
20
+ rb_declare_transcoder("UTF-8", "UTF8-DoCoMo", "emoji");
21
+ rb_declare_transcoder("UTF-8", "UTF8-KDDI", "emoji");
22
+ rb_declare_transcoder("UTF-8", "UTF8-SoftBank", "emoji");
23
+ rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "UTF8-KDDI", "emoji_iso2022_kddi");
24
+ rb_declare_transcoder("UTF8-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
25
+ rb_declare_transcoder("ISO-2022-JP-KDDI", "stateless-ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
26
+ rb_declare_transcoder("stateless-ISO-2022-JP-KDDI", "ISO-2022-JP-KDDI", "emoji_iso2022_kddi");
27
+ rb_declare_transcoder("SJIS-DOCOMO", "UTF8-DOCOMO", "emoji_sjis_docomo");
28
+ rb_declare_transcoder("UTF8-DOCOMO", "SJIS-DOCOMO", "emoji_sjis_docomo");
29
+ rb_declare_transcoder("SJIS-KDDI", "UTF8-KDDI", "emoji_sjis_kddi");
30
+ rb_declare_transcoder("UTF8-KDDI", "SJIS-KDDI", "emoji_sjis_kddi");
31
+ rb_declare_transcoder("SJIS-SoftBank", "UTF8-SoftBank", "emoji_sjis_softbank");
32
+ rb_declare_transcoder("UTF8-SoftBank", "SJIS-SoftBank", "emoji_sjis_softbank");
33
+ rb_declare_transcoder("", "amp_escape", "escape");
34
+ rb_declare_transcoder("", "xml_text_escape", "escape");
35
+ rb_declare_transcoder("", "xml_attr_content_escape", "escape");
36
+ rb_declare_transcoder("", "xml_attr_quote", "escape");
37
+ rb_declare_transcoder("GB18030", "UTF-8", "gb18030");
38
+ rb_declare_transcoder("UTF-8", "GB18030", "gb18030");
39
+ rb_declare_transcoder("GBK", "UTF-8", "gbk");
40
+ rb_declare_transcoder("UTF-8", "GBK", "gbk");
41
+ rb_declare_transcoder("ISO-2022-JP", "stateless-ISO-2022-JP", "iso2022");
42
+ rb_declare_transcoder("stateless-ISO-2022-JP", "ISO-2022-JP", "iso2022");
43
+ rb_declare_transcoder("stateless-ISO-2022-JP", "EUC-JP", "iso2022");
44
+ rb_declare_transcoder("EUC-JP", "stateless-ISO-2022-JP", "iso2022");
45
+ rb_declare_transcoder("CP50220", "cp51932", "iso2022");
46
+ rb_declare_transcoder("CP50221", "cp51932", "iso2022");
47
+ rb_declare_transcoder("CP51932", "CP50221", "iso2022");
48
+ rb_declare_transcoder("CP51932", "CP50220", "iso2022");
49
+ rb_declare_transcoder("EUC-JP", "Shift_JIS", "japanese");
50
+ rb_declare_transcoder("Shift_JIS", "EUC-JP", "japanese");
51
+ rb_declare_transcoder("EUC-JP", "UTF-8", "japanese_euc");
52
+ rb_declare_transcoder("eucJP-ms", "UTF-8", "japanese_euc");
53
+ rb_declare_transcoder("CP51932", "UTF-8", "japanese_euc");
54
+ rb_declare_transcoder("UTF-8", "EUC-JP", "japanese_euc");
55
+ rb_declare_transcoder("UTF-8", "eucJP-ms", "japanese_euc");
56
+ rb_declare_transcoder("UTF-8", "CP51932", "japanese_euc");
57
+ rb_declare_transcoder("Shift_JIS", "UTF-8", "japanese_sjis");
58
+ rb_declare_transcoder("Windows-31J", "UTF-8", "japanese_sjis");
59
+ rb_declare_transcoder("UTF-8", "Shift_JIS", "japanese_sjis");
60
+ rb_declare_transcoder("UTF-8", "Windows-31J", "japanese_sjis");
61
+ rb_declare_transcoder("UTF-8", "EUC-KR", "korean");
62
+ rb_declare_transcoder("EUC-KR", "UTF-8", "korean");
63
+ rb_declare_transcoder("UTF-8", "CP949", "korean");
64
+ rb_declare_transcoder("CP949", "UTF-8", "korean");
65
+ rb_declare_transcoder("", "universal_newline", "newline");
66
+ rb_declare_transcoder("", "crlf_newline", "newline");
67
+ rb_declare_transcoder("", "cr_newline", "newline");
68
+ rb_declare_transcoder("US-ASCII", "UTF-8", "single_byte");
69
+ rb_declare_transcoder("UTF-8", "US-ASCII", "single_byte");
70
+ rb_declare_transcoder("ASCII-8BIT", "UTF-8", "single_byte");
71
+ rb_declare_transcoder("UTF-8", "ASCII-8BIT", "single_byte");
72
+ rb_declare_transcoder("ISO-8859-1", "UTF-8", "single_byte");
73
+ rb_declare_transcoder("UTF-8", "ISO-8859-1", "single_byte");
74
+ rb_declare_transcoder("ISO-8859-2", "UTF-8", "single_byte");
75
+ rb_declare_transcoder("UTF-8", "ISO-8859-2", "single_byte");
76
+ rb_declare_transcoder("ISO-8859-3", "UTF-8", "single_byte");
77
+ rb_declare_transcoder("UTF-8", "ISO-8859-3", "single_byte");
78
+ rb_declare_transcoder("ISO-8859-4", "UTF-8", "single_byte");
79
+ rb_declare_transcoder("UTF-8", "ISO-8859-4", "single_byte");
80
+ rb_declare_transcoder("ISO-8859-5", "UTF-8", "single_byte");
81
+ rb_declare_transcoder("UTF-8", "ISO-8859-5", "single_byte");
82
+ rb_declare_transcoder("ISO-8859-6", "UTF-8", "single_byte");
83
+ rb_declare_transcoder("UTF-8", "ISO-8859-6", "single_byte");
84
+ rb_declare_transcoder("ISO-8859-7", "UTF-8", "single_byte");
85
+ rb_declare_transcoder("UTF-8", "ISO-8859-7", "single_byte");
86
+ rb_declare_transcoder("ISO-8859-8", "UTF-8", "single_byte");
87
+ rb_declare_transcoder("UTF-8", "ISO-8859-8", "single_byte");
88
+ rb_declare_transcoder("ISO-8859-9", "UTF-8", "single_byte");
89
+ rb_declare_transcoder("UTF-8", "ISO-8859-9", "single_byte");
90
+ rb_declare_transcoder("ISO-8859-10", "UTF-8", "single_byte");
91
+ rb_declare_transcoder("UTF-8", "ISO-8859-10", "single_byte");
92
+ rb_declare_transcoder("ISO-8859-11", "UTF-8", "single_byte");
93
+ rb_declare_transcoder("UTF-8", "ISO-8859-11", "single_byte");
94
+ rb_declare_transcoder("ISO-8859-13", "UTF-8", "single_byte");
95
+ rb_declare_transcoder("UTF-8", "ISO-8859-13", "single_byte");
96
+ rb_declare_transcoder("ISO-8859-14", "UTF-8", "single_byte");
97
+ rb_declare_transcoder("UTF-8", "ISO-8859-14", "single_byte");
98
+ rb_declare_transcoder("ISO-8859-15", "UTF-8", "single_byte");
99
+ rb_declare_transcoder("UTF-8", "ISO-8859-15", "single_byte");
100
+ rb_declare_transcoder("WINDOWS-874", "UTF-8", "single_byte");
101
+ rb_declare_transcoder("UTF-8", "WINDOWS-874", "single_byte");
102
+ rb_declare_transcoder("WINDOWS-1250", "UTF-8", "single_byte");
103
+ rb_declare_transcoder("UTF-8", "WINDOWS-1250", "single_byte");
104
+ rb_declare_transcoder("WINDOWS-1251", "UTF-8", "single_byte");
105
+ rb_declare_transcoder("UTF-8", "WINDOWS-1251", "single_byte");
106
+ rb_declare_transcoder("WINDOWS-1252", "UTF-8", "single_byte");
107
+ rb_declare_transcoder("UTF-8", "WINDOWS-1252", "single_byte");
108
+ rb_declare_transcoder("WINDOWS-1253", "UTF-8", "single_byte");
109
+ rb_declare_transcoder("UTF-8", "WINDOWS-1253", "single_byte");
110
+ rb_declare_transcoder("WINDOWS-1254", "UTF-8", "single_byte");
111
+ rb_declare_transcoder("UTF-8", "WINDOWS-1254", "single_byte");
112
+ rb_declare_transcoder("WINDOWS-1255", "UTF-8", "single_byte");
113
+ rb_declare_transcoder("UTF-8", "WINDOWS-1255", "single_byte");
114
+ rb_declare_transcoder("WINDOWS-1256", "UTF-8", "single_byte");
115
+ rb_declare_transcoder("UTF-8", "WINDOWS-1256", "single_byte");
116
+ rb_declare_transcoder("WINDOWS-1257", "UTF-8", "single_byte");
117
+ rb_declare_transcoder("UTF-8", "WINDOWS-1257", "single_byte");
118
+ rb_declare_transcoder("IBM437", "UTF-8", "single_byte");
119
+ rb_declare_transcoder("UTF-8", "IBM437", "single_byte");
120
+ rb_declare_transcoder("IBM775", "UTF-8", "single_byte");
121
+ rb_declare_transcoder("UTF-8", "IBM775", "single_byte");
122
+ rb_declare_transcoder("IBM852", "UTF-8", "single_byte");
123
+ rb_declare_transcoder("UTF-8", "IBM852", "single_byte");
124
+ rb_declare_transcoder("IBM855", "UTF-8", "single_byte");
125
+ rb_declare_transcoder("UTF-8", "IBM855", "single_byte");
126
+ rb_declare_transcoder("IBM857", "UTF-8", "single_byte");
127
+ rb_declare_transcoder("UTF-8", "IBM857", "single_byte");
128
+ rb_declare_transcoder("IBM860", "UTF-8", "single_byte");
129
+ rb_declare_transcoder("UTF-8", "IBM860", "single_byte");
130
+ rb_declare_transcoder("IBM861", "UTF-8", "single_byte");
131
+ rb_declare_transcoder("UTF-8", "IBM861", "single_byte");
132
+ rb_declare_transcoder("IBM862", "UTF-8", "single_byte");
133
+ rb_declare_transcoder("UTF-8", "IBM862", "single_byte");
134
+ rb_declare_transcoder("IBM863", "UTF-8", "single_byte");
135
+ rb_declare_transcoder("UTF-8", "IBM863", "single_byte");
136
+ rb_declare_transcoder("IBM865", "UTF-8", "single_byte");
137
+ rb_declare_transcoder("UTF-8", "IBM865", "single_byte");
138
+ rb_declare_transcoder("IBM866", "UTF-8", "single_byte");
139
+ rb_declare_transcoder("UTF-8", "IBM866", "single_byte");
140
+ rb_declare_transcoder("IBM869", "UTF-8", "single_byte");
141
+ rb_declare_transcoder("UTF-8", "IBM869", "single_byte");
142
+ rb_declare_transcoder("MACCROATIAN", "UTF-8", "single_byte");
143
+ rb_declare_transcoder("UTF-8", "MACCROATIAN", "single_byte");
144
+ rb_declare_transcoder("MACCYRILLIC", "UTF-8", "single_byte");
145
+ rb_declare_transcoder("UTF-8", "MACCYRILLIC", "single_byte");
146
+ rb_declare_transcoder("MACGREEK", "UTF-8", "single_byte");
147
+ rb_declare_transcoder("UTF-8", "MACGREEK", "single_byte");
148
+ rb_declare_transcoder("MACICELAND", "UTF-8", "single_byte");
149
+ rb_declare_transcoder("UTF-8", "MACICELAND", "single_byte");
150
+ rb_declare_transcoder("MACROMAN", "UTF-8", "single_byte");
151
+ rb_declare_transcoder("UTF-8", "MACROMAN", "single_byte");
152
+ rb_declare_transcoder("MACROMANIA", "UTF-8", "single_byte");
153
+ rb_declare_transcoder("UTF-8", "MACROMANIA", "single_byte");
154
+ rb_declare_transcoder("MACTURKISH", "UTF-8", "single_byte");
155
+ rb_declare_transcoder("UTF-8", "MACTURKISH", "single_byte");
156
+ rb_declare_transcoder("MACUKRAINE", "UTF-8", "single_byte");
157
+ rb_declare_transcoder("UTF-8", "MACUKRAINE", "single_byte");
158
+ rb_declare_transcoder("KOI8-U", "UTF-8", "single_byte");
159
+ rb_declare_transcoder("UTF-8", "KOI8-U", "single_byte");
160
+ rb_declare_transcoder("KOI8-R", "UTF-8", "single_byte");
161
+ rb_declare_transcoder("UTF-8", "KOI8-R", "single_byte");
162
+ rb_declare_transcoder("TIS-620", "UTF-8", "single_byte");
163
+ rb_declare_transcoder("UTF-8", "TIS-620", "single_byte");
164
+ rb_declare_transcoder("CP850", "UTF-8", "single_byte");
165
+ rb_declare_transcoder("UTF-8", "CP850", "single_byte");
166
+ rb_declare_transcoder("CP852", "UTF-8", "single_byte");
167
+ rb_declare_transcoder("UTF-8", "CP852", "single_byte");
168
+ rb_declare_transcoder("CP855", "UTF-8", "single_byte");
169
+ rb_declare_transcoder("UTF-8", "CP855", "single_byte");
170
+ rb_declare_transcoder("UTF-8", "UTF8-MAC", "utf8_mac");
171
+ rb_declare_transcoder("UTF8-MAC", "UTF-8", "utf8_mac");
172
+ rb_declare_transcoder("UTF-16BE", "UTF-8", "utf_16_32");
173
+ rb_declare_transcoder("UTF-8", "UTF-16BE", "utf_16_32");
174
+ rb_declare_transcoder("UTF-16LE", "UTF-8", "utf_16_32");
175
+ rb_declare_transcoder("UTF-8", "UTF-16LE", "utf_16_32");
176
+ rb_declare_transcoder("UTF-32BE", "UTF-8", "utf_16_32");
177
+ rb_declare_transcoder("UTF-8", "UTF-32BE", "utf_16_32");
178
+ rb_declare_transcoder("UTF-32LE", "UTF-8", "utf_16_32");
179
+ rb_declare_transcoder("UTF-8", "UTF-32LE", "utf_16_32");
@@ -0,0 +1,55 @@
1
+ #define RUBY_VERSION "1.9.2"
2
+ #define RUBY_PATCHLEVEL 318
3
+ #define RUBY_VERSION_MAJOR 1
4
+ #define RUBY_VERSION_MINOR 9
5
+ #define RUBY_VERSION_TEENY 1
6
+
7
+ #define RUBY_RELEASE_YEAR 2012
8
+ #define RUBY_RELEASE_MONTH 2
9
+ #define RUBY_RELEASE_DAY 14
10
+ #define RUBY_RELEASE_DATE "2012-02-14"
11
+
12
+ #include "ruby/version.h"
13
+
14
+ #if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE
15
+ # if RUBY_LIB_VERSION_STYLE == 3
16
+ # define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)"."STRINGIZE(RUBY_VERSION_TEENY)
17
+ # elif RUBY_LIB_VERSION_STYLE == 2
18
+ # define RUBY_LIB_VERSION STRINGIZE(RUBY_VERSION_MAJOR)"."STRINGIZE(RUBY_VERSION_MINOR)
19
+ # endif
20
+ #endif
21
+
22
+ #if RUBY_PATCHLEVEL == -1
23
+ #define RUBY_PATCHLEVEL_STR "dev"
24
+ #else
25
+ #define RUBY_PATCHLEVEL_STR "p"STRINGIZE(RUBY_PATCHLEVEL)
26
+ #endif
27
+
28
+ #ifndef RUBY_REVISION
29
+ # include "revision.h"
30
+ #endif
31
+ # ifndef RUBY_REVISION
32
+ # define RUBY_REVISION 0
33
+ #endif
34
+
35
+ #if RUBY_REVISION
36
+ # ifdef RUBY_BRANCH_NAME
37
+ # define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "STRINGIZE(RUBY_REVISION)
38
+ # else
39
+ # define RUBY_REVISION_STR " revision "STRINGIZE(RUBY_REVISION)
40
+ # endif
41
+ #else
42
+ # define RUBY_REVISION_STR ""
43
+ #endif
44
+
45
+ # define RUBY_DESCRIPTION \
46
+ "ruby "RUBY_VERSION \
47
+ RUBY_PATCHLEVEL_STR \
48
+ " ("RUBY_RELEASE_DATE \
49
+ RUBY_REVISION_STR") " \
50
+ "["RUBY_PLATFORM"]"
51
+ # define RUBY_COPYRIGHT \
52
+ "ruby - Copyright (C) " \
53
+ STRINGIZE(RUBY_BIRTH_YEAR)"-" \
54
+ STRINGIZE(RUBY_RELEASE_YEAR)" " \
55
+ RUBY_AUTHOR
@@ -1,8 +1,8 @@
1
1
  /**********************************************************************
2
2
 
3
- vm_core.h -
3
+ vm_core.h -
4
4
 
5
- $Author: ko1 $
5
+ $Author: yugui $
6
6
  created at: 04/01/01 19:41:38 JST
7
7
 
8
8
  Copyright (C) 2004-2007 Koichi Sasada
@@ -15,13 +15,13 @@
15
15
  #define RUBY_VM_THREAD_MODEL 2
16
16
 
17
17
  #include "ruby/ruby.h"
18
- #include "ruby/vm.h"
19
18
  #include "ruby/st.h"
20
19
 
21
20
  #include "node.h"
22
21
  #include "debug.h"
23
22
  #include "vm_opts.h"
24
23
  #include "id.h"
24
+ #include "method.h"
25
25
 
26
26
  #if defined(_WIN32)
27
27
  #include "thread_win32.h"
@@ -31,17 +31,26 @@
31
31
  #error "unsupported thread type"
32
32
  #endif
33
33
 
34
+ #ifndef ENABLE_VM_OBJSPACE
35
+ #ifdef _WIN32
36
+ /*
37
+ * TODO: object space indenpendent st_table.
38
+ * socklist needs st_table in rb_w32_sysinit(), before object space
39
+ * initialization.
40
+ * It is too early now to change st_hash_type, since it breaks binary
41
+ * compatibility.
42
+ */
43
+ #define ENABLE_VM_OBJSPACE 0
44
+ #else
45
+ #define ENABLE_VM_OBJSPACE 1
46
+ #endif
47
+ #endif
48
+
34
49
  #include <setjmp.h>
35
50
  #include <signal.h>
36
51
 
37
52
  #ifndef NSIG
38
- # ifdef DJGPP
39
- # define NSIG SIGMAX
40
- # elif defined MACOS_UNUSE_SIGNAL
41
- # define NSIG 1
42
- # else
43
- # define NSIG (_SIGMAX + 1) /* For QNX */
44
- # endif
53
+ # define NSIG (_SIGMAX + 1) /* For QNX */
45
54
  #endif
46
55
 
47
56
  #define RUBY_NSIG NSIG
@@ -54,6 +63,10 @@
54
63
  #define va_init_list(a,b) va_start(a)
55
64
  #endif
56
65
 
66
+ #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
67
+ #define USE_SIGALTSTACK
68
+ #endif
69
+
57
70
  /*****************/
58
71
  /* configuration */
59
72
  /*****************/
@@ -97,8 +110,16 @@
97
110
  #define UNLIKELY(x) (x)
98
111
  #endif /* __GNUC__ >= 3 */
99
112
 
113
+ #if __GNUC__ >= 3
114
+ #define UNINITIALIZED_VAR(x) x = x
115
+ #else
116
+ #define UNINITIALIZED_VAR(x) x
117
+ #endif
118
+
100
119
  typedef unsigned long rb_num_t;
101
120
 
121
+ /* iseq data type */
122
+
102
123
  struct iseq_compile_data_ensure_node_stack;
103
124
 
104
125
  typedef struct rb_compile_option_struct {
@@ -113,6 +134,16 @@ typedef struct rb_compile_option_struct {
113
134
  int debug_level;
114
135
  } rb_compile_option_t;
115
136
 
137
+ struct iseq_inline_cache_entry {
138
+ VALUE ic_vmstat;
139
+ VALUE ic_class;
140
+ union {
141
+ VALUE value;
142
+ rb_method_entry_t *method;
143
+ long index;
144
+ } ic_value;
145
+ };
146
+
116
147
  #if 1
117
148
  #define GetCoreDataFromValue(obj, type, ptr) do { \
118
149
  ptr = (type*)DATA_PTR(obj); \
@@ -134,21 +165,26 @@ struct rb_iseq_struct {
134
165
  VALUE type; /* instruction sequence type */
135
166
  VALUE name; /* String: iseq name */
136
167
  VALUE filename; /* file information where this sequence from */
168
+ VALUE filepath; /* real file path or nil */
137
169
  VALUE *iseq; /* iseq (insn number and openrads) */
138
170
  VALUE *iseq_encoded; /* encoded iseq */
139
171
  unsigned long iseq_size;
140
172
  VALUE mark_ary; /* Array: includes operands which should be GC marked */
141
173
  VALUE coverage; /* coverage array */
174
+ unsigned short line_no;
142
175
 
143
176
  /* insn info, must be freed */
144
177
  struct iseq_insn_info_entry *insn_info_table;
145
- unsigned long insn_info_size;
178
+ size_t insn_info_size;
146
179
 
147
180
  ID *local_table; /* must free */
148
181
  int local_table_size;
149
182
 
150
183
  /* method, class frame: sizeof(vars) + 1, block frame: sizeof(vars) */
151
- int local_size;
184
+ int local_size;
185
+
186
+ struct iseq_inline_cache_entry *ic_entries;
187
+ int ic_size;
152
188
 
153
189
  /**
154
190
  * argument information
@@ -183,7 +219,7 @@ struct rb_iseq_struct {
183
219
  int arg_size;
184
220
  VALUE *arg_opt_table;
185
221
 
186
- int stack_max; /* for stack overflow check */
222
+ size_t stack_max; /* for stack overflow check */
187
223
 
188
224
  /* catch table */
189
225
  struct iseq_catch_table_entry *catch_table;
@@ -201,7 +237,7 @@ struct rb_iseq_struct {
201
237
  VALUE orig; /* non-NULL if its data have origin */
202
238
 
203
239
  /* block inlining */
204
- /*
240
+ /*
205
241
  * NODE *node;
206
242
  * void *special_block_builder;
207
243
  * void *cached_special_block_builder;
@@ -226,13 +262,15 @@ enum ruby_special_exceptions {
226
262
  ruby_special_error_count
227
263
  };
228
264
 
229
- typedef struct rb_iseq_struct rb_iseq_t;
230
-
231
265
  #define GetVMPtr(obj, ptr) \
232
266
  GetCoreDataFromValue(obj, rb_vm_t, ptr)
233
267
 
234
- struct rb_vm_struct
235
- {
268
+ #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
269
+ struct rb_objspace;
270
+ void rb_objspace_free(struct rb_objspace *);
271
+ #endif
272
+
273
+ typedef struct rb_vm_struct {
236
274
  VALUE self;
237
275
 
238
276
  rb_thread_lock_t global_vm_lock;
@@ -258,7 +296,7 @@ struct rb_vm_struct
258
296
  VALUE load_path;
259
297
  VALUE loaded_features;
260
298
  struct st_table *loading_table;
261
-
299
+
262
300
  /* signal */
263
301
  struct {
264
302
  VALUE cmd;
@@ -273,10 +311,12 @@ struct rb_vm_struct
273
311
  VALUE verbose, debug, progname;
274
312
  VALUE coverages;
275
313
 
314
+ struct unlinked_method_entry_list_entry *unlinked_method_entry_list;
315
+
276
316
  #if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
277
317
  struct rb_objspace *objspace;
278
318
  #endif
279
- };
319
+ } rb_vm_t;
280
320
 
281
321
  typedef struct {
282
322
  VALUE *pc; /* cfp[0] */
@@ -289,8 +329,7 @@ typedef struct {
289
329
  VALUE *dfp; /* cfp[7] / block[2] */
290
330
  rb_iseq_t *block_iseq; /* cfp[8] / block[3] */
291
331
  VALUE proc; /* cfp[9] / block[4] */
292
- ID method_id; /* cfp[10] saved in special case */
293
- VALUE method_class; /* cfp[11] saved in special case */
332
+ const rb_method_entry_t *me;/* cfp[10] */
294
333
  } rb_control_frame_t;
295
334
 
296
335
  typedef struct rb_block_struct {
@@ -321,8 +360,8 @@ struct rb_vm_tag {
321
360
  struct rb_vm_tag *prev;
322
361
  };
323
362
 
324
- struct rb_vm_trap_tag {
325
- struct rb_vm_trap_tag *prev;
363
+ struct rb_vm_protect_tag {
364
+ struct rb_vm_protect_tag *prev;
326
365
  };
327
366
 
328
367
  #define RUBY_VM_VALUE_CACHE_SIZE 0x1000
@@ -347,12 +386,15 @@ typedef struct rb_thread_struct
347
386
  int safe_level;
348
387
  int raised_flag;
349
388
  VALUE last_status; /* $? */
350
-
389
+
351
390
  /* passing state */
352
391
  int state;
353
392
 
354
393
  /* for rb_iterate */
355
- rb_block_t *passed_block;
394
+ const rb_block_t *passed_block;
395
+
396
+ /* for bmethod */
397
+ const rb_method_entry_t *passed_me;
356
398
 
357
399
  /* for load(true) */
358
400
  VALUE top_self;
@@ -371,23 +413,23 @@ typedef struct rb_thread_struct
371
413
  int slice;
372
414
 
373
415
  native_thread_data_t native_thread_data;
416
+ void *blocking_region_buffer;
374
417
 
375
418
  VALUE thgroup;
376
419
  VALUE value;
377
420
 
378
421
  VALUE errinfo;
379
422
  VALUE thrown_errinfo;
380
- int exec_signal;
381
423
 
382
424
  int interrupt_flag;
383
425
  rb_thread_lock_t interrupt_lock;
384
426
  struct rb_unblock_callback unblock;
385
427
  VALUE locking_mutex;
386
428
  struct rb_mutex_struct *keeping_mutexes;
387
- int transition_for_lock;
429
+ volatile int transition_for_lock;
388
430
 
389
431
  struct rb_vm_tag *tag;
390
- struct rb_vm_trap_tag *trap_tag;
432
+ struct rb_vm_protect_tag *protect_tag;
391
433
 
392
434
  int parse_in_eval;
393
435
  int mild_compile_error;
@@ -434,16 +476,20 @@ typedef struct rb_thread_struct
434
476
  /* misc */
435
477
  int method_missing_reason;
436
478
  int abort_on_exception;
479
+ #ifdef USE_SIGALTSTACK
480
+ void *altstack;
481
+ #endif
437
482
  } rb_thread_t;
438
483
 
439
484
  /* iseq.c */
440
- VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE);
441
- VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE parent);
442
- VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE);
443
- VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, const rb_compile_option_t*);
485
+ VALUE rb_iseq_new(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE);
486
+ VALUE rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE filepath, VALUE parent);
487
+ VALUE rb_iseq_new_main(NODE *node, VALUE filename, VALUE filepath);
488
+ VALUE rb_iseq_new_with_bopt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
489
+ VALUE rb_iseq_new_with_opt(NODE*, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, const rb_compile_option_t*);
444
490
  VALUE rb_iseq_compile(VALUE src, VALUE file, VALUE line);
445
- VALUE ruby_iseq_disasm(VALUE self);
446
- VALUE ruby_iseq_disasm_insn(VALUE str, VALUE *iseqval, int pos, rb_iseq_t *iseq, VALUE child);
491
+ VALUE rb_iseq_disasm(VALUE self);
492
+ int rb_iseq_disasm_insn(VALUE str, VALUE *iseqval, size_t pos, rb_iseq_t *iseq, VALUE child);
447
493
  const char *ruby_node_name(int node);
448
494
  int rb_iseq_first_lineno(rb_iseq_t *iseq);
449
495
 
@@ -455,11 +501,6 @@ RUBY_EXTERN VALUE rb_mRubyVMFrozenCore;
455
501
  /* each thread has this size stack : 128KB */
456
502
  #define RUBY_VM_THREAD_STACK_SIZE (128 * 1024)
457
503
 
458
- struct global_entry {
459
- struct global_variable *var;
460
- ID id;
461
- };
462
-
463
504
  #define GetProcPtr(obj, ptr) \
464
505
  GetCoreDataFromValue(obj, rb_proc_t, ptr)
465
506
 
@@ -489,9 +530,10 @@ typedef struct {
489
530
 
490
531
  typedef struct {
491
532
  VALUE env;
533
+ VALUE filename;
534
+ unsigned short line_no;
492
535
  } rb_binding_t;
493
536
 
494
-
495
537
  /* used by compile time and send insn */
496
538
  #define VM_CALL_ARGS_SPLAT_BIT (0x01 << 1)
497
539
  #define VM_CALL_ARGS_BLOCKARG_BIT (0x01 << 2)
@@ -500,10 +542,11 @@ typedef struct {
500
542
  #define VM_CALL_TAILCALL_BIT (0x01 << 5)
501
543
  #define VM_CALL_TAILRECURSION_BIT (0x01 << 6)
502
544
  #define VM_CALL_SUPER_BIT (0x01 << 7)
503
- #define VM_CALL_SEND_BIT (0x01 << 8)
545
+ #define VM_CALL_OPT_SEND_BIT (0x01 << 8)
504
546
 
505
- #define VM_SPECIAL_OBJECT_VMCORE 0x01
506
- #define VM_SPECIAL_OBJECT_CBASE 0x02
547
+ #define VM_SPECIAL_OBJECT_VMCORE 0x01
548
+ #define VM_SPECIAL_OBJECT_CBASE 0x02
549
+ #define VM_SPECIAL_OBJECT_CONST_BASE 0x03
507
550
 
508
551
  #define VM_FRAME_MAGIC_METHOD 0x11
509
552
  #define VM_FRAME_MAGIC_BLOCK 0x21
@@ -523,19 +566,17 @@ typedef struct {
523
566
  /* other frame flag */
524
567
  #define VM_FRAME_FLAG_PASSED 0x0100
525
568
 
526
-
527
569
  #define RUBYVM_CFUNC_FRAME_P(cfp) \
528
570
  (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC)
529
571
 
572
+ /* inline cache */
573
+ typedef struct iseq_inline_cache_entry *IC;
530
574
 
531
- /* inline (method|const) cache */
532
- #define NEW_INLINE_CACHE_ENTRY() NEW_WHILE(Qundef, 0, 0)
533
- #define ic_class u1.value
534
- #define ic_method u2.node
535
- #define ic_value u2.value
536
- #define ic_vmstat u3.cnt
537
- typedef NODE *IC;
575
+ extern VALUE ruby_vm_global_state_version;
538
576
 
577
+ #define GET_VM_STATE_VERSION() (ruby_vm_global_state_version)
578
+ #define INC_VM_STATE_VERSION() \
579
+ (ruby_vm_global_state_version = (ruby_vm_global_state_version+1) & 0x8fffffff)
539
580
  void rb_vm_change_state(void);
540
581
 
541
582
  typedef VALUE CDHASH;
@@ -564,8 +605,6 @@ typedef rb_control_frame_t *
564
605
  #define RUBY_VM_NORMAL_ISEQ_P(ptr) \
565
606
  (ptr && !RUBY_VM_IFUNC_P(ptr))
566
607
 
567
- #define RUBY_VM_CLASS_SPECIAL_P(ptr) (((VALUE)(ptr)) & 0x02)
568
-
569
608
  #define RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp) ((rb_block_t *)(&(cfp)->self))
570
609
  #define RUBY_VM_GET_CFP_FROM_BLOCK_PTR(b) \
571
610
  ((rb_control_frame_t *)((VALUE *)(b) - 5))
@@ -575,28 +614,42 @@ VALUE rb_thread_alloc(VALUE klass);
575
614
  VALUE rb_proc_alloc(VALUE klass);
576
615
 
577
616
  /* for debug */
578
- extern void vm_stack_dump_raw(rb_thread_t *, rb_control_frame_t *);
579
- #define SDR() vm_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
580
- #define SDR2(cfp) vm_stack_dump_raw(GET_THREAD(), (cfp))
617
+ extern void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *);
618
+ #define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp)
619
+ #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_THREAD(), (cfp))
581
620
  void rb_vm_bugreport(void);
582
621
 
583
-
584
622
  /* functions about thread/vm execution */
585
-
586
623
  VALUE rb_iseq_eval(VALUE iseqval);
624
+ VALUE rb_iseq_eval_main(VALUE iseqval);
587
625
  void rb_enable_interrupt(void);
588
626
  void rb_disable_interrupt(void);
589
627
  int rb_thread_method_id_and_class(rb_thread_t *th, ID *idp, VALUE *klassp);
590
628
 
591
- VALUE vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
592
- int argc, const VALUE *argv, rb_block_t *blockptr);
593
- VALUE vm_make_proc(rb_thread_t *th, rb_control_frame_t *cfp, const rb_block_t *block, VALUE klass);
594
- VALUE vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
629
+ VALUE rb_vm_invoke_proc(rb_thread_t *th, rb_proc_t *proc, VALUE self,
630
+ int argc, const VALUE *argv, const rb_block_t *blockptr);
631
+ VALUE rb_vm_make_proc(rb_thread_t *th, const rb_block_t *block, VALUE klass);
632
+ VALUE rb_vm_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp);
633
+
634
+ void rb_thread_start_timer_thread(void);
635
+ void rb_thread_stop_timer_thread(void);
636
+ void rb_thread_reset_timer_thread(void);
637
+ void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
638
+ int ruby_thread_has_gvl_p(void);
639
+ VALUE rb_make_backtrace(void);
640
+ typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
641
+ int rb_backtrace_each(rb_backtrace_iter_func *iter, void *arg);
642
+ rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(rb_thread_t *th, rb_control_frame_t *cfp);
643
+ int rb_vm_get_sourceline(const rb_control_frame_t *);
644
+ VALUE rb_name_err_mesg_new(VALUE obj, VALUE mesg, VALUE recv, VALUE method);
595
645
 
596
646
  NOINLINE(void rb_gc_save_machine_context(rb_thread_t *));
597
647
 
598
648
  #define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
599
649
 
650
+ VALUE rb_str_resurrect(VALUE str);
651
+ VALUE rb_ary_resurrect(VALUE ary);
652
+
600
653
  /* for thread */
601
654
 
602
655
  #if RUBY_VM_THREAD_MODEL == 2
@@ -620,11 +673,17 @@ extern rb_vm_t *ruby_current_vm;
620
673
  #define RUBY_VM_SET_FINALIZER_INTERRUPT(th) ((th)->interrupt_flag |= 0x04)
621
674
  #define RUBY_VM_INTERRUPTED(th) ((th)->interrupt_flag & 0x02)
622
675
 
623
- void rb_thread_execute_interrupts(rb_thread_t *);
676
+ void rb_threadptr_check_signal(rb_thread_t *mth);
677
+ void rb_threadptr_signal_raise(rb_thread_t *th, int sig);
678
+ void rb_threadptr_signal_exit(rb_thread_t *th);
679
+ void rb_threadptr_execute_interrupts(rb_thread_t *);
680
+
681
+ void rb_thread_lock_unlock(rb_thread_lock_t *);
682
+ void rb_thread_lock_destroy(rb_thread_lock_t *);
624
683
 
625
684
  #define RUBY_VM_CHECK_INTS_TH(th) do { \
626
685
  if (UNLIKELY(th->interrupt_flag)) { \
627
- rb_thread_execute_interrupts(th); \
686
+ rb_threadptr_execute_interrupts(th); \
628
687
  } \
629
688
  } while (0)
630
689
 
@@ -632,30 +691,14 @@ void rb_thread_execute_interrupts(rb_thread_t *);
632
691
  RUBY_VM_CHECK_INTS_TH(GET_THREAD())
633
692
 
634
693
  /* tracer */
635
- static inline void
636
- exec_event_hooks(rb_event_hook_t *hook, rb_event_flag_t flag, VALUE self, ID id, VALUE klass)
637
- {
638
- if (self == rb_mRubyVMFrozenCore) return;
639
- while (hook) {
640
- if (flag & hook->flag) {
641
- (*hook->func)(flag, hook->data, self, id, klass);
642
- }
643
- hook = hook->next;
644
- }
645
- }
694
+ void
695
+ rb_threadptr_exec_event_hooks(rb_thread_t *th, rb_event_flag_t flag, VALUE self, ID id, VALUE klass);
646
696
 
647
697
  #define EXEC_EVENT_HOOK(th, flag, self, id, klass) do { \
648
698
  rb_event_flag_t wait_event__ = th->event_flags; \
649
699
  if (UNLIKELY(wait_event__)) { \
650
700
  if (wait_event__ & (flag | RUBY_EVENT_VM)) { \
651
- VALUE self__ = (self), klass__ = (klass); \
652
- ID id__ = (id); \
653
- if (wait_event__ & flag) { \
654
- exec_event_hooks(th->event_hooks, flag, self__, id__, klass__); \
655
- } \
656
- if (wait_event__ & RUBY_EVENT_VM) { \
657
- exec_event_hooks(th->vm->event_hooks, flag, self__, id__, klass__); \
658
- } \
701
+ rb_threadptr_exec_event_hooks(th, flag, self, id, klass); \
659
702
  } \
660
703
  } \
661
704
  } while (0)