debase-ruby_core_source 0.7.2 → 0.7.3

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/debase/ruby_core_source.rb +2 -1
  4. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/addr2line.h +21 -0
  5. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ccan/build_assert/build_assert.h +40 -0
  6. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ccan/check_type/check_type.h +63 -0
  7. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ccan/container_of/container_of.h +142 -0
  8. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ccan/list/list.h +635 -0
  9. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ccan/str/str.h +16 -0
  10. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/constant.h +43 -0
  11. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/dln.h +51 -0
  12. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/eval_intern.h +275 -0
  13. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/gc.h +107 -0
  14. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/id.h +210 -0
  15. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/insns.inc +107 -0
  16. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/insns_info.inc +752 -0
  17. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/internal.h +1178 -0
  18. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/iseq.h +157 -0
  19. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/known_errors.inc +746 -0
  20. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/method.h +141 -0
  21. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/node.h +544 -0
  22. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/node_name.inc +212 -0
  23. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/opt_sc.inc +734 -0
  24. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/optinsn.inc +83 -0
  25. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/optunifs.inc +124 -0
  26. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/parse.h +203 -0
  27. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/probes_helper.h +67 -0
  28. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/regenc.h +234 -0
  29. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/regint.h +972 -0
  30. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/regparse.h +363 -0
  31. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/revision.h +1 -0
  32. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/ruby_atomic.h +170 -0
  33. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/siphash.h +48 -0
  34. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/symbol.h +87 -0
  35. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/thread_pthread.h +54 -0
  36. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/thread_win32.h +36 -0
  37. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/timev.h +42 -0
  38. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/transcode_data.h +123 -0
  39. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/version.h +53 -0
  40. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm.inc +3353 -0
  41. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm_core.h +1158 -0
  42. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm_debug.h +37 -0
  43. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm_exec.h +182 -0
  44. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm_insnhelper.h +233 -0
  45. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vm_opts.h +56 -0
  46. data/lib/debase/ruby_core_source/ruby-2.2.0-preview2/vmtc.inc +105 -0
  47. data/lib/debase/ruby_core_source/version.rb +1 -1
  48. metadata +45 -2
@@ -0,0 +1,210 @@
1
+ /* DO NOT EDIT THIS FILE DIRECTLY */
2
+ /**********************************************************************
3
+
4
+ id.h -
5
+
6
+ $Author: nobu $
7
+ created at: Sun Oct 19 21:12:51 2008
8
+
9
+ Copyright (C) 2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ #ifndef RUBY_ID_H
14
+ #define RUBY_ID_H
15
+
16
+ enum ruby_id_types {
17
+ RUBY_ID_STATIC_SYM = 0x01,
18
+ RUBY_ID_LOCAL = 0x00,
19
+ RUBY_ID_INSTANCE = (0x01<<1),
20
+ RUBY_ID_GLOBAL = (0x03<<1),
21
+ RUBY_ID_ATTRSET = (0x04<<1),
22
+ RUBY_ID_CONST = (0x05<<1),
23
+ RUBY_ID_CLASS = (0x06<<1),
24
+ RUBY_ID_JUNK = (0x07<<1),
25
+ RUBY_ID_INTERNAL = RUBY_ID_JUNK,
26
+ RUBY_ID_SCOPE_SHIFT = 4,
27
+ RUBY_ID_SCOPE_MASK = (~(~0U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
28
+ };
29
+
30
+ #define ID_STATIC_SYM RUBY_ID_STATIC_SYM
31
+ #define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT
32
+ #define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK
33
+ #define ID_LOCAL RUBY_ID_LOCAL
34
+ #define ID_INSTANCE RUBY_ID_INSTANCE
35
+ #define ID_GLOBAL RUBY_ID_GLOBAL
36
+ #define ID_ATTRSET RUBY_ID_ATTRSET
37
+ #define ID_CONST RUBY_ID_CONST
38
+ #define ID_CLASS RUBY_ID_CLASS
39
+ #define ID_JUNK RUBY_ID_JUNK
40
+ #define ID_INTERNAL RUBY_ID_INTERNAL
41
+
42
+ #define ID2ATTRSET(id) (((id)&~ID_SCOPE_MASK)|ID_ATTRSET)
43
+
44
+ #define symIFUNC ID2SYM(idIFUNC)
45
+ #define symCFUNC ID2SYM(idCFUNC)
46
+
47
+ #define RUBY_TOKEN_DOT2 128
48
+ #define RUBY_TOKEN_DOT3 129
49
+ #define RUBY_TOKEN_UPLUS 130
50
+ #define RUBY_TOKEN_UMINUS 131
51
+ #define RUBY_TOKEN_POW 132
52
+ #define RUBY_TOKEN_DSTAR 133
53
+ #define RUBY_TOKEN_CMP 134
54
+ #define RUBY_TOKEN_LSHFT 135
55
+ #define RUBY_TOKEN_RSHFT 136
56
+ #define RUBY_TOKEN_LEQ 137
57
+ #define RUBY_TOKEN_GEQ 138
58
+ #define RUBY_TOKEN_EQ 139
59
+ #define RUBY_TOKEN_EQQ 140
60
+ #define RUBY_TOKEN_NEQ 141
61
+ #define RUBY_TOKEN_MATCH 142
62
+ #define RUBY_TOKEN_NMATCH 143
63
+ #define RUBY_TOKEN_AREF 144
64
+ #define RUBY_TOKEN_ASET 145
65
+ #define RUBY_TOKEN_COLON2 146
66
+ #define RUBY_TOKEN_COLON3 147
67
+ #define RUBY_TOKEN_ANDOP 148
68
+ #define RUBY_TOKEN_OROP 149
69
+ #define RUBY_TOKEN(t) RUBY_TOKEN_##t
70
+
71
+ enum ruby_method_ids {
72
+ idDot2 = RUBY_TOKEN(DOT2),
73
+ idDot3 = RUBY_TOKEN(DOT3),
74
+ idUPlus = RUBY_TOKEN(UPLUS),
75
+ idUMinus = RUBY_TOKEN(UMINUS),
76
+ idPow = RUBY_TOKEN(POW),
77
+ idCmp = RUBY_TOKEN(CMP),
78
+ idPLUS = '+',
79
+ idMINUS = '-',
80
+ idMULT = '*',
81
+ idDIV = '/',
82
+ idMOD = '%',
83
+ idLT = '<',
84
+ idLTLT = RUBY_TOKEN(LSHFT),
85
+ idLE = RUBY_TOKEN(LEQ),
86
+ idGT = '>',
87
+ idGTGT = RUBY_TOKEN(RSHFT),
88
+ idGE = RUBY_TOKEN(GEQ),
89
+ idEq = RUBY_TOKEN(EQ),
90
+ idEqq = RUBY_TOKEN(EQQ),
91
+ idNeq = RUBY_TOKEN(NEQ),
92
+ idNot = '!',
93
+ idBackquote = '`',
94
+ idEqTilde = RUBY_TOKEN(MATCH),
95
+ idNeqTilde = RUBY_TOKEN(NMATCH),
96
+ idAREF = RUBY_TOKEN(AREF),
97
+ idASET = RUBY_TOKEN(ASET),
98
+ idCOLON2 = RUBY_TOKEN(COLON2),
99
+ idANDOP = RUBY_TOKEN(ANDOP),
100
+ idOROP = RUBY_TOKEN(OROP),
101
+ tPRESERVED_ID_BEGIN = 149,
102
+ idNULL,
103
+ idEmptyP,
104
+ idEqlP,
105
+ idRespond_to,
106
+ idRespond_to_missing,
107
+ idIFUNC,
108
+ idCFUNC,
109
+ id_core_set_method_alias,
110
+ id_core_set_variable_alias,
111
+ id_core_undef_method,
112
+ id_core_define_method,
113
+ id_core_define_singleton_method,
114
+ id_core_set_postexe,
115
+ id_core_hash_from_ary,
116
+ id_core_hash_merge_ary,
117
+ id_core_hash_merge_ptr,
118
+ id_core_hash_merge_kwd,
119
+ tPRESERVED_ID_END,
120
+ tFreeze,
121
+ tInspect,
122
+ tIntern,
123
+ tObject_id,
124
+ tConst_missing,
125
+ tMethodMissing,
126
+ tMethod_added,
127
+ tSingleton_method_added,
128
+ tMethod_removed,
129
+ tSingleton_method_removed,
130
+ tMethod_undefined,
131
+ tSingleton_method_undefined,
132
+ tLength,
133
+ tSize,
134
+ tGets,
135
+ tSucc,
136
+ tEach,
137
+ tProc,
138
+ tLambda,
139
+ tSend,
140
+ t__send__,
141
+ t__attached__,
142
+ tInitialize,
143
+ tInitialize_copy,
144
+ tInitialize_clone,
145
+ tInitialize_dup,
146
+ tTo_int,
147
+ tTo_ary,
148
+ tTo_str,
149
+ tTo_sym,
150
+ tTo_hash,
151
+ tTo_proc,
152
+ tTo_io,
153
+ tTo_a,
154
+ tTo_s,
155
+ tTo_i,
156
+ tBt,
157
+ tBt_locations,
158
+ tCall,
159
+ tMesg,
160
+ tException,
161
+ tUScore,
162
+ tNEXT_ID,
163
+ #define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL|ID_STATIC_SYM)
164
+ TOKEN2LOCALID(Freeze),
165
+ TOKEN2LOCALID(Inspect),
166
+ TOKEN2LOCALID(Intern),
167
+ TOKEN2LOCALID(Object_id),
168
+ TOKEN2LOCALID(Const_missing),
169
+ TOKEN2LOCALID(MethodMissing),
170
+ TOKEN2LOCALID(Method_added),
171
+ TOKEN2LOCALID(Singleton_method_added),
172
+ TOKEN2LOCALID(Method_removed),
173
+ TOKEN2LOCALID(Singleton_method_removed),
174
+ TOKEN2LOCALID(Method_undefined),
175
+ TOKEN2LOCALID(Singleton_method_undefined),
176
+ TOKEN2LOCALID(Length),
177
+ TOKEN2LOCALID(Size),
178
+ TOKEN2LOCALID(Gets),
179
+ TOKEN2LOCALID(Succ),
180
+ TOKEN2LOCALID(Each),
181
+ TOKEN2LOCALID(Proc),
182
+ TOKEN2LOCALID(Lambda),
183
+ TOKEN2LOCALID(Send),
184
+ TOKEN2LOCALID(__send__),
185
+ TOKEN2LOCALID(__attached__),
186
+ TOKEN2LOCALID(Initialize),
187
+ TOKEN2LOCALID(Initialize_copy),
188
+ TOKEN2LOCALID(Initialize_clone),
189
+ TOKEN2LOCALID(Initialize_dup),
190
+ TOKEN2LOCALID(To_int),
191
+ TOKEN2LOCALID(To_ary),
192
+ TOKEN2LOCALID(To_str),
193
+ TOKEN2LOCALID(To_sym),
194
+ TOKEN2LOCALID(To_hash),
195
+ TOKEN2LOCALID(To_proc),
196
+ TOKEN2LOCALID(To_io),
197
+ TOKEN2LOCALID(To_a),
198
+ TOKEN2LOCALID(To_s),
199
+ TOKEN2LOCALID(To_i),
200
+ TOKEN2LOCALID(Bt),
201
+ TOKEN2LOCALID(Bt_locations),
202
+ TOKEN2LOCALID(Call),
203
+ TOKEN2LOCALID(Mesg),
204
+ TOKEN2LOCALID(Exception),
205
+ TOKEN2LOCALID(UScore),
206
+ tLAST_OP_ID = tPRESERVED_ID_END-1,
207
+ idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
208
+ };
209
+
210
+ #endif /* RUBY_ID_H */
@@ -0,0 +1,107 @@
1
+ /** -*-c-*-
2
+ This file contains YARV instructions list.
3
+
4
+ ----
5
+ This file is auto generated by insns2vm.rb
6
+ DO NOT TOUCH!
7
+
8
+ If you want to fix something, you must edit 'template/insns.inc.tmpl'
9
+ or tool/insns2vm.rb
10
+ */
11
+
12
+
13
+ /* BIN : Basic Instruction Name */
14
+ #define BIN(n) YARVINSN_##n
15
+
16
+ enum ruby_vminsn_type {
17
+ BIN(nop) = 0,
18
+ BIN(getlocal) = 1,
19
+ BIN(setlocal) = 2,
20
+ BIN(getspecial) = 3,
21
+ BIN(setspecial) = 4,
22
+ BIN(getinstancevariable) = 5,
23
+ BIN(setinstancevariable) = 6,
24
+ BIN(getclassvariable) = 7,
25
+ BIN(setclassvariable) = 8,
26
+ BIN(getconstant) = 9,
27
+ BIN(setconstant) = 10,
28
+ BIN(getglobal) = 11,
29
+ BIN(setglobal) = 12,
30
+ BIN(putnil) = 13,
31
+ BIN(putself) = 14,
32
+ BIN(putobject) = 15,
33
+ BIN(putspecialobject) = 16,
34
+ BIN(putiseq) = 17,
35
+ BIN(putstring) = 18,
36
+ BIN(concatstrings) = 19,
37
+ BIN(tostring) = 20,
38
+ BIN(toregexp) = 21,
39
+ BIN(newarray) = 22,
40
+ BIN(duparray) = 23,
41
+ BIN(expandarray) = 24,
42
+ BIN(concatarray) = 25,
43
+ BIN(splatarray) = 26,
44
+ BIN(newhash) = 27,
45
+ BIN(newrange) = 28,
46
+ BIN(pop) = 29,
47
+ BIN(dup) = 30,
48
+ BIN(dupn) = 31,
49
+ BIN(swap) = 32,
50
+ BIN(reput) = 33,
51
+ BIN(topn) = 34,
52
+ BIN(setn) = 35,
53
+ BIN(adjuststack) = 36,
54
+ BIN(defined) = 37,
55
+ BIN(checkmatch) = 38,
56
+ BIN(checkkeyword) = 39,
57
+ BIN(trace) = 40,
58
+ BIN(defineclass) = 41,
59
+ BIN(send) = 42,
60
+ BIN(opt_str_freeze) = 43,
61
+ BIN(opt_send_without_block) = 44,
62
+ BIN(invokesuper) = 45,
63
+ BIN(invokeblock) = 46,
64
+ BIN(leave) = 47,
65
+ BIN(throw) = 48,
66
+ BIN(jump) = 49,
67
+ BIN(branchif) = 50,
68
+ BIN(branchunless) = 51,
69
+ BIN(getinlinecache) = 52,
70
+ BIN(setinlinecache) = 53,
71
+ BIN(once) = 54,
72
+ BIN(opt_case_dispatch) = 55,
73
+ BIN(opt_plus) = 56,
74
+ BIN(opt_minus) = 57,
75
+ BIN(opt_mult) = 58,
76
+ BIN(opt_div) = 59,
77
+ BIN(opt_mod) = 60,
78
+ BIN(opt_eq) = 61,
79
+ BIN(opt_neq) = 62,
80
+ BIN(opt_lt) = 63,
81
+ BIN(opt_le) = 64,
82
+ BIN(opt_gt) = 65,
83
+ BIN(opt_ge) = 66,
84
+ BIN(opt_ltlt) = 67,
85
+ BIN(opt_aref) = 68,
86
+ BIN(opt_aset) = 69,
87
+ BIN(opt_aset_with) = 70,
88
+ BIN(opt_aref_with) = 71,
89
+ BIN(opt_length) = 72,
90
+ BIN(opt_size) = 73,
91
+ BIN(opt_empty_p) = 74,
92
+ BIN(opt_succ) = 75,
93
+ BIN(opt_not) = 76,
94
+ BIN(opt_regexpmatch1) = 77,
95
+ BIN(opt_regexpmatch2) = 78,
96
+ BIN(opt_call_c_function) = 79,
97
+ BIN(bitblt) = 80,
98
+ BIN(answer) = 81,
99
+ BIN(getlocal_OP__WC__0) = 82,
100
+ BIN(getlocal_OP__WC__1) = 83,
101
+ BIN(setlocal_OP__WC__0) = 84,
102
+ BIN(setlocal_OP__WC__1) = 85,
103
+ BIN(putobject_OP_INT2FIX_O_0_C_) = 86,
104
+ BIN(putobject_OP_INT2FIX_O_1_C_) = 87,
105
+ VM_INSTRUCTION_SIZE = 88
106
+ };
107
+
@@ -0,0 +1,752 @@
1
+ /** -*-c-*-
2
+ This file contains instruction information for yarv instruction sequence.
3
+
4
+ ----
5
+ This file is auto generated by insns2vm.rb
6
+ DO NOT TOUCH!
7
+
8
+ If you want to fix something, you must edit 'template/insns_info.inc.tmpl'
9
+ or tool/insns2vm.rb
10
+ */
11
+
12
+ #define TS_OFFSET 'O'
13
+ #define TS_NUM 'N'
14
+ #define TS_LINDEX 'L'
15
+ #define TS_VALUE 'V'
16
+ #define TS_ID 'I'
17
+ #define TS_GENTRY 'G'
18
+ #define TS_IC 'K'
19
+ #define TS_CALLINFO 'C'
20
+ #define TS_CDHASH 'H'
21
+ #define TS_ISEQ 'S'
22
+ #define TS_VARIABLE '.'
23
+ #define TS_FUNCPTR 'F'
24
+
25
+ static const char *const insn_name_info[] = {
26
+ "nop",
27
+ "getlocal",
28
+ "setlocal",
29
+ "getspecial",
30
+ "setspecial",
31
+ "getinstancevariable",
32
+ "setinstancevariable",
33
+ "getclassvariable",
34
+ "setclassvariable",
35
+ "getconstant",
36
+ "setconstant",
37
+ "getglobal",
38
+ "setglobal",
39
+ "putnil",
40
+ "putself",
41
+ "putobject",
42
+ "putspecialobject",
43
+ "putiseq",
44
+ "putstring",
45
+ "concatstrings",
46
+ "tostring",
47
+ "toregexp",
48
+ "newarray",
49
+ "duparray",
50
+ "expandarray",
51
+ "concatarray",
52
+ "splatarray",
53
+ "newhash",
54
+ "newrange",
55
+ "pop",
56
+ "dup",
57
+ "dupn",
58
+ "swap",
59
+ "reput",
60
+ "topn",
61
+ "setn",
62
+ "adjuststack",
63
+ "defined",
64
+ "checkmatch",
65
+ "checkkeyword",
66
+ "trace",
67
+ "defineclass",
68
+ "send",
69
+ "opt_str_freeze",
70
+ "opt_send_without_block",
71
+ "invokesuper",
72
+ "invokeblock",
73
+ "leave",
74
+ "throw",
75
+ "jump",
76
+ "branchif",
77
+ "branchunless",
78
+ "getinlinecache",
79
+ "setinlinecache",
80
+ "once",
81
+ "opt_case_dispatch",
82
+ "opt_plus",
83
+ "opt_minus",
84
+ "opt_mult",
85
+ "opt_div",
86
+ "opt_mod",
87
+ "opt_eq",
88
+ "opt_neq",
89
+ "opt_lt",
90
+ "opt_le",
91
+ "opt_gt",
92
+ "opt_ge",
93
+ "opt_ltlt",
94
+ "opt_aref",
95
+ "opt_aset",
96
+ "opt_aset_with",
97
+ "opt_aref_with",
98
+ "opt_length",
99
+ "opt_size",
100
+ "opt_empty_p",
101
+ "opt_succ",
102
+ "opt_not",
103
+ "opt_regexpmatch1",
104
+ "opt_regexpmatch2",
105
+ "opt_call_c_function",
106
+ "bitblt",
107
+ "answer",
108
+ "getlocal_OP__WC__0",
109
+ "getlocal_OP__WC__1",
110
+ "setlocal_OP__WC__0",
111
+ "setlocal_OP__WC__1",
112
+ "putobject_OP_INT2FIX_O_0_C_",
113
+ "putobject_OP_INT2FIX_O_1_C_",
114
+
115
+ };
116
+
117
+ static const char *const insn_operand_info[] = {
118
+ "",
119
+ "LN",
120
+ "LN",
121
+ "NN",
122
+ "N",
123
+ "IK",
124
+ "IK",
125
+ "I",
126
+ "I",
127
+ "I",
128
+ "I",
129
+ "G",
130
+ "G",
131
+ "",
132
+ "",
133
+ "V",
134
+ "N",
135
+ "S",
136
+ "V",
137
+ "N",
138
+ "",
139
+ "NN",
140
+ "N",
141
+ "V",
142
+ "NN",
143
+ "",
144
+ "V",
145
+ "N",
146
+ "N",
147
+ "",
148
+ "",
149
+ "N",
150
+ "",
151
+ "",
152
+ "N",
153
+ "N",
154
+ "N",
155
+ "NVV",
156
+ "N",
157
+ "LN",
158
+ "N",
159
+ "ISN",
160
+ "C",
161
+ "V",
162
+ "C",
163
+ "C",
164
+ "C",
165
+ "",
166
+ "N",
167
+ "O",
168
+ "O",
169
+ "O",
170
+ "OK",
171
+ "K",
172
+ "SK",
173
+ "HO",
174
+ "C",
175
+ "C",
176
+ "C",
177
+ "C",
178
+ "C",
179
+ "C",
180
+ "CC",
181
+ "C",
182
+ "C",
183
+ "C",
184
+ "C",
185
+ "C",
186
+ "C",
187
+ "C",
188
+ "CV",
189
+ "CV",
190
+ "C",
191
+ "C",
192
+ "C",
193
+ "C",
194
+ "C",
195
+ "V",
196
+ "C",
197
+ "F",
198
+ "",
199
+ "",
200
+ "L",
201
+ "L",
202
+ "L",
203
+ "L",
204
+ "",
205
+ "",
206
+
207
+ };
208
+
209
+ static const int insn_len_info[] = {
210
+ 1,
211
+ 3,
212
+ 3,
213
+ 3,
214
+ 2,
215
+ 3,
216
+ 3,
217
+ 2,
218
+ 2,
219
+ 2,
220
+ 2,
221
+ 2,
222
+ 2,
223
+ 1,
224
+ 1,
225
+ 2,
226
+ 2,
227
+ 2,
228
+ 2,
229
+ 2,
230
+ 1,
231
+ 3,
232
+ 2,
233
+ 2,
234
+ 3,
235
+ 1,
236
+ 2,
237
+ 2,
238
+ 2,
239
+ 1,
240
+ 1,
241
+ 2,
242
+ 1,
243
+ 1,
244
+ 2,
245
+ 2,
246
+ 2,
247
+ 4,
248
+ 2,
249
+ 3,
250
+ 2,
251
+ 4,
252
+ 2,
253
+ 2,
254
+ 2,
255
+ 2,
256
+ 2,
257
+ 1,
258
+ 2,
259
+ 2,
260
+ 2,
261
+ 2,
262
+ 3,
263
+ 2,
264
+ 3,
265
+ 3,
266
+ 2,
267
+ 2,
268
+ 2,
269
+ 2,
270
+ 2,
271
+ 2,
272
+ 3,
273
+ 2,
274
+ 2,
275
+ 2,
276
+ 2,
277
+ 2,
278
+ 2,
279
+ 2,
280
+ 3,
281
+ 3,
282
+ 2,
283
+ 2,
284
+ 2,
285
+ 2,
286
+ 2,
287
+ 2,
288
+ 2,
289
+ 2,
290
+ 1,
291
+ 1,
292
+ 2,
293
+ 2,
294
+ 2,
295
+ 2,
296
+ 1,
297
+ 1,
298
+
299
+ };
300
+
301
+ #ifdef USE_INSN_RET_NUM
302
+ static const int insn_stack_push_num_info[] = {
303
+ 0,
304
+ 1,
305
+ 0,
306
+ 1,
307
+ 0,
308
+ 1,
309
+ 0,
310
+ 1,
311
+ 0,
312
+ 1,
313
+ 0,
314
+ 1,
315
+ 0,
316
+ 1,
317
+ 1,
318
+ 1,
319
+ 1,
320
+ 1,
321
+ 1,
322
+ 1,
323
+ 1,
324
+ 1,
325
+ 1,
326
+ 1,
327
+ 1,
328
+ 1,
329
+ 1,
330
+ 1,
331
+ 1,
332
+ 0,
333
+ 2,
334
+ 1,
335
+ 2,
336
+ 1,
337
+ 1,
338
+ 1,
339
+ 1,
340
+ 1,
341
+ 1,
342
+ 1,
343
+ 0,
344
+ 1,
345
+ 1,
346
+ 1,
347
+ 1,
348
+ 1,
349
+ 1,
350
+ 1,
351
+ 1,
352
+ 0,
353
+ 0,
354
+ 0,
355
+ 1,
356
+ 1,
357
+ 1,
358
+ 0,
359
+ 1,
360
+ 1,
361
+ 1,
362
+ 1,
363
+ 1,
364
+ 1,
365
+ 1,
366
+ 1,
367
+ 1,
368
+ 1,
369
+ 1,
370
+ 1,
371
+ 1,
372
+ 1,
373
+ 1,
374
+ 1,
375
+ 1,
376
+ 1,
377
+ 1,
378
+ 1,
379
+ 1,
380
+ 1,
381
+ 1,
382
+ 0,
383
+ 1,
384
+ 1,
385
+ 1,
386
+ 1,
387
+ 0,
388
+ 0,
389
+ 1,
390
+ 1,
391
+
392
+ };
393
+ #endif
394
+
395
+ #ifdef USE_INSN_STACK_INCREASE
396
+ static int
397
+ insn_stack_increase(int depth, int insn, VALUE *opes)
398
+ {
399
+ switch(insn){
400
+ case BIN(nop):{
401
+ return depth + 0;
402
+ }
403
+ case BIN(getlocal):{
404
+ return depth + 1;
405
+ }
406
+ case BIN(setlocal):{
407
+ return depth + -1;
408
+ }
409
+ case BIN(getspecial):{
410
+ return depth + 1;
411
+ }
412
+ case BIN(setspecial):{
413
+ return depth + -1;
414
+ }
415
+ case BIN(getinstancevariable):{
416
+ return depth + 1;
417
+ }
418
+ case BIN(setinstancevariable):{
419
+ return depth + -1;
420
+ }
421
+ case BIN(getclassvariable):{
422
+ return depth + 1;
423
+ }
424
+ case BIN(setclassvariable):{
425
+ return depth + -1;
426
+ }
427
+ case BIN(getconstant):{
428
+ return depth + 0;
429
+ }
430
+ case BIN(setconstant):{
431
+ return depth + -2;
432
+ }
433
+ case BIN(getglobal):{
434
+ return depth + 1;
435
+ }
436
+ case BIN(setglobal):{
437
+ return depth + -1;
438
+ }
439
+ case BIN(putnil):{
440
+ return depth + 1;
441
+ }
442
+ case BIN(putself):{
443
+ return depth + 1;
444
+ }
445
+ case BIN(putobject):{
446
+ return depth + 1;
447
+ }
448
+ case BIN(putspecialobject):{
449
+ return depth + 1;
450
+ }
451
+ case BIN(putiseq):{
452
+ return depth + 1;
453
+ }
454
+ case BIN(putstring):{
455
+ return depth + 1;
456
+ }
457
+ case BIN(concatstrings):{
458
+ int inc = 0;
459
+ int num = FIX2INT(opes[0]);
460
+ inc += 1 - num;;
461
+ return depth + inc;
462
+ }
463
+ case BIN(tostring):{
464
+ return depth + 0;
465
+ }
466
+ case BIN(toregexp):{
467
+ int inc = 0;
468
+ int cnt = FIX2INT(opes[1]);
469
+ inc += 1 - cnt;;
470
+ return depth + inc;
471
+ }
472
+ case BIN(newarray):{
473
+ int inc = 0;
474
+ int num = FIX2INT(opes[0]);
475
+ inc += 1 - num;;
476
+ return depth + inc;
477
+ }
478
+ case BIN(duparray):{
479
+ return depth + 1;
480
+ }
481
+ case BIN(expandarray):{
482
+ int inc = 0;
483
+ int num = FIX2INT(opes[0]);
484
+ int flag = FIX2INT(opes[1]);
485
+ inc += num - 1 + (flag & 1 ? 1 : 0);;
486
+ return depth + inc;
487
+ }
488
+ case BIN(concatarray):{
489
+ return depth + -1;
490
+ }
491
+ case BIN(splatarray):{
492
+ return depth + 0;
493
+ }
494
+ case BIN(newhash):{
495
+ int inc = 0;
496
+ int num = FIX2INT(opes[0]);
497
+ inc += 1 - num;;
498
+ return depth + inc;
499
+ }
500
+ case BIN(newrange):{
501
+ return depth + -1;
502
+ }
503
+ case BIN(pop):{
504
+ return depth + -1;
505
+ }
506
+ case BIN(dup):{
507
+ return depth + 1;
508
+ }
509
+ case BIN(dupn):{
510
+ int inc = 0;
511
+ int n = FIX2INT(opes[0]);
512
+ inc += n;;
513
+ return depth + inc;
514
+ }
515
+ case BIN(swap):{
516
+ return depth + 0;
517
+ }
518
+ case BIN(reput):{
519
+ int inc = 0;
520
+ inc += 0;;
521
+ return depth + inc;
522
+ }
523
+ case BIN(topn):{
524
+ int inc = 0;
525
+ inc += 1;;
526
+ return depth + inc;
527
+ }
528
+ case BIN(setn):{
529
+ int inc = 0;
530
+ inc += 0;
531
+ return depth + inc;
532
+ }
533
+ case BIN(adjuststack):{
534
+ int inc = 0;
535
+ int n = FIX2INT(opes[0]);
536
+ inc -= n;
537
+ return depth + inc;
538
+ }
539
+ case BIN(defined):{
540
+ return depth + 0;
541
+ }
542
+ case BIN(checkmatch):{
543
+ return depth + -1;
544
+ }
545
+ case BIN(checkkeyword):{
546
+ return depth + 1;
547
+ }
548
+ case BIN(trace):{
549
+ return depth + 0;
550
+ }
551
+ case BIN(defineclass):{
552
+ return depth + -1;
553
+ }
554
+ case BIN(send):{
555
+ int inc = 0;
556
+ CALL_INFO ci = (CALL_INFO)(opes[0]);
557
+ inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));;
558
+ return depth + inc;
559
+ }
560
+ case BIN(opt_str_freeze):{
561
+ return depth + 1;
562
+ }
563
+ case BIN(opt_send_without_block):{
564
+ int inc = 0;
565
+ CALL_INFO ci = (CALL_INFO)(opes[0]);
566
+ inc += -ci->orig_argc;;
567
+ return depth + inc;
568
+ }
569
+ case BIN(invokesuper):{
570
+ int inc = 0;
571
+ CALL_INFO ci = (CALL_INFO)(opes[0]);
572
+ inc += - (int)(ci->orig_argc + ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0));;
573
+ return depth + inc;
574
+ }
575
+ case BIN(invokeblock):{
576
+ int inc = 0;
577
+ CALL_INFO ci = (CALL_INFO)(opes[0]);
578
+ inc += 1 - ci->orig_argc;;
579
+ return depth + inc;
580
+ }
581
+ case BIN(leave):{
582
+ return depth + 0;
583
+ }
584
+ case BIN(throw):{
585
+ return depth + 0;
586
+ }
587
+ case BIN(jump):{
588
+ return depth + 0;
589
+ }
590
+ case BIN(branchif):{
591
+ return depth + -1;
592
+ }
593
+ case BIN(branchunless):{
594
+ return depth + -1;
595
+ }
596
+ case BIN(getinlinecache):{
597
+ return depth + 1;
598
+ }
599
+ case BIN(setinlinecache):{
600
+ return depth + 0;
601
+ }
602
+ case BIN(once):{
603
+ return depth + 1;
604
+ }
605
+ case BIN(opt_case_dispatch):{
606
+ int inc = 0;
607
+ inc += -1;;
608
+ return depth + inc;
609
+ }
610
+ case BIN(opt_plus):{
611
+ return depth + -1;
612
+ }
613
+ case BIN(opt_minus):{
614
+ return depth + -1;
615
+ }
616
+ case BIN(opt_mult):{
617
+ return depth + -1;
618
+ }
619
+ case BIN(opt_div):{
620
+ return depth + -1;
621
+ }
622
+ case BIN(opt_mod):{
623
+ return depth + -1;
624
+ }
625
+ case BIN(opt_eq):{
626
+ return depth + -1;
627
+ }
628
+ case BIN(opt_neq):{
629
+ return depth + -1;
630
+ }
631
+ case BIN(opt_lt):{
632
+ return depth + -1;
633
+ }
634
+ case BIN(opt_le):{
635
+ return depth + -1;
636
+ }
637
+ case BIN(opt_gt):{
638
+ return depth + -1;
639
+ }
640
+ case BIN(opt_ge):{
641
+ return depth + -1;
642
+ }
643
+ case BIN(opt_ltlt):{
644
+ return depth + -1;
645
+ }
646
+ case BIN(opt_aref):{
647
+ return depth + -1;
648
+ }
649
+ case BIN(opt_aset):{
650
+ return depth + -2;
651
+ }
652
+ case BIN(opt_aset_with):{
653
+ return depth + -1;
654
+ }
655
+ case BIN(opt_aref_with):{
656
+ return depth + 0;
657
+ }
658
+ case BIN(opt_length):{
659
+ return depth + 0;
660
+ }
661
+ case BIN(opt_size):{
662
+ return depth + 0;
663
+ }
664
+ case BIN(opt_empty_p):{
665
+ return depth + 0;
666
+ }
667
+ case BIN(opt_succ):{
668
+ return depth + 0;
669
+ }
670
+ case BIN(opt_not):{
671
+ return depth + 0;
672
+ }
673
+ case BIN(opt_regexpmatch1):{
674
+ return depth + 0;
675
+ }
676
+ case BIN(opt_regexpmatch2):{
677
+ return depth + -1;
678
+ }
679
+ case BIN(opt_call_c_function):{
680
+ return depth + 0;
681
+ }
682
+ case BIN(bitblt):{
683
+ return depth + 1;
684
+ }
685
+ case BIN(answer):{
686
+ return depth + 1;
687
+ }
688
+ case BIN(getlocal_OP__WC__0):{
689
+ return depth + 1;
690
+ }
691
+ case BIN(getlocal_OP__WC__1):{
692
+ return depth + 1;
693
+ }
694
+ case BIN(setlocal_OP__WC__0):{
695
+ return depth + -1;
696
+ }
697
+ case BIN(setlocal_OP__WC__1):{
698
+ return depth + -1;
699
+ }
700
+ case BIN(putobject_OP_INT2FIX_O_0_C_):{
701
+ return depth + 1;
702
+ }
703
+ case BIN(putobject_OP_INT2FIX_O_1_C_):{
704
+ return depth + 1;
705
+ }
706
+
707
+ default:
708
+ rb_bug("insn_sp_increase: unreachable");
709
+ }
710
+ return 0;
711
+ }
712
+ #endif
713
+
714
+ /* some utilities */
715
+
716
+ static int
717
+ insn_len(VALUE insn)
718
+ {
719
+ return insn_len_info[(int)insn];
720
+ }
721
+
722
+ static const char *
723
+ insn_name(VALUE insn)
724
+ {
725
+ return insn_name_info[(int)insn];
726
+ }
727
+
728
+ static const char *
729
+ insn_op_types(VALUE insn)
730
+ {
731
+ return insn_operand_info[(int)insn];
732
+ }
733
+
734
+ static int
735
+ insn_op_type(VALUE insn, long pos)
736
+ {
737
+ int len = insn_len(insn) - 1;
738
+ if(pos < len){
739
+ return insn_operand_info[(int)insn][pos];
740
+ }
741
+ else{
742
+ return 0;
743
+ }
744
+ }
745
+
746
+ #ifdef USE_INSN_RET_NUM
747
+ static int
748
+ insn_ret_num(VALUE insn)
749
+ {
750
+ return insn_stack_push_num_info[(int)insn];
751
+ }
752
+ #endif