debase-ruby_core_source 0.9.9 → 0.9.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/addr2line.h +0 -0
  4. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/build_assert/build_assert.h +0 -0
  5. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/check_type/check_type.h +0 -0
  6. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/container_of/container_of.h +0 -0
  7. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ccan/list/list.h +28 -166
  8. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/ccan/str/str.h +0 -0
  9. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/constant.h +3 -10
  10. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/dln.h +0 -0
  11. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/eval_intern.h +49 -89
  12. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/gc.h +1 -8
  13. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/id.h +5 -15
  14. data/lib/debase/ruby_core_source/ruby-2.2.8-p477/insns.inc +107 -0
  15. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/insns_info.inc +45 -89
  16. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/internal.h +164 -666
  17. data/lib/debase/ruby_core_source/ruby-2.2.8-p477/iseq.h +158 -0
  18. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/known_errors.inc +0 -0
  19. data/lib/debase/ruby_core_source/ruby-2.2.8-p477/method.h +144 -0
  20. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/node.h +42 -18
  21. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/node_name.inc +6 -2
  22. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/opt_sc.inc +0 -40
  23. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/optinsn.inc +0 -0
  24. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/optunifs.inc +0 -5
  25. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/parse.h +8 -28
  26. data/lib/debase/ruby_core_source/ruby-2.2.8-p477/probes_helper.h +67 -0
  27. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regenc.h +16 -16
  28. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regint.h +10 -33
  29. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/regparse.h +1 -5
  30. data/lib/debase/ruby_core_source/ruby-2.2.8-p477/revision.h +1 -0
  31. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/ruby_atomic.h +5 -68
  32. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/siphash.h +0 -0
  33. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/symbol.h +13 -33
  34. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/thread_pthread.h +2 -2
  35. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/thread_win32.h +0 -0
  36. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/timev.h +0 -0
  37. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/transcode_data.h +7 -23
  38. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/version.h +10 -31
  39. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm.inc +497 -542
  40. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_core.h +305 -784
  41. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_debug.h +0 -0
  42. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.2.8-p477}/vm_exec.h +0 -0
  43. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.2.8-p477}/vm_insnhelper.h +56 -50
  44. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vm_opts.h +7 -8
  45. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.2.8-p477}/vmtc.inc +0 -5
  46. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/addr2line.h +0 -0
  47. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/build_assert/build_assert.h +0 -0
  48. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/check_type/check_type.h +0 -0
  49. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/container_of/container_of.h +0 -0
  50. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ccan/list/list.h +0 -0
  51. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/ccan/str/str.h +0 -0
  52. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/constant.h +1 -1
  53. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/dln.h +0 -0
  54. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/encindex.h +0 -0
  55. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/eval_intern.h +3 -4
  56. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/gc.h +0 -0
  57. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/id.h +0 -9
  58. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/id_table.h +0 -0
  59. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns.inc +46 -48
  60. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/insns_info.inc +0 -20
  61. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/internal.h +58 -290
  62. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/iseq.h +15 -18
  63. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/known_errors.inc +0 -0
  64. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/method.h +2 -2
  65. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/node.h +2 -2
  66. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/node_name.inc +0 -0
  67. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/opt_sc.inc +0 -16
  68. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/optinsn.inc +0 -0
  69. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/optunifs.inc +0 -2
  70. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/parse.h +8 -27
  71. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/probes_helper.h +0 -0
  72. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regenc.h +14 -14
  73. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/regint.h +0 -8
  74. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/regparse.h +0 -0
  75. data/lib/debase/ruby_core_source/ruby-2.3.5-p376/revision.h +1 -0
  76. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/ruby_atomic.h +0 -0
  77. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/siphash.h +0 -0
  78. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/symbol.h +3 -3
  79. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/thread_pthread.h +0 -0
  80. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/thread_win32.h +0 -0
  81. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/timev.h +0 -0
  82. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/transcode_data.h +0 -0
  83. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.3.5-p376}/version.h +9 -27
  84. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm.inc +255 -264
  85. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_call_iseq_optimized.inc +5 -5
  86. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_core.h +37 -28
  87. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_debug.h +0 -0
  88. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vm_exec.h +0 -0
  89. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_insnhelper.h +32 -16
  90. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.3.5-p376}/vm_opts.h +0 -0
  91. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.3.5-p376}/vmtc.inc +0 -2
  92. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/addr2line.h +0 -0
  93. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/build_assert/build_assert.h +0 -0
  94. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/check_type/check_type.h +0 -0
  95. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/container_of/container_of.h +0 -0
  96. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ccan/list/list.h +0 -0
  97. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/ccan/str/str.h +0 -0
  98. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/constant.h +0 -0
  99. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/dln.h +0 -0
  100. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/encindex.h +0 -0
  101. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/eval_intern.h +0 -0
  102. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/gc.h +0 -0
  103. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/id.h +0 -0
  104. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/id_table.h +0 -0
  105. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns.inc +0 -0
  106. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/insns_info.inc +0 -0
  107. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/internal.h +116 -51
  108. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/iseq.h +0 -0
  109. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/known_errors.inc +0 -0
  110. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/method.h +0 -0
  111. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node.h +2 -2
  112. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/node_name.inc +0 -0
  113. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/opt_sc.inc +0 -0
  114. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/optinsn.inc +0 -0
  115. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/optunifs.inc +0 -0
  116. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/parse.h +8 -27
  117. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/probes_helper.h +0 -0
  118. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regenc.h +79 -67
  119. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/regint.h +187 -244
  120. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/regparse.h +30 -27
  121. data/lib/debase/ruby_core_source/ruby-2.4.2-p198/revision.h +1 -0
  122. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/ruby_assert.h +0 -0
  123. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/ruby_atomic.h +0 -0
  124. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/siphash.h +0 -0
  125. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/symbol.h +0 -0
  126. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/thread_pthread.h +0 -0
  127. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/thread_win32.h +0 -0
  128. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/timev.h +0 -0
  129. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/transcode_data.h +0 -0
  130. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/version.h +6 -6
  131. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm.inc +37 -34
  132. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_call_iseq_optimized.inc +0 -0
  133. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_core.h +9 -7
  134. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_debug.h +0 -0
  135. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_exec.h +0 -0
  136. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview3 → ruby-2.4.2-p198}/vm_insnhelper.h +30 -14
  137. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview2 → ruby-2.4.2-p198}/vm_opts.h +0 -0
  138. data/lib/debase/ruby_core_source/{ruby-2.4.0-preview1 → ruby-2.4.2-p198}/vmtc.inc +0 -0
  139. data/lib/debase/ruby_core_source/version.rb +1 -1
  140. metadata +138 -143
  141. data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/method.h +0 -213
  142. data/lib/debase/ruby_core_source/ruby-2.4.0-preview1/revision.h +0 -1
  143. data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/revision.h +0 -1
  144. data/lib/debase/ruby_core_source/ruby-2.4.0-preview2/ruby_assert.h +0 -54
  145. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/encindex.h +0 -67
  146. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/id_table.h +0 -31
  147. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/insns.inc +0 -112
  148. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/iseq.h +0 -252
  149. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/probes_helper.h +0 -43
  150. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/revision.h +0 -1
  151. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/ruby_assert.h +0 -54
  152. data/lib/debase/ruby_core_source/ruby-2.4.0-preview3/vm_call_iseq_optimized.inc +0 -212
