debase-ruby_core_source 0.10.5 → 0.10.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +1 -1
  4. data/debase-ruby_core_source.gemspec +3 -2
  5. data/lib/debase/ruby_core_source.rb +1 -1
  6. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/addr2line.h +21 -0
  7. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/build_assert/build_assert.h +40 -0
  8. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/check_type/check_type.h +63 -0
  9. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/container_of/container_of.h +142 -0
  10. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/list/list.h +788 -0
  11. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ccan/str/str.h +16 -0
  12. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/constant.h +51 -0
  13. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/debug_counter.h +283 -0
  14. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/dln.h +51 -0
  15. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/encindex.h +69 -0
  16. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/eval_intern.h +333 -0
  17. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/gc.h +116 -0
  18. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/hrtime.h +168 -0
  19. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id.h +252 -0
  20. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/id_table.h +31 -0
  21. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns.inc +249 -0
  22. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/insns_info.inc +9374 -0
  23. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/internal.h +2470 -0
  24. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/iseq.h +304 -0
  25. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/known_errors.inc +791 -0
  26. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/method.h +229 -0
  27. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit.h +148 -0
  28. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/mjit_compile.inc +4226 -0
  29. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node.h +449 -0
  30. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/node_name.inc +200 -0
  31. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/opt_sc.inc +109 -0
  32. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optinsn.inc +128 -0
  33. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/optunifs.inc +43 -0
  34. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/parse.h +207 -0
  35. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/probes_helper.h +42 -0
  36. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regenc.h +254 -0
  37. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regint.h +938 -0
  38. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/regparse.h +370 -0
  39. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/revision.h +1 -0
  40. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_assert.h +60 -0
  41. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/ruby_atomic.h +244 -0
  42. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/siphash.h +48 -0
  43. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/symbol.h +112 -0
  44. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_pthread.h +75 -0
  45. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/thread_win32.h +36 -0
  46. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/timev.h +53 -0
  47. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transcode_data.h +139 -0
  48. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/transient_heap.h +60 -0
  49. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/version.h +73 -0
  50. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm.inc +4504 -0
  51. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_call_iseq_optimized.inc +213 -0
  52. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_core.h +1910 -0
  53. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_debug.h +37 -0
  54. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_exec.h +202 -0
  55. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_insnhelper.h +316 -0
  56. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vm_opts.h +70 -0
  57. data/lib/debase/ruby_core_source/ruby-2.6.5-p114/vmtc.inc +243 -0
  58. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/addr2line.h +21 -0
  59. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
  60. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/build_assert/build_assert.h +40 -0
  61. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/check_type/check_type.h +63 -0
  62. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/container_of/container_of.h +142 -0
  63. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/list/list.h +788 -0
  64. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/str/str.h +16 -0
  65. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/constant.h +50 -0
  66. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/debug_counter.h +390 -0
  67. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/dln.h +51 -0
  68. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/encindex.h +69 -0
  69. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/eval_intern.h +312 -0
  70. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/gc.h +131 -0
  71. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/hrtime.h +168 -0
  72. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id.h +290 -0
  73. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id_table.h +34 -0
  74. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns.inc +253 -0
  75. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns_info.inc +9197 -0
  76. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/internal.h +2697 -0
  77. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/iseq.h +312 -0
  78. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/known_errors.inc +791 -0
  79. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/method.h +229 -0
  80. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit.h +177 -0
  81. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit_compile.inc +7779 -0
  82. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node.h +476 -0
  83. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node_name.inc +208 -0
  84. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
  85. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optinsn.inc +128 -0
  86. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
  87. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/parse.h +210 -0
  88. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/probes_helper.h +42 -0
  89. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regenc.h +254 -0
  90. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regint.h +938 -0
  91. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regparse.h +370 -0
  92. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
  93. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_assert.h +15 -0
  94. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_atomic.h +244 -0
  95. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/siphash.h +48 -0
  96. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/symbol.h +119 -0
  97. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_pthread.h +75 -0
  98. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_win32.h +36 -0
  99. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/timev.h +56 -0
  100. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transcode_data.h +139 -0
  101. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transient_heap.h +62 -0
  102. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
  103. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/version.h +77 -0
  104. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm.inc +5466 -0
  105. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_call_iseq_optimized.inc +237 -0
  106. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_core.h +1968 -0
  107. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_debug.h +34 -0
  108. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_exec.h +193 -0
  109. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_insnhelper.h +267 -0
  110. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_opts.h +72 -0
  111. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vmtc.inc +247 -0
  112. data/lib/debase/ruby_core_source/version.rb +1 -1
  113. metadata +128 -8
@@ -0,0 +1,16 @@
1
+ /* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
2
+ #ifndef CCAN_STR_H
3
+ #define CCAN_STR_H
4
+ /**
5
+ * stringify - Turn expression into a string literal
6
+ * @expr: any C expression
7
+ *
8
+ * Example:
9
+ * #define PRINT_COND_IF_FALSE(cond) \
10
+ * ((cond) || printf("%s is false!", stringify(cond)))
11
+ */
12
+ #define stringify(expr) stringify_1(expr)
13
+ /* Double-indirection required to stringify expansions */
14
+ #define stringify_1(expr) #expr
15
+
16
+ #endif /* CCAN_STR_H */
@@ -0,0 +1,50 @@
1
+ /**********************************************************************
2
+
3
+ constant.h -
4
+
5
+ $Author$
6
+ created at: Sun Nov 15 00:09:33 2009
7
+
8
+ Copyright (C) 2009 Yusuke Endoh
9
+
10
+ **********************************************************************/
11
+ #ifndef CONSTANT_H
12
+ #define CONSTANT_H
13
+
14
+ typedef enum {
15
+ CONST_DEPRECATED = 0x100,
16
+
17
+ CONST_VISIBILITY_MASK = 0xff,
18
+ CONST_PUBLIC = 0x00,
19
+ CONST_PRIVATE,
20
+ CONST_VISIBILITY_MAX
21
+ } rb_const_flag_t;
22
+
23
+ #define RB_CONST_PRIVATE_P(ce) \
24
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PRIVATE)
25
+ #define RB_CONST_PUBLIC_P(ce) \
26
+ (((ce)->flag & CONST_VISIBILITY_MASK) == CONST_PUBLIC)
27
+
28
+ #define RB_CONST_DEPRECATED_P(ce) \
29
+ ((ce)->flag & CONST_DEPRECATED)
30
+
31
+ typedef struct rb_const_entry_struct {
32
+ rb_const_flag_t flag;
33
+ int line;
34
+ VALUE value; /* should be mark */
35
+ VALUE file; /* should be mark */
36
+ } rb_const_entry_t;
37
+
38
+ VALUE rb_mod_private_constant(int argc, const VALUE *argv, VALUE obj);
39
+ VALUE rb_mod_public_constant(int argc, const VALUE *argv, VALUE obj);
40
+ VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
41
+ void rb_free_const_table(struct rb_id_table *tbl);
42
+ VALUE rb_public_const_get_at(VALUE klass, ID id);
43
+ VALUE rb_public_const_get_from(VALUE klass, ID id);
44
+ int rb_public_const_defined_from(VALUE klass, ID id);
45
+ rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
46
+ int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
47
+ VALUE rb_const_source_location(VALUE, ID);
48
+ VALUE rb_const_source_location_at(VALUE, ID);
49
+
50
+ #endif /* CONSTANT_H */
@@ -0,0 +1,390 @@
1
+ /**********************************************************************
2
+
3
+ debug_counter.h -
4
+
5
+ created at: Tue Feb 21 16:51:18 2017
6
+
7
+ Copyright (C) 2017 Koichi Sasada
8
+
9
+ **********************************************************************/
10
+
11
+ #ifndef USE_DEBUG_COUNTER
12
+ #define USE_DEBUG_COUNTER 0
13
+ #endif
14
+
15
+ #ifdef RB_DEBUG_COUNTER
16
+
17
+ /*
18
+ * method cache (mc) counts.
19
+ *
20
+ * * mc_inline_hit/miss: inline mc hit/miss counts (VM send insn)
21
+ * * mc_global_hit/miss: global method cache hit/miss counts
22
+ * two types: (1) inline cache miss (VM send insn)
23
+ * (2) called from C (rb_funcall).
24
+ * * mc_global_state_miss: inline mc miss by global_state miss.
25
+ * * mc_class_serial_miss: ... by mc_class_serial_miss
26
+ * * mc_cme_complement: callable_method_entry complement counts.
27
+ * * mc_cme_complement_hit: callable_method_entry cache hit counts.
28
+ * * mc_search_super: search_method() call counts.
29
+ * * mc_miss_by_nome: inline mc miss by no ment.
30
+ * * mc_miss_by_distinct: ... by distinct ment.
31
+ * * mc_miss_by_refine: ... by ment being refined.
32
+ * * mc_miss_by_visi: ... by visibility change.
33
+ * * mc_miss_spurious: spurious inline mc misshit.
34
+ * * mc_miss_reuse_call: count of reuse of cc->call.
35
+ */
36
+ RB_DEBUG_COUNTER(mc_inline_hit)
37
+ RB_DEBUG_COUNTER(mc_inline_miss)
38
+ RB_DEBUG_COUNTER(mc_global_hit)
39
+ RB_DEBUG_COUNTER(mc_global_miss)
40
+ RB_DEBUG_COUNTER(mc_global_state_miss)
41
+ RB_DEBUG_COUNTER(mc_class_serial_miss)
42
+ RB_DEBUG_COUNTER(mc_cme_complement)
43
+ RB_DEBUG_COUNTER(mc_cme_complement_hit)
44
+ RB_DEBUG_COUNTER(mc_search_super)
45
+ RB_DEBUG_COUNTER(mc_miss_by_nome)
46
+ RB_DEBUG_COUNTER(mc_miss_by_distinct)
47
+ RB_DEBUG_COUNTER(mc_miss_by_refine)
48
+ RB_DEBUG_COUNTER(mc_miss_by_visi)
49
+ RB_DEBUG_COUNTER(mc_miss_spurious)
50
+ RB_DEBUG_COUNTER(mc_miss_reuse_call)
51
+
52
+ /*
53
+ * call cache fastpath usage
54
+ */
55
+ RB_DEBUG_COUNTER(ccf_general)
56
+ RB_DEBUG_COUNTER(ccf_iseq_setup)
57
+ RB_DEBUG_COUNTER(ccf_iseq_setup_0start)
58
+ RB_DEBUG_COUNTER(ccf_iseq_setup_tailcall_0start)
59
+ RB_DEBUG_COUNTER(ccf_iseq_fix) /* several functions created with tool/mk_call_iseq_optimized.rb */
60
+ RB_DEBUG_COUNTER(ccf_iseq_opt) /* has_opt == TRUE (has optional parameters), but other flags are FALSE */
61
+ RB_DEBUG_COUNTER(ccf_iseq_kw1) /* vm_call_iseq_setup_kwparm_kwarg() */
62
+ RB_DEBUG_COUNTER(ccf_iseq_kw2) /* vm_call_iseq_setup_kwparm_nokwarg() */
63
+ RB_DEBUG_COUNTER(ccf_cfunc)
64
+ RB_DEBUG_COUNTER(ccf_ivar) /* attr_reader */
65
+ RB_DEBUG_COUNTER(ccf_attrset) /* attr_writer */
66
+ RB_DEBUG_COUNTER(ccf_method_missing)
67
+ RB_DEBUG_COUNTER(ccf_zsuper)
68
+ RB_DEBUG_COUNTER(ccf_bmethod)
69
+ RB_DEBUG_COUNTER(ccf_opt_send)
70
+ RB_DEBUG_COUNTER(ccf_opt_call)
71
+ RB_DEBUG_COUNTER(ccf_opt_block_call)
72
+ RB_DEBUG_COUNTER(ccf_super_method)
73
+
74
+ /*
75
+ * control frame push counts.
76
+ *
77
+ * * frame_push: frame push counts.
78
+ * * frame_push_*: frame push counts per each type.
79
+ * * frame_R2R: Ruby frame to Ruby frame
80
+ * * frame_R2C: Ruby frame to C frame
81
+ * * frame_C2C: C frame to C frame
82
+ * * frame_C2R: C frame to Ruby frame
83
+ */
84
+ RB_DEBUG_COUNTER(frame_push)
85
+ RB_DEBUG_COUNTER(frame_push_method)
86
+ RB_DEBUG_COUNTER(frame_push_block)
87
+ RB_DEBUG_COUNTER(frame_push_class)
88
+ RB_DEBUG_COUNTER(frame_push_top)
89
+ RB_DEBUG_COUNTER(frame_push_cfunc)
90
+ RB_DEBUG_COUNTER(frame_push_ifunc)
91
+ RB_DEBUG_COUNTER(frame_push_eval)
92
+ RB_DEBUG_COUNTER(frame_push_rescue)
93
+ RB_DEBUG_COUNTER(frame_push_dummy)
94
+
95
+ RB_DEBUG_COUNTER(frame_R2R)
96
+ RB_DEBUG_COUNTER(frame_R2C)
97
+ RB_DEBUG_COUNTER(frame_C2C)
98
+ RB_DEBUG_COUNTER(frame_C2R)
99
+
100
+ /* instance variable counts
101
+ *
102
+ * * ivar_get_ic_hit/miss: ivar_get inline cache (ic) hit/miss counts (VM insn)
103
+ * * ivar_get_ic_miss_serial: ivar_get ic miss reason by serial (VM insn)
104
+ * * ivar_get_ic_miss_unset: ... by unset (VM insn)
105
+ * * ivar_get_ic_miss_noobject: ... by "not T_OBJECT" (VM insn)
106
+ * * ivar_set_...: same counts with ivar_set (VM insn)
107
+ * * ivar_get/set_base: call counts of "rb_ivar_get/set()".
108
+ * because of (1) ic miss.
109
+ * (2) direct call by C extensions.
110
+ */
111
+ RB_DEBUG_COUNTER(ivar_get_ic_hit)
112
+ RB_DEBUG_COUNTER(ivar_get_ic_miss)
113
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_serial)
114
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_unset)
115
+ RB_DEBUG_COUNTER(ivar_get_ic_miss_noobject)
116
+ RB_DEBUG_COUNTER(ivar_set_ic_hit)
117
+ RB_DEBUG_COUNTER(ivar_set_ic_miss)
118
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_serial)
119
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_unset)
120
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_oorange)
121
+ RB_DEBUG_COUNTER(ivar_set_ic_miss_noobject)
122
+ RB_DEBUG_COUNTER(ivar_get_base)
123
+ RB_DEBUG_COUNTER(ivar_set_base)
124
+
125
+ /* local variable counts
126
+ *
127
+ * * lvar_get: total lvar get counts (VM insn)
128
+ * * lvar_get_dynamic: lvar get counts if accessing upper env (VM insn)
129
+ * * lvar_set*: same as "get"
130
+ * * lvar_set_slowpath: counts using vm_env_write_slowpath()
131
+ */
132
+ RB_DEBUG_COUNTER(lvar_get)
133
+ RB_DEBUG_COUNTER(lvar_get_dynamic)
134
+ RB_DEBUG_COUNTER(lvar_set)
135
+ RB_DEBUG_COUNTER(lvar_set_dynamic)
136
+ RB_DEBUG_COUNTER(lvar_set_slowpath)
137
+
138
+ /* GC counts:
139
+ *
140
+ * * count: simple count
141
+ * * _minor: minor gc
142
+ * * _major: major gc
143
+ * * other suffix is corresponding to last_gc_info or
144
+ * gc_profile_record_flag in gc.c.
145
+ */
146
+ RB_DEBUG_COUNTER(gc_count)
147
+ RB_DEBUG_COUNTER(gc_minor_newobj)
148
+ RB_DEBUG_COUNTER(gc_minor_malloc)
149
+ RB_DEBUG_COUNTER(gc_minor_method)
150
+ RB_DEBUG_COUNTER(gc_minor_capi)
151
+ RB_DEBUG_COUNTER(gc_minor_stress)
152
+ RB_DEBUG_COUNTER(gc_major_nofree)
153
+ RB_DEBUG_COUNTER(gc_major_oldgen)
154
+ RB_DEBUG_COUNTER(gc_major_shady)
155
+ RB_DEBUG_COUNTER(gc_major_force)
156
+ RB_DEBUG_COUNTER(gc_major_oldmalloc)
157
+
158
+ RB_DEBUG_COUNTER(gc_isptr_trial)
159
+ RB_DEBUG_COUNTER(gc_isptr_range)
160
+ RB_DEBUG_COUNTER(gc_isptr_align)
161
+ RB_DEBUG_COUNTER(gc_isptr_maybe)
162
+
163
+ /* object allocation counts:
164
+ *
165
+ * * obj_newobj: newobj counts
166
+ * * obj_newobj_slowpath: newobj with slowpath counts
167
+ * * obj_newobj_wb_unprotected: newobj for wb_unprotecte.
168
+ * * obj_free: obj_free() counts
169
+ * * obj_promote: promoted counts (oldgen)
170
+ * * obj_wb_unprotect: wb unprotect counts
171
+ *
172
+ * * obj_[type]_[attr]: *free'ed counts* for each type.
173
+ * Note that it is not a allocated counts.
174
+ * * [type]
175
+ * * _obj: T_OBJECT
176
+ * * _str: T_STRING
177
+ * * _ary: T_ARRAY
178
+ * * _xxx: T_XXX (hash, struct, ...)
179
+ *
180
+ * * [attr]
181
+ * * _ptr: R?? is not embed.
182
+ * * _embed: R?? is embed.
183
+ * * _transient: R?? uses transient heap.
184
+ * * type specific attr.
185
+ * * str_shared: str is shared.
186
+ * * str_nofree: nofree
187
+ * * str_fstr: fstr
188
+ * * hash_empty: hash is empty
189
+ * * hash_1_4: has 1 to 4 entries
190
+ * * hash_5_8: has 5 to 8 entries
191
+ * * hash_g8: has n entries (n>8)
192
+ * * match_under4: has under 4 oniguruma regions allocated
193
+ * * match_ge4: has n regions allocated (4<=n<8)
194
+ * * match_ge8: has n regions allocated (8<=n)
195
+ * * data_empty: T_DATA but no memory free.
196
+ * * data_xfree: free'ed by xfree().
197
+ * * data_imm_free: free'ed immediately.
198
+ * * data_zombie: free'ed with zombie.
199
+ * * imemo_*: T_IMEMO with each type.
200
+ */
201
+ RB_DEBUG_COUNTER(obj_newobj)
202
+ RB_DEBUG_COUNTER(obj_newobj_slowpath)
203
+ RB_DEBUG_COUNTER(obj_newobj_wb_unprotected)
204
+ RB_DEBUG_COUNTER(obj_free)
205
+ RB_DEBUG_COUNTER(obj_promote)
206
+ RB_DEBUG_COUNTER(obj_wb_unprotect)
207
+
208
+ RB_DEBUG_COUNTER(obj_obj_embed)
209
+ RB_DEBUG_COUNTER(obj_obj_transient)
210
+ RB_DEBUG_COUNTER(obj_obj_ptr)
211
+
212
+ RB_DEBUG_COUNTER(obj_str_ptr)
213
+ RB_DEBUG_COUNTER(obj_str_embed)
214
+ RB_DEBUG_COUNTER(obj_str_shared)
215
+ RB_DEBUG_COUNTER(obj_str_nofree)
216
+ RB_DEBUG_COUNTER(obj_str_fstr)
217
+
218
+ RB_DEBUG_COUNTER(obj_ary_embed)
219
+ RB_DEBUG_COUNTER(obj_ary_transient)
220
+ RB_DEBUG_COUNTER(obj_ary_ptr)
221
+ RB_DEBUG_COUNTER(obj_ary_extracapa)
222
+ /*
223
+ ary_shared_create: shared ary by Array#dup and so on.
224
+ ary_shared: finished in shard.
225
+ ary_shared_root_occupied: shared_root but has only 1 refcnt.
226
+ The number (ary_shared - ary_shared_root_occupied) is meaningful.
227
+ */
228
+ RB_DEBUG_COUNTER(obj_ary_shared_create)
229
+ RB_DEBUG_COUNTER(obj_ary_shared)
230
+ RB_DEBUG_COUNTER(obj_ary_shared_root_occupied)
231
+
232
+ RB_DEBUG_COUNTER(obj_hash_empty)
233
+ RB_DEBUG_COUNTER(obj_hash_1)
234
+ RB_DEBUG_COUNTER(obj_hash_2)
235
+ RB_DEBUG_COUNTER(obj_hash_3)
236
+ RB_DEBUG_COUNTER(obj_hash_4)
237
+ RB_DEBUG_COUNTER(obj_hash_5_8)
238
+ RB_DEBUG_COUNTER(obj_hash_g8)
239
+
240
+ RB_DEBUG_COUNTER(obj_hash_null)
241
+ RB_DEBUG_COUNTER(obj_hash_ar)
242
+ RB_DEBUG_COUNTER(obj_hash_st)
243
+ RB_DEBUG_COUNTER(obj_hash_transient)
244
+ RB_DEBUG_COUNTER(obj_hash_force_convert)
245
+
246
+ RB_DEBUG_COUNTER(obj_struct_embed)
247
+ RB_DEBUG_COUNTER(obj_struct_transient)
248
+ RB_DEBUG_COUNTER(obj_struct_ptr)
249
+
250
+ RB_DEBUG_COUNTER(obj_data_empty)
251
+ RB_DEBUG_COUNTER(obj_data_xfree)
252
+ RB_DEBUG_COUNTER(obj_data_imm_free)
253
+ RB_DEBUG_COUNTER(obj_data_zombie)
254
+
255
+ RB_DEBUG_COUNTER(obj_match_under4)
256
+ RB_DEBUG_COUNTER(obj_match_ge4)
257
+ RB_DEBUG_COUNTER(obj_match_ge8)
258
+ RB_DEBUG_COUNTER(obj_match_ptr)
259
+
260
+ RB_DEBUG_COUNTER(obj_iclass_ptr)
261
+ RB_DEBUG_COUNTER(obj_class_ptr)
262
+ RB_DEBUG_COUNTER(obj_module_ptr)
263
+
264
+ RB_DEBUG_COUNTER(obj_bignum_ptr)
265
+ RB_DEBUG_COUNTER(obj_bignum_embed)
266
+ RB_DEBUG_COUNTER(obj_float)
267
+ RB_DEBUG_COUNTER(obj_complex)
268
+ RB_DEBUG_COUNTER(obj_rational)
269
+
270
+ RB_DEBUG_COUNTER(obj_regexp_ptr)
271
+ RB_DEBUG_COUNTER(obj_file_ptr)
272
+ RB_DEBUG_COUNTER(obj_symbol)
273
+
274
+ RB_DEBUG_COUNTER(obj_imemo_ment)
275
+ RB_DEBUG_COUNTER(obj_imemo_iseq)
276
+ RB_DEBUG_COUNTER(obj_imemo_env)
277
+ RB_DEBUG_COUNTER(obj_imemo_tmpbuf)
278
+ RB_DEBUG_COUNTER(obj_imemo_ast)
279
+ RB_DEBUG_COUNTER(obj_imemo_cref)
280
+ RB_DEBUG_COUNTER(obj_imemo_svar)
281
+ RB_DEBUG_COUNTER(obj_imemo_throw_data)
282
+ RB_DEBUG_COUNTER(obj_imemo_ifunc)
283
+ RB_DEBUG_COUNTER(obj_imemo_memo)
284
+ RB_DEBUG_COUNTER(obj_imemo_parser_strterm)
285
+
286
+ /* ar_table */
287
+ RB_DEBUG_COUNTER(artable_hint_hit)
288
+ RB_DEBUG_COUNTER(artable_hint_miss)
289
+ RB_DEBUG_COUNTER(artable_hint_notfound)
290
+
291
+ /* heap function counts
292
+ *
293
+ * * heap_xmalloc/realloc/xfree: call counts
294
+ */
295
+ RB_DEBUG_COUNTER(heap_xmalloc)
296
+ RB_DEBUG_COUNTER(heap_xrealloc)
297
+ RB_DEBUG_COUNTER(heap_xfree)
298
+
299
+ /* transient_heap */
300
+ RB_DEBUG_COUNTER(theap_alloc)
301
+ RB_DEBUG_COUNTER(theap_alloc_fail)
302
+ RB_DEBUG_COUNTER(theap_evacuate)
303
+
304
+ /* mjit_exec() counts */
305
+ RB_DEBUG_COUNTER(mjit_exec)
306
+ RB_DEBUG_COUNTER(mjit_exec_not_added)
307
+ RB_DEBUG_COUNTER(mjit_exec_not_added_add_iseq)
308
+ RB_DEBUG_COUNTER(mjit_exec_not_ready)
309
+ RB_DEBUG_COUNTER(mjit_exec_not_compiled)
310
+ RB_DEBUG_COUNTER(mjit_exec_call_func)
311
+
312
+ /* MJIT <-> VM frame push counts */
313
+ RB_DEBUG_COUNTER(mjit_frame_VM2VM)
314
+ RB_DEBUG_COUNTER(mjit_frame_VM2JT)
315
+ RB_DEBUG_COUNTER(mjit_frame_JT2JT)
316
+ RB_DEBUG_COUNTER(mjit_frame_JT2VM)
317
+
318
+ /* MJIT cancel counters */
319
+ RB_DEBUG_COUNTER(mjit_cancel)
320
+ RB_DEBUG_COUNTER(mjit_cancel_ivar_inline)
321
+ RB_DEBUG_COUNTER(mjit_cancel_send_inline)
322
+ RB_DEBUG_COUNTER(mjit_cancel_opt_insn) /* CALL_SIMPLE_METHOD */
323
+ RB_DEBUG_COUNTER(mjit_cancel_invalidate_all)
324
+
325
+ /* rb_mjit_unit_list length */
326
+ RB_DEBUG_COUNTER(mjit_length_unit_queue)
327
+ RB_DEBUG_COUNTER(mjit_length_active_units)
328
+ RB_DEBUG_COUNTER(mjit_length_compact_units)
329
+ RB_DEBUG_COUNTER(mjit_length_stale_units)
330
+
331
+ /* Other MJIT counters */
332
+ RB_DEBUG_COUNTER(mjit_compile_failures)
333
+
334
+ /* load (not implemented yet) */
335
+ /*
336
+ RB_DEBUG_COUNTER(load_files)
337
+ RB_DEBUG_COUNTER(load_path_is_not_realpath)
338
+ */
339
+ #endif
340
+
341
+ #ifndef RUBY_DEBUG_COUNTER_H
342
+ #define RUBY_DEBUG_COUNTER_H 1
343
+
344
+ #if !defined(__GNUC__) && USE_DEBUG_COUNTER
345
+ #error "USE_DEBUG_COUNTER is not supported by other than __GNUC__"
346
+ #endif
347
+
348
+ enum rb_debug_counter_type {
349
+ #define RB_DEBUG_COUNTER(name) RB_DEBUG_COUNTER_##name,
350
+ #include __FILE__
351
+ RB_DEBUG_COUNTER_MAX
352
+ #undef RB_DEBUG_COUNTER
353
+ };
354
+
355
+ #if USE_DEBUG_COUNTER
356
+ extern size_t rb_debug_counter[];
357
+
358
+ inline static int
359
+ rb_debug_counter_add(enum rb_debug_counter_type type, int add, int cond)
360
+ {
361
+ if (cond) {
362
+ rb_debug_counter[(int)type] += add;
363
+ }
364
+ return cond;
365
+ }
366
+
367
+ VALUE rb_debug_counter_reset(VALUE klass);
368
+ VALUE rb_debug_counter_show(VALUE klass);
369
+
370
+ #define RB_DEBUG_COUNTER_INC(type) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, 1)
371
+ #define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (!rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, !(cond)))
372
+ #define RB_DEBUG_COUNTER_INC_IF(type, cond) rb_debug_counter_add(RB_DEBUG_COUNTER_##type, 1, (cond))
373
+
374
+ #else
375
+ #define RB_DEBUG_COUNTER_INC(type) ((void)0)
376
+ #define RB_DEBUG_COUNTER_INC_UNLESS(type, cond) (cond)
377
+ #define RB_DEBUG_COUNTER_INC_IF(type, cond) (cond)
378
+ #endif
379
+
380
+ void rb_debug_counter_show_results(const char *msg);
381
+
382
+ RUBY_SYMBOL_EXPORT_BEGIN
383
+
384
+ size_t ruby_debug_counter_get(const char **names_ptr, size_t *counters_ptr);
385
+ void ruby_debug_counter_reset(void);
386
+ void ruby_debug_counter_show_at_exit(int enable);
387
+
388
+ RUBY_SYMBOL_EXPORT_END
389
+
390
+ #endif /* RUBY_DEBUG_COUNTER_H */