@@ -2,7 +2,7 @@
2
2
 
3
3
  insnhelper.h - helper macros to implement each instructions
4
4
 
5
- $Author: ko1 $
5
+ $Author: nobu $
6
6
  created at: 04/01/01 15:50:34 JST
7
7
 
8
8
  Copyright (C) 2004-2007 Koichi Sasada
@@ -12,6 +12,28 @@
12
12
  #ifndef RUBY_INSNHELPER_H
13
13
  #define RUBY_INSNHELPER_H
14
14
 
15
+ /**
16
+ * VM Debug Level
17
+ *
18
+ * debug level:
19
+ * 0: no debug output
20
+ * 1: show instruction name
21
+ * 2: show stack frame when control stack frame is changed
22
+ * 3: show stack status
23
+ * 4: show register
24
+ * 5:
25
+ * 10: gc check
26
+ */
27
+
28
+ #ifndef VMDEBUG
29
+ #define VMDEBUG 0
30
+ #endif
31
+
32
+ #if 0
33
+ #undef VMDEBUG
34
+ #define VMDEBUG 3
35
+ #endif
36
+
15
37
  extern VALUE ruby_vm_const_missing_count;
16
38
 
17
39
  #if VM_COLLECT_USAGE_DETAILS
@@ -79,6 +101,8 @@ enum vm_regan_acttype {
79
101
  #define GET_CURRENT_INSN() (*GET_PC())
80
102
  #define GET_OPERAND(n) (GET_PC()[(n)])
81
103
  #define ADD_PC(n) (SET_PC(REG_PC + (n)))
104
+
105
+ #define GET_PC_COUNT() (REG_PC - GET_ISEQ()->iseq_encoded)
82
106
  #define JUMP(dst) (REG_PC += (dst))
83
107
 
84
108
  /* frame pointer, environment pointer */
@@ -104,7 +128,7 @@ enum vm_regan_acttype {
104
128
  /* deal with variables */
105
129
  /**********************************************************/
106
130
 
107
- #define GET_PREV_EP(ep) ((VALUE *)((ep)[VM_ENV_DATA_INDEX_SPECVAL] & ~0x03))
131
+ #define GET_PREV_EP(ep) ((VALUE *)((ep)[0] & ~0x03))
108
132
 
109
133
  #define GET_GLOBAL(entry) rb_gvar_get((struct rb_global_entry*)(entry))
110
134
  #define SET_GLOBAL(entry, val) rb_gvar_set((struct rb_global_entry*)(entry), (val))
@@ -121,8 +145,27 @@ enum vm_regan_acttype {
121
145
  /* deal with control flow 2: method/iterator */
122
146
  /**********************************************************/
123
147
 
124
- #define CALL_METHOD(calling, ci, cc) do { \
125
- VALUE v = (*(cc)->call)(th, GET_CFP(), (calling), (ci), (cc)); \
148
+ #define COPY_CREF_OMOD(c1, c2) do { \
149
+ RB_OBJ_WRITE((c1), &(c1)->nd_refinements, (c2)->nd_refinements); \
150
+ if (!NIL_P((c2)->nd_refinements)) { \
151
+ (c1)->flags |= NODE_FL_CREF_OMOD_SHARED; \
152
+ (c2)->flags |= NODE_FL_CREF_OMOD_SHARED; \
153
+ } \
154
+ } while (0)
155
+
156
+ #define COPY_CREF(c1, c2) do { \
157
+ NODE *__tmp_c2 = (c2); \
158
+ COPY_CREF_OMOD(c1, __tmp_c2); \
159
+ RB_OBJ_WRITE((c1), &(c1)->nd_clss, __tmp_c2->nd_clss); \
160
+ (c1)->nd_visi = __tmp_c2->nd_visi;\
161
+ RB_OBJ_WRITE((c1), &(c1)->nd_next, __tmp_c2->nd_next); \
162
+ if (__tmp_c2->flags & NODE_FL_CREF_PUSHED_BY_EVAL) { \
163
+ (c1)->flags |= NODE_FL_CREF_PUSHED_BY_EVAL; \
164
+ } \
165
+ } while (0)
166
+
167
+ #define CALL_METHOD(ci) do { \
168
+ VALUE v = (*(ci)->call)(th, GET_CFP(), (ci)); \
126
169
  if (v == Qundef) { \
127
170
  RESTORE_REGS(); \
128
171
  NEXT_INSN(); \
@@ -141,14 +184,14 @@ enum vm_regan_acttype {
141
184
  #endif
142
185
 
143
186
  #if OPT_CALL_FASTPATH
144
- #define CI_SET_FASTPATH(cc, func, enabled) do { \
145
- if (LIKELY(enabled)) ((cc)->call = (func)); \
187
+ #define CI_SET_FASTPATH(ci, func, enabled) do { \
188
+ if (LIKELY(enabled)) ((ci)->call = (func)); \
146
189
  } while (0)
147
190
  #else
148
191
  #define CI_SET_FASTPATH(ci, func, enabled) /* do nothing */
149
192
  #endif
150
193
 
151
- #define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL])
194
+ #define GET_BLOCK_PTR() ((rb_block_t *)(GC_GUARDED_PTR_REF(GET_LEP()[0])))
152
195
 
153
196
  /**********************************************************/
154
197
  /* deal with control flow 3: exception */
@@ -172,11 +215,9 @@ enum vm_regan_acttype {
172
215
  #endif
173
216
 
174
217
  #define CALL_SIMPLE_METHOD(recv_) do { \
175
- struct rb_calling_info calling; \
176
- calling.block_handler = VM_BLOCK_HANDLER_NONE; \
177
- calling.argc = ci->orig_argc; \
178
- vm_search_method(ci, cc, calling.recv = (recv_)); \
179
- CALL_METHOD(&calling, ci, cc); \
218
+ ci->blockptr = 0; ci->argc = ci->orig_argc; \
219
+ vm_search_method(ci, ci->recv = (recv_)); \
220
+ CALL_METHOD(ci); \
180
221
  } while (0)
181
222
 
182
223
  #define NEXT_CLASS_SERIAL() (++ruby_vm_class_serial)
@@ -185,43 +226,8 @@ enum vm_regan_acttype {
185
226
  #define GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
186
227
  #define INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
187
228
 
188
- static VALUE make_no_method_exception(VALUE exc, VALUE format, VALUE obj,
189
- int argc, const VALUE *argv, int priv);
190
-
191
- static inline struct vm_throw_data *
192
- THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, VALUE st)
193
- {
194
- return (struct vm_throw_data *)rb_imemo_new(imemo_throw_data, val, (VALUE)cf, st, 0);
195
- }
196
-
197
- static inline void
198
- THROW_DATA_CATCH_FRAME_SET(struct vm_throw_data *obj, const rb_control_frame_t *cfp)
199
- {
200
- obj->catch_frame = cfp;
201
- }
202
-
203
- static inline void
204
- THROW_DATA_STATE_SET(struct vm_throw_data *obj, int st)
205
- {
206
- obj->throw_state = (VALUE)st;
207
- }
208
-
209
- static inline VALUE
210
- THROW_DATA_VAL(const struct vm_throw_data *obj)
211
- {
212
- return obj->throw_obj;
213
- }
214
-
215
- static inline const rb_control_frame_t *
216
- THROW_DATA_CATCH_FRAME(const struct vm_throw_data *obj)
217
- {
218
- return obj->catch_frame;
219
- }
220
-
221
- static int
222
- THROW_DATA_STATE(const struct vm_throw_data *obj)
223
- {
224
- return (int)obj->throw_state;
225
- }
229
+ static VALUE make_no_method_exception(VALUE exc, const char *format,
230
+ VALUE obj, int argc, const VALUE *argv);
231
+
226
232
 
227
233
  #endif /* RUBY_INSNHELPER_H */
@@ -3,7 +3,7 @@
3
3
 
4
4
  vm_opts.h - VM optimize option
5
5
 
6
- $Author: nobu $
6
+ $Author: tmm1 $
7
7
 
8
8
  Copyright (C) 2004-2007 Koichi Sasada
9
9
 
@@ -18,13 +18,12 @@
18
18
  * Following definitions are default values.
19
19
  */
20
20
 
21
- #define OPT_TRACE_INSTRUCTION 1
22
- #define OPT_TAILCALL_OPTIMIZATION 0
23
- #define OPT_PEEPHOLE_OPTIMIZATION 1
24
- #define OPT_SPECIALISED_INSTRUCTION 1
25
- #define OPT_INLINE_CONST_CACHE 1
26
- #define OPT_FROZEN_STRING_LITERAL 0
27
- #define OPT_DEBUG_FROZEN_STRING_LITERAL 0
21
+ #define OPT_TRACE_INSTRUCTION 1
22
+ #define OPT_TAILCALL_OPTIMIZATION 0
23
+ #define OPT_PEEPHOLE_OPTIMIZATION 1
24
+ #define OPT_SPECIALISED_INSTRUCTION 1
25
+ #define OPT_INLINE_CONST_CACHE 1
26
+
28
27
 
29
28
  /* Build Options.
30
29
  * You can't change these options at runtime.
@@ -34,7 +34,6 @@ static const void *const insns_address_table[] = {
34
34
  LABEL_PTR(putstring),
35
35
  LABEL_PTR(concatstrings),
36
36
  LABEL_PTR(tostring),
37
- LABEL_PTR(freezestring),
38
37
  LABEL_PTR(toregexp),
39
38
  LABEL_PTR(newarray),
40
39
  LABEL_PTR(duparray),
@@ -47,7 +46,6 @@ static const void *const insns_address_table[] = {
47
46
  LABEL_PTR(dup),
48
47
  LABEL_PTR(dupn),
49
48
  LABEL_PTR(swap),
50
- LABEL_PTR(reverse),
51
49
  LABEL_PTR(reput),
52
50
  LABEL_PTR(topn),
53
51
  LABEL_PTR(setn),
@@ -59,8 +57,6 @@ static const void *const insns_address_table[] = {
59
57
  LABEL_PTR(defineclass),
60
58
  LABEL_PTR(send),
61
59
  LABEL_PTR(opt_str_freeze),
62
- LABEL_PTR(opt_newarray_max),
63
- LABEL_PTR(opt_newarray_min),
64
60
  LABEL_PTR(opt_send_without_block),
65
61
  LABEL_PTR(invokesuper),
66
62
  LABEL_PTR(invokeblock),
@@ -69,7 +65,6 @@ static const void *const insns_address_table[] = {
69
65
  LABEL_PTR(jump),
70
66
  LABEL_PTR(branchif),
71
67
  LABEL_PTR(branchunless),
72
- LABEL_PTR(branchnil),
73
68
  LABEL_PTR(getinlinecache),
74
69
  LABEL_PTR(setinlinecache),
75
70
  LABEL_PTR(once),
@@ -38,7 +38,7 @@ typedef struct rb_const_entry_struct {
38
38
  VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
39
39
  VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
40
40
  VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
41
- void rb_free_const_table(struct rb_id_table *tbl);
41
+ void rb_free_const_table(st_table *tbl);
42
42
  VALUE rb_public_const_get(VALUE klass, ID id);
43
43
  VALUE rb_public_const_get_at(VALUE klass, ID id);
44
44
  VALUE rb_public_const_get_from(VALUE klass, ID id);
@@ -121,7 +121,7 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
121
121
  #define TH_PUSH_TAG(th) do { \
122
122
  rb_thread_t * const _th = (th); \
123
123
  struct rb_vm_tag _tag; \
124
- _tag.tag = 0; \
124
+ _tag.tag = Qundef; \
125
125
  _tag.prev = _th->tag;
126
126
 
127
127
  #define TH_POP_TAG() \
@@ -139,11 +139,9 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
139
139
  #if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8)
140
140
  # define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var))
141
141
  # define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var))
142
- # define VAR_NOCLOBBERED(var) volatile var
143
142
  #else
144
143
  # define VAR_FROM_MEMORY(var) (var)
145
144
  # define VAR_INITIALIZED(var) ((void)&(var))
146
- # define VAR_NOCLOBBERED(var) var
147
145
  #endif
148
146
 
149
147
  /* clear th->state, and return the value */
@@ -266,7 +264,7 @@ NORETURN(void rb_method_name_error(VALUE, VALUE));
266
264
 
267
265
  NORETURN(void rb_fiber_start(void));
268
266
 
269
- NORETURN(void rb_print_undef(VALUE, ID, rb_method_visibility_t));
267
+ NORETURN(void rb_print_undef(VALUE, ID, int));
270
268
  NORETURN(void rb_print_undef_str(VALUE, VALUE));
271
269
  NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t));
272
270
  NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
@@ -280,6 +278,7 @@ rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void);
280
278
  VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
281
279
  void rb_vm_set_progname(VALUE filename);
282
280
  void rb_thread_terminate_all(void);
281
+ VALUE rb_vm_top_self();
283
282
  VALUE rb_vm_cbase(void);
284
283
 
285
284
  #ifndef CharNext /* defined as CharNext[AW] on Windows. */
@@ -118,8 +118,6 @@ enum ruby_method_ids {
118
118
  id_core_hash_merge_kwd,
119
119
  id_debug_created_info,
120
120
  tPRESERVED_ID_END,
121
- tMax,
122
- tMin,
123
121
  tFreeze,
124
122
  tInspect,
125
123
  tIntern,
@@ -162,12 +160,8 @@ enum ruby_method_ids {
162
160
  tMesg,
163
161
  tException,
164
162
  tUScore,
165
- tLASTLINE,
166
- tBACKREF,
167
163
  tNEXT_ID,
168
164
  #define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL|ID_STATIC_SYM)
169
- TOKEN2LOCALID(Max),
170
- TOKEN2LOCALID(Min),
171
165
  TOKEN2LOCALID(Freeze),
172
166
  TOKEN2LOCALID(Inspect),
173
167
  TOKEN2LOCALID(Intern),
@@ -210,9 +204,6 @@ enum ruby_method_ids {
210
204
  TOKEN2LOCALID(Mesg),
211
205
  TOKEN2LOCALID(Exception),
212
206
  TOKEN2LOCALID(UScore),
213
- #define TOKEN2GLOBALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_GLOBAL|ID_STATIC_SYM)
214
- TOKEN2GLOBALID(LASTLINE),
215
- TOKEN2GLOBALID(BACKREF),
216
207
  tLAST_OP_ID = tPRESERVED_ID_END-1,
217
208
  idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
218
209
  };
@@ -60,53 +60,51 @@ enum ruby_vminsn_type {
60
60
  BIN(defineclass) = 43,
61
61
  BIN(send) = 44,
62
62
  BIN(opt_str_freeze) = 45,
63
- BIN(opt_newarray_max) = 46,
64
- BIN(opt_newarray_min) = 47,
65
- BIN(opt_send_without_block) = 48,
66
- BIN(invokesuper) = 49,
67
- BIN(invokeblock) = 50,
68
- BIN(leave) = 51,
69
- BIN(throw) = 52,
70
- BIN(jump) = 53,
71
- BIN(branchif) = 54,
72
- BIN(branchunless) = 55,
73
- BIN(branchnil) = 56,
74
- BIN(getinlinecache) = 57,
75
- BIN(setinlinecache) = 58,
76
- BIN(once) = 59,
77
- BIN(opt_case_dispatch) = 60,
78
- BIN(opt_plus) = 61,
79
- BIN(opt_minus) = 62,
80
- BIN(opt_mult) = 63,
81
- BIN(opt_div) = 64,
82
- BIN(opt_mod) = 65,
83
- BIN(opt_eq) = 66,
84
- BIN(opt_neq) = 67,
85
- BIN(opt_lt) = 68,
86
- BIN(opt_le) = 69,
87
- BIN(opt_gt) = 70,
88
- BIN(opt_ge) = 71,
89
- BIN(opt_ltlt) = 72,
90
- BIN(opt_aref) = 73,
91
- BIN(opt_aset) = 74,
92
- BIN(opt_aset_with) = 75,
93
- BIN(opt_aref_with) = 76,
94
- BIN(opt_length) = 77,
95
- BIN(opt_size) = 78,
96
- BIN(opt_empty_p) = 79,
97
- BIN(opt_succ) = 80,
98
- BIN(opt_not) = 81,
99
- BIN(opt_regexpmatch1) = 82,
100
- BIN(opt_regexpmatch2) = 83,
101
- BIN(opt_call_c_function) = 84,
102
- BIN(bitblt) = 85,
103
- BIN(answer) = 86,
104
- BIN(getlocal_OP__WC__0) = 87,
105
- BIN(getlocal_OP__WC__1) = 88,
106
- BIN(setlocal_OP__WC__0) = 89,
107
- BIN(setlocal_OP__WC__1) = 90,
108
- BIN(putobject_OP_INT2FIX_O_0_C_) = 91,
109
- BIN(putobject_OP_INT2FIX_O_1_C_) = 92,
110
- VM_INSTRUCTION_SIZE = 93
63
+ BIN(opt_send_without_block) = 46,
64
+ BIN(invokesuper) = 47,
65
+ BIN(invokeblock) = 48,
66
+ BIN(leave) = 49,
67
+ BIN(throw) = 50,
68
+ BIN(jump) = 51,
69
+ BIN(branchif) = 52,
70
+ BIN(branchunless) = 53,
71
+ BIN(branchnil) = 54,
72
+ BIN(getinlinecache) = 55,
73
+ BIN(setinlinecache) = 56,
74
+ BIN(once) = 57,
75
+ BIN(opt_case_dispatch) = 58,
76
+ BIN(opt_plus) = 59,
77
+ BIN(opt_minus) = 60,
78
+ BIN(opt_mult) = 61,
79
+ BIN(opt_div) = 62,
80
+ BIN(opt_mod) = 63,
81
+ BIN(opt_eq) = 64,
82
+ BIN(opt_neq) = 65,
83
+ BIN(opt_lt) = 66,
84
+ BIN(opt_le) = 67,
85
+ BIN(opt_gt) = 68,
86
+ BIN(opt_ge) = 69,
87
+ BIN(opt_ltlt) = 70,
88
+ BIN(opt_aref) = 71,
89
+ BIN(opt_aset) = 72,
90
+ BIN(opt_aset_with) = 73,
91
+ BIN(opt_aref_with) = 74,
92
+ BIN(opt_length) = 75,
93
+ BIN(opt_size) = 76,
94
+ BIN(opt_empty_p) = 77,
95
+ BIN(opt_succ) = 78,
96
+ BIN(opt_not) = 79,
97
+ BIN(opt_regexpmatch1) = 80,
98
+ BIN(opt_regexpmatch2) = 81,
99
+ BIN(opt_call_c_function) = 82,
100
+ BIN(bitblt) = 83,
101
+ BIN(answer) = 84,
102
+ BIN(getlocal_OP__WC__0) = 85,
103
+ BIN(getlocal_OP__WC__1) = 86,
104
+ BIN(setlocal_OP__WC__0) = 87,
105
+ BIN(setlocal_OP__WC__1) = 88,
106
+ BIN(putobject_OP_INT2FIX_O_0_C_) = 89,
107
+ BIN(putobject_OP_INT2FIX_O_1_C_) = 90,
108
+ VM_INSTRUCTION_SIZE = 91
111
109
  };
112
110
 
@@ -70,8 +70,6 @@ static const char *const insn_name_info[] = {
70
70
  "defineclass",
71
71
  "send",
72
72
  "opt_str_freeze",
73
- "opt_newarray_max",
74
- "opt_newarray_min",
75
73
  "opt_send_without_block",
76
74
  "invokesuper",
77
75
  "invokeblock",
@@ -167,8 +165,6 @@ static const char *const insn_operand_info[] = {
167
165
  "ISN",
168
166
  "CES",
169
167
  "V",
170
- "N",
171
- "N",
172
168
  "CE",
173
169
  "CES",
174
170
  "C",
@@ -264,8 +260,6 @@ static const int insn_len_info[] = {
264
260
  4,
265
261
  4,
266
262
  2,
267
- 2,
268
- 2,
269
263
  3,
270
264
  4,
271
265
  2,
@@ -367,8 +361,6 @@ static const int insn_stack_push_num_info[] = {
367
361
  1,
368
362
  1,
369
363
  1,
370
- 1,
371
- 1,
372
364
  0,
373
365
  0,
374
366
  0,
@@ -589,18 +581,6 @@ insn_stack_increase(int depth, int insn, VALUE *opes)
589
581
  case BIN(opt_str_freeze):{
590
582
  return depth + 1;
591
583
  }
592
- case BIN(opt_newarray_max):{
593
- int inc = 0;
594
- int num = FIX2INT(opes[0]);
595
- inc += 1 - num;;
596
- return depth + inc;
597
- }
598
- case BIN(opt_newarray_min):{
599
- int inc = 0;
600
- int num = FIX2INT(opes[0]);
601
- inc += 1 - num;;
602
- return depth + inc;
603
- }
604
584
  case BIN(opt_send_without_block):{
605
585
  int inc = 0;
606
586
  CALL_INFO ci = (CALL_INFO)(opes[0]);