debugger-ruby_core_source 1.3.7 → 1.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/debug.h +36 -0
  4. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/dln.h +41 -0
  5. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/encdb.h +163 -0
  6. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/eval_intern.h +232 -0
  7. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/gc.h +77 -0
  8. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/id.h +170 -0
  9. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/insns.inc +179 -0
  10. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/insns_info.inc +695 -0
  11. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/iseq.h +104 -0
  12. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/known_errors.inc +731 -0
  13. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/method.h +103 -0
  14. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/node.h +483 -0
  15. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/node_name.inc +208 -0
  16. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/opt_sc.inc +670 -0
  17. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/optinsn.inc +30 -0
  18. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/optunifs.inc +116 -0
  19. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/parse.h +205 -0
  20. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/regenc.h +211 -0
  21. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/regint.h +841 -0
  22. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/regparse.h +354 -0
  23. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/revision.h +1 -0
  24. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/thread_pthread.h +27 -0
  25. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/thread_win32.h +33 -0
  26. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/timev.h +21 -0
  27. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/transcode_data.h +109 -0
  28. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/transdb.h +179 -0
  29. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/version.h +55 -0
  30. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vm.inc +3055 -0
  31. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vm_core.h +706 -0
  32. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vm_exec.h +184 -0
  33. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vm_insnhelper.h +208 -0
  34. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vm_opts.h +51 -0
  35. data/lib/debugger/ruby_core_source/ruby-1.9.2-p330/vmtc.inc +97 -0
  36. data/lib/debugger/ruby_core_source/version.rb +1 -1
  37. metadata +36 -3
@@ -0,0 +1,77 @@
1
+
2
+ #ifndef RUBY_GC_H
3
+ #define RUBY_GC_H 1
4
+
5
+ #if defined(__x86_64__) && defined(__GNUC__)
6
+ #define SET_MACHINE_STACK_END(p) __asm__("movq\t%%rsp, %0" : "=r" (*p))
7
+ #elif defined(__i386) && defined(__GNUC__)
8
+ #define SET_MACHINE_STACK_END(p) __asm__("movl\t%%esp, %0" : "=r" (*p))
9
+ #else
10
+ NOINLINE(void rb_gc_set_stack_end(VALUE **stack_end_p));
11
+ #define SET_MACHINE_STACK_END(p) rb_gc_set_stack_end(p)
12
+ #define USE_CONSERVATIVE_STACK_END
13
+ #endif
14
+
15
+ /* for GC debug */
16
+
17
+ #ifndef RUBY_MARK_FREE_DEBUG
18
+ #define RUBY_MARK_FREE_DEBUG 0
19
+ #endif
20
+
21
+ #if RUBY_MARK_FREE_DEBUG
22
+ extern int ruby_gc_debug_indent;
23
+
24
+ static void
25
+ rb_gc_debug_indent(void)
26
+ {
27
+ printf("%*s", ruby_gc_debug_indent, "");
28
+ }
29
+
30
+ static void
31
+ rb_gc_debug_body(const char *mode, const char *msg, int st, void *ptr)
32
+ {
33
+ if (st == 0) {
34
+ ruby_gc_debug_indent--;
35
+ }
36
+ rb_gc_debug_indent();
37
+ printf("%s: %s %s (%p)\n", mode, st ? "->" : "<-", msg, ptr);
38
+
39
+ if (st) {
40
+ ruby_gc_debug_indent++;
41
+ }
42
+
43
+ fflush(stdout);
44
+ }
45
+
46
+ #define RUBY_MARK_ENTER(msg) rb_gc_debug_body("mark", msg, 1, ptr)
47
+ #define RUBY_MARK_LEAVE(msg) rb_gc_debug_body("mark", msg, 0, ptr)
48
+ #define RUBY_FREE_ENTER(msg) rb_gc_debug_body("free", msg, 1, ptr)
49
+ #define RUBY_FREE_LEAVE(msg) rb_gc_debug_body("free", msg, 0, ptr)
50
+ #define RUBY_GC_INFO rb_gc_debug_indent(); printf
51
+
52
+ #else
53
+ #define RUBY_MARK_ENTER(msg)
54
+ #define RUBY_MARK_LEAVE(msg)
55
+ #define RUBY_FREE_ENTER(msg)
56
+ #define RUBY_FREE_LEAVE(msg)
57
+ #define RUBY_GC_INFO if(0)printf
58
+ #endif
59
+
60
+ #define RUBY_MARK_UNLESS_NULL(ptr) if(RTEST(ptr)){rb_gc_mark(ptr);}
61
+ #define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
62
+
63
+ #if STACK_GROW_DIRECTION > 0
64
+ # define STACK_UPPER(x, a, b) a
65
+ #elif STACK_GROW_DIRECTION < 0
66
+ # define STACK_UPPER(x, a, b) b
67
+ #else
68
+ RUBY_EXTERN int ruby_stack_grow_direction;
69
+ int ruby_get_stack_grow_direction(volatile VALUE *addr);
70
+ # define stack_growup_p(x) ( \
71
+ (ruby_stack_grow_direction ? \
72
+ ruby_stack_grow_direction : \
73
+ ruby_get_stack_grow_direction(x)) > 0)
74
+ # define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b)
75
+ #endif
76
+
77
+ #endif /* RUBY_GC_H */
@@ -0,0 +1,170 @@
1
+ /* DO NOT EDIT THIS FILE DIRECTLY */
2
+ /**********************************************************************
3
+
4
+ id.h -
5
+
6
+ $Author: akr $
7
+ created at: Sun Oct 19 21:12:51 2008
8
+
9
+ Copyright (C) 2007 Koichi Sasada
10
+
11
+ **********************************************************************/
12
+
13
+ #ifndef RUBY_ID_H
14
+ #define RUBY_ID_H
15
+
16
+ #define ID_SCOPE_SHIFT 3
17
+ #define ID_SCOPE_MASK 0x07
18
+ #define ID_LOCAL 0x00
19
+ #define ID_INSTANCE 0x01
20
+ #define ID_GLOBAL 0x03
21
+ #define ID_ATTRSET 0x04
22
+ #define ID_CONST 0x05
23
+ #define ID_CLASS 0x06
24
+ #define ID_JUNK 0x07
25
+ #define ID_INTERNAL ID_JUNK
26
+
27
+ #ifdef USE_PARSE_H
28
+ #include "parse.h"
29
+ #endif
30
+
31
+ #define symIFUNC ID2SYM(idIFUNC)
32
+ #define symCFUNC ID2SYM(idCFUNC)
33
+
34
+ #if !defined tLAST_TOKEN && defined YYTOKENTYPE
35
+ #define tLAST_TOKEN tLAST_TOKEN
36
+ #endif
37
+
38
+ enum ruby_method_ids {
39
+ #ifndef tLAST_TOKEN
40
+ tUPLUS = 321,
41
+ tUMINUS = 322,
42
+ tPOW = 323,
43
+ tCMP = 324,
44
+ tEQ = 325,
45
+ tEQQ = 326,
46
+ tNEQ = 327,
47
+ tGEQ = 328,
48
+ tLEQ = 329,
49
+ tANDOP = 330,
50
+ tOROP = 331,
51
+ tMATCH = 332,
52
+ tNMATCH = 333,
53
+ tDOT2 = 334,
54
+ tDOT3 = 335,
55
+ tAREF = 336,
56
+ tASET = 337,
57
+ tLSHFT = 338,
58
+ tRSHFT = 339,
59
+ tLAMBDA = 352,
60
+ idNULL = 365,
61
+ idRespond_to = 366,
62
+ idIFUNC = 367,
63
+ idCFUNC = 368,
64
+ id_core_set_method_alias = 369,
65
+ id_core_set_variable_alias = 370,
66
+ id_core_undef_method = 371,
67
+ id_core_define_method = 372,
68
+ id_core_define_singleton_method = 373,
69
+ id_core_set_postexe = 374,
70
+ tLAST_TOKEN = 375,
71
+ #endif
72
+ idDot2 = tDOT2,
73
+ idDot3 = tDOT3,
74
+ idUPlus = tUPLUS,
75
+ idUMinus = tUMINUS,
76
+ idPow = tPOW,
77
+ idCmp = tCMP,
78
+ idPLUS = '+',
79
+ idMINUS = '-',
80
+ idMULT = '*',
81
+ idDIV = '/',
82
+ idMOD = '%',
83
+ idLT = '<',
84
+ idLTLT = tLSHFT,
85
+ idLE = tLEQ,
86
+ idGT = '>',
87
+ idGE = tGEQ,
88
+ idEq = tEQ,
89
+ idEqq = tEQQ,
90
+ idNeq = tNEQ,
91
+ idNot = '!',
92
+ idBackquote = '`',
93
+ idEqTilde = tMATCH,
94
+ idNeqTilde = tNMATCH,
95
+ idAREF = tAREF,
96
+ idASET = tASET,
97
+ idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
98
+ tIntern,
99
+ tMethodMissing,
100
+ tLength,
101
+ tSize,
102
+ tGets,
103
+ tSucc,
104
+ tEach,
105
+ tLambda,
106
+ tSend,
107
+ t__send__,
108
+ tInitialize,
109
+ #if SUPPORT_JOKE
110
+ tBitblt,
111
+ tAnswer,
112
+ #endif
113
+ tLAST_ID,
114
+ #define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
115
+ #if SUPPORT_JOKE
116
+ TOKEN2ID(Bitblt),
117
+ TOKEN2ID(Answer),
118
+ #endif
119
+ TOKEN2ID(Intern),
120
+ TOKEN2ID(MethodMissing),
121
+ TOKEN2ID(Length),
122
+ TOKEN2ID(Size),
123
+ TOKEN2ID(Gets),
124
+ TOKEN2ID(Succ),
125
+ TOKEN2ID(Each),
126
+ TOKEN2ID(Lambda),
127
+ TOKEN2ID(Send),
128
+ TOKEN2ID(__send__),
129
+ TOKEN2ID(Initialize)
130
+ };
131
+
132
+ #ifdef tLAST_TOKEN
133
+ struct ruby_method_ids_check {
134
+ #define ruby_method_id_check_for(name, value) \
135
+ int checking_for_##name[name == value ? 1 : -1]
136
+ ruby_method_id_check_for(tUPLUS, 321);
137
+ ruby_method_id_check_for(tUMINUS, 322);
138
+ ruby_method_id_check_for(tPOW, 323);
139
+ ruby_method_id_check_for(tCMP, 324);
140
+ ruby_method_id_check_for(tEQ, 325);
141
+ ruby_method_id_check_for(tEQQ, 326);
142
+ ruby_method_id_check_for(tNEQ, 327);
143
+ ruby_method_id_check_for(tGEQ, 328);
144
+ ruby_method_id_check_for(tLEQ, 329);
145
+ ruby_method_id_check_for(tANDOP, 330);
146
+ ruby_method_id_check_for(tOROP, 331);
147
+ ruby_method_id_check_for(tMATCH, 332);
148
+ ruby_method_id_check_for(tNMATCH, 333);
149
+ ruby_method_id_check_for(tDOT2, 334);
150
+ ruby_method_id_check_for(tDOT3, 335);
151
+ ruby_method_id_check_for(tAREF, 336);
152
+ ruby_method_id_check_for(tASET, 337);
153
+ ruby_method_id_check_for(tLSHFT, 338);
154
+ ruby_method_id_check_for(tRSHFT, 339);
155
+ ruby_method_id_check_for(tLAMBDA, 352);
156
+ ruby_method_id_check_for(idNULL, 365);
157
+ ruby_method_id_check_for(idRespond_to, 366);
158
+ ruby_method_id_check_for(idIFUNC, 367);
159
+ ruby_method_id_check_for(idCFUNC, 368);
160
+ ruby_method_id_check_for(id_core_set_method_alias, 369);
161
+ ruby_method_id_check_for(id_core_set_variable_alias, 370);
162
+ ruby_method_id_check_for(id_core_undef_method, 371);
163
+ ruby_method_id_check_for(id_core_define_method, 372);
164
+ ruby_method_id_check_for(id_core_define_singleton_method, 373);
165
+ ruby_method_id_check_for(id_core_set_postexe, 374);
166
+ ruby_method_id_check_for(tLAST_TOKEN, 375);
167
+ };
168
+ #endif
169
+
170
+ #endif /* RUBY_ID_H */
@@ -0,0 +1,179 @@
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 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
+
19
+ BIN(getlocal) = 1,
20
+
21
+ BIN(setlocal) = 2,
22
+
23
+ BIN(getspecial) = 3,
24
+
25
+ BIN(setspecial) = 4,
26
+
27
+ BIN(getdynamic) = 5,
28
+
29
+ BIN(setdynamic) = 6,
30
+
31
+ BIN(getinstancevariable) = 7,
32
+
33
+ BIN(setinstancevariable) = 8,
34
+
35
+ BIN(getclassvariable) = 9,
36
+
37
+ BIN(setclassvariable) = 10,
38
+
39
+ BIN(getconstant) = 11,
40
+
41
+ BIN(setconstant) = 12,
42
+
43
+ BIN(getglobal) = 13,
44
+
45
+ BIN(setglobal) = 14,
46
+
47
+ BIN(putnil) = 15,
48
+
49
+ BIN(putself) = 16,
50
+
51
+ BIN(putobject) = 17,
52
+
53
+ BIN(putspecialobject) = 18,
54
+
55
+ BIN(putiseq) = 19,
56
+
57
+ BIN(putstring) = 20,
58
+
59
+ BIN(concatstrings) = 21,
60
+
61
+ BIN(tostring) = 22,
62
+
63
+ BIN(toregexp) = 23,
64
+
65
+ BIN(newarray) = 24,
66
+
67
+ BIN(duparray) = 25,
68
+
69
+ BIN(expandarray) = 26,
70
+
71
+ BIN(concatarray) = 27,
72
+
73
+ BIN(splatarray) = 28,
74
+
75
+ BIN(checkincludearray) = 29,
76
+
77
+ BIN(newhash) = 30,
78
+
79
+ BIN(newrange) = 31,
80
+
81
+ BIN(pop) = 32,
82
+
83
+ BIN(dup) = 33,
84
+
85
+ BIN(dupn) = 34,
86
+
87
+ BIN(swap) = 35,
88
+
89
+ BIN(reput) = 36,
90
+
91
+ BIN(topn) = 37,
92
+
93
+ BIN(setn) = 38,
94
+
95
+ BIN(adjuststack) = 39,
96
+
97
+ BIN(defined) = 40,
98
+
99
+ BIN(trace) = 41,
100
+
101
+ BIN(defineclass) = 42,
102
+
103
+ BIN(send) = 43,
104
+
105
+ BIN(invokesuper) = 44,
106
+
107
+ BIN(invokeblock) = 45,
108
+
109
+ BIN(leave) = 46,
110
+
111
+ BIN(finish) = 47,
112
+
113
+ BIN(throw) = 48,
114
+
115
+ BIN(jump) = 49,
116
+
117
+ BIN(branchif) = 50,
118
+
119
+ BIN(branchunless) = 51,
120
+
121
+ BIN(getinlinecache) = 52,
122
+
123
+ BIN(onceinlinecache) = 53,
124
+
125
+ BIN(setinlinecache) = 54,
126
+
127
+ BIN(opt_case_dispatch) = 55,
128
+
129
+ BIN(opt_checkenv) = 56,
130
+
131
+ BIN(opt_plus) = 57,
132
+
133
+ BIN(opt_minus) = 58,
134
+
135
+ BIN(opt_mult) = 59,
136
+
137
+ BIN(opt_div) = 60,
138
+
139
+ BIN(opt_mod) = 61,
140
+
141
+ BIN(opt_eq) = 62,
142
+
143
+ BIN(opt_neq) = 63,
144
+
145
+ BIN(opt_lt) = 64,
146
+
147
+ BIN(opt_le) = 65,
148
+
149
+ BIN(opt_gt) = 66,
150
+
151
+ BIN(opt_ge) = 67,
152
+
153
+ BIN(opt_ltlt) = 68,
154
+
155
+ BIN(opt_aref) = 69,
156
+
157
+ BIN(opt_aset) = 70,
158
+
159
+ BIN(opt_length) = 71,
160
+
161
+ BIN(opt_size) = 72,
162
+
163
+ BIN(opt_succ) = 73,
164
+
165
+ BIN(opt_not) = 74,
166
+
167
+ BIN(opt_regexpmatch1) = 75,
168
+
169
+ BIN(opt_regexpmatch2) = 76,
170
+
171
+ BIN(opt_call_c_function) = 77,
172
+
173
+ BIN(bitblt) = 78,
174
+
175
+ BIN(answer) = 79,
176
+
177
+ VM_INSTRUCTION_SIZE = 80
178
+ };
179
+
@@ -0,0 +1,695 @@
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 insns2vm.rb
10
+ */
11
+
12
+ #define TS_OFFSET 'O'
13
+ #define TS_NUM 'N'
14
+ #define TS_LINDEX 'L'
15
+ #define TS_DINDEX 'D'
16
+ #define TS_VALUE 'V'
17
+ #define TS_ID 'I'
18
+ #define TS_GENTRY 'G'
19
+ #define TS_IC '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
+ "getdynamic",
32
+ "setdynamic",
33
+ "getinstancevariable",
34
+ "setinstancevariable",
35
+ "getclassvariable",
36
+ "setclassvariable",
37
+ "getconstant",
38
+ "setconstant",
39
+ "getglobal",
40
+ "setglobal",
41
+ "putnil",
42
+ "putself",
43
+ "putobject",
44
+ "putspecialobject",
45
+ "putiseq",
46
+ "putstring",
47
+ "concatstrings",
48
+ "tostring",
49
+ "toregexp",
50
+ "newarray",
51
+ "duparray",
52
+ "expandarray",
53
+ "concatarray",
54
+ "splatarray",
55
+ "checkincludearray",
56
+ "newhash",
57
+ "newrange",
58
+ "pop",
59
+ "dup",
60
+ "dupn",
61
+ "swap",
62
+ "reput",
63
+ "topn",
64
+ "setn",
65
+ "adjuststack",
66
+ "defined",
67
+ "trace",
68
+ "defineclass",
69
+ "send",
70
+ "invokesuper",
71
+ "invokeblock",
72
+ "leave",
73
+ "finish",
74
+ "throw",
75
+ "jump",
76
+ "branchif",
77
+ "branchunless",
78
+ "getinlinecache",
79
+ "onceinlinecache",
80
+ "setinlinecache",
81
+ "opt_case_dispatch",
82
+ "opt_checkenv",
83
+ "opt_plus",
84
+ "opt_minus",
85
+ "opt_mult",
86
+ "opt_div",
87
+ "opt_mod",
88
+ "opt_eq",
89
+ "opt_neq",
90
+ "opt_lt",
91
+ "opt_le",
92
+ "opt_gt",
93
+ "opt_ge",
94
+ "opt_ltlt",
95
+ "opt_aref",
96
+ "opt_aset",
97
+ "opt_length",
98
+ "opt_size",
99
+ "opt_succ",
100
+ "opt_not",
101
+ "opt_regexpmatch1",
102
+ "opt_regexpmatch2",
103
+ "opt_call_c_function",
104
+ "bitblt",
105
+ "answer",
106
+
107
+ };
108
+
109
+ static const char *const insn_operand_info[] = {
110
+ "",
111
+ "L",
112
+ "L",
113
+ "VN",
114
+ "V",
115
+ "DN",
116
+ "DN",
117
+ "IC",
118
+ "IC",
119
+ "I",
120
+ "I",
121
+ "I",
122
+ "I",
123
+ "G",
124
+ "G",
125
+ "",
126
+ "",
127
+ "V",
128
+ "N",
129
+ "S",
130
+ "V",
131
+ "N",
132
+ "",
133
+ "NN",
134
+ "N",
135
+ "V",
136
+ "NN",
137
+ "",
138
+ "V",
139
+ "V",
140
+ "N",
141
+ "N",
142
+ "",
143
+ "",
144
+ "N",
145
+ "",
146
+ "",
147
+ "N",
148
+ "N",
149
+ "N",
150
+ "NVV",
151
+ "N",
152
+ "ISN",
153
+ "INSNC",
154
+ "NSN",
155
+ "NN",
156
+ "",
157
+ "",
158
+ "N",
159
+ "O",
160
+ "O",
161
+ "O",
162
+ "OC",
163
+ "OC",
164
+ "C",
165
+ "HO",
166
+ "",
167
+ "C",
168
+ "C",
169
+ "C",
170
+ "C",
171
+ "C",
172
+ "C",
173
+ "CC",
174
+ "C",
175
+ "C",
176
+ "C",
177
+ "C",
178
+ "C",
179
+ "C",
180
+ "C",
181
+ "C",
182
+ "C",
183
+ "C",
184
+ "C",
185
+ "V",
186
+ "",
187
+ "F",
188
+ "",
189
+ "",
190
+
191
+ };
192
+
193
+ static const int insn_len_info[] = {
194
+ 1,
195
+ 2,
196
+ 2,
197
+ 3,
198
+ 2,
199
+ 3,
200
+ 3,
201
+ 3,
202
+ 3,
203
+ 2,
204
+ 2,
205
+ 2,
206
+ 2,
207
+ 2,
208
+ 2,
209
+ 1,
210
+ 1,
211
+ 2,
212
+ 2,
213
+ 2,
214
+ 2,
215
+ 2,
216
+ 1,
217
+ 3,
218
+ 2,
219
+ 2,
220
+ 3,
221
+ 1,
222
+ 2,
223
+ 2,
224
+ 2,
225
+ 2,
226
+ 1,
227
+ 1,
228
+ 2,
229
+ 1,
230
+ 1,
231
+ 2,
232
+ 2,
233
+ 2,
234
+ 4,
235
+ 2,
236
+ 4,
237
+ 6,
238
+ 4,
239
+ 3,
240
+ 1,
241
+ 1,
242
+ 2,
243
+ 2,
244
+ 2,
245
+ 2,
246
+ 3,
247
+ 3,
248
+ 2,
249
+ 3,
250
+ 1,
251
+ 2,
252
+ 2,
253
+ 2,
254
+ 2,
255
+ 2,
256
+ 2,
257
+ 3,
258
+ 2,
259
+ 2,
260
+ 2,
261
+ 2,
262
+ 2,
263
+ 2,
264
+ 2,
265
+ 2,
266
+ 2,
267
+ 2,
268
+ 2,
269
+ 2,
270
+ 1,
271
+ 2,
272
+ 1,
273
+ 1,
274
+
275
+ };
276
+
277
+ #ifdef USE_INSN_RET_NUM
278
+ static const int insn_stack_push_num_info[] = {
279
+ 0,
280
+ 1,
281
+ 0,
282
+ 1,
283
+ 0,
284
+ 1,
285
+ 0,
286
+ 1,
287
+ 0,
288
+ 1,
289
+ 0,
290
+ 1,
291
+ 0,
292
+ 1,
293
+ 0,
294
+ 1,
295
+ 1,
296
+ 1,
297
+ 1,
298
+ 1,
299
+ 1,
300
+ 1,
301
+ 1,
302
+ 1,
303
+ 1,
304
+ 1,
305
+ 1,
306
+ 1,
307
+ 1,
308
+ 2,
309
+ 1,
310
+ 1,
311
+ 0,
312
+ 2,
313
+ 1,
314
+ 2,
315
+ 1,
316
+ 1,
317
+ 1,
318
+ 1,
319
+ 1,
320
+ 0,
321
+ 1,
322
+ 1,
323
+ 1,
324
+ 1,
325
+ 1,
326
+ 1,
327
+ 1,
328
+ 0,
329
+ 0,
330
+ 0,
331
+ 1,
332
+ 1,
333
+ 1,
334
+ 0,
335
+ 0,
336
+ 1,
337
+ 1,
338
+ 1,
339
+ 1,
340
+ 1,
341
+ 1,
342
+ 1,
343
+ 1,
344
+ 1,
345
+ 1,
346
+ 1,
347
+ 1,
348
+ 1,
349
+ 1,
350
+ 1,
351
+ 1,
352
+ 1,
353
+ 1,
354
+ 1,
355
+ 1,
356
+ 0,
357
+ 1,
358
+ 1,
359
+
360
+ };
361
+ #endif
362
+
363
+ #ifdef USE_INSN_STACK_INCREASE
364
+ static int
365
+ insn_stack_increase(int depth, int insn, VALUE *opes)
366
+ {
367
+ switch(insn){
368
+ case BIN(nop):{
369
+ return depth + 0;
370
+ }
371
+ case BIN(getlocal):{
372
+ return depth + 1;
373
+ }
374
+ case BIN(setlocal):{
375
+ return depth + -1;
376
+ }
377
+ case BIN(getspecial):{
378
+ return depth + 1;
379
+ }
380
+ case BIN(setspecial):{
381
+ return depth + -1;
382
+ }
383
+ case BIN(getdynamic):{
384
+ return depth + 1;
385
+ }
386
+ case BIN(setdynamic):{
387
+ return depth + -1;
388
+ }
389
+ case BIN(getinstancevariable):{
390
+ return depth + 1;
391
+ }
392
+ case BIN(setinstancevariable):{
393
+ return depth + -1;
394
+ }
395
+ case BIN(getclassvariable):{
396
+ return depth + 1;
397
+ }
398
+ case BIN(setclassvariable):{
399
+ return depth + -1;
400
+ }
401
+ case BIN(getconstant):{
402
+ return depth + 0;
403
+ }
404
+ case BIN(setconstant):{
405
+ return depth + -2;
406
+ }
407
+ case BIN(getglobal):{
408
+ return depth + 1;
409
+ }
410
+ case BIN(setglobal):{
411
+ return depth + -1;
412
+ }
413
+ case BIN(putnil):{
414
+ return depth + 1;
415
+ }
416
+ case BIN(putself):{
417
+ return depth + 1;
418
+ }
419
+ case BIN(putobject):{
420
+ return depth + 1;
421
+ }
422
+ case BIN(putspecialobject):{
423
+ return depth + 1;
424
+ }
425
+ case BIN(putiseq):{
426
+ return depth + 1;
427
+ }
428
+ case BIN(putstring):{
429
+ return depth + 1;
430
+ }
431
+ case BIN(concatstrings):{
432
+ int inc = 0;
433
+ int num = FIX2INT(opes[0]);
434
+ inc += 1 - num;;
435
+ return depth + inc;
436
+ }
437
+ case BIN(tostring):{
438
+ return depth + 0;
439
+ }
440
+ case BIN(toregexp):{
441
+ int inc = 0;
442
+ int cnt = FIX2INT(opes[1]);
443
+ inc += 1 - cnt;;
444
+ return depth + inc;
445
+ }
446
+ case BIN(newarray):{
447
+ int inc = 0;
448
+ int num = FIX2INT(opes[0]);
449
+ inc += 1 - num;;
450
+ return depth + inc;
451
+ }
452
+ case BIN(duparray):{
453
+ return depth + 1;
454
+ }
455
+ case BIN(expandarray):{
456
+ int inc = 0;
457
+ int num = FIX2INT(opes[0]);
458
+ int flag = FIX2INT(opes[1]);
459
+ inc += num - 1 + (flag & 1 ? 1 : 0);;
460
+ return depth + inc;
461
+ }
462
+ case BIN(concatarray):{
463
+ return depth + -1;
464
+ }
465
+ case BIN(splatarray):{
466
+ return depth + 0;
467
+ }
468
+ case BIN(checkincludearray):{
469
+ return depth + 0;
470
+ }
471
+ case BIN(newhash):{
472
+ int inc = 0;
473
+ int num = FIX2INT(opes[0]);
474
+ inc += 1 - num;;
475
+ return depth + inc;
476
+ }
477
+ case BIN(newrange):{
478
+ return depth + -1;
479
+ }
480
+ case BIN(pop):{
481
+ return depth + -1;
482
+ }
483
+ case BIN(dup):{
484
+ return depth + 1;
485
+ }
486
+ case BIN(dupn):{
487
+ int inc = 0;
488
+ int n = FIX2INT(opes[0]);
489
+ inc += n;;
490
+ return depth + inc;
491
+ }
492
+ case BIN(swap):{
493
+ return depth + 0;
494
+ }
495
+ case BIN(reput):{
496
+ int inc = 0;
497
+ inc += 0;;
498
+ return depth + inc;
499
+ }
500
+ case BIN(topn):{
501
+ int inc = 0;
502
+ inc += 1;;
503
+ return depth + inc;
504
+ }
505
+ case BIN(setn):{
506
+ int inc = 0;
507
+ inc += 0;
508
+ return depth + inc;
509
+ }
510
+ case BIN(adjuststack):{
511
+ int inc = 0;
512
+ int n = FIX2INT(opes[0]);
513
+ inc -= n;
514
+ return depth + inc;
515
+ }
516
+ case BIN(defined):{
517
+ return depth + 0;
518
+ }
519
+ case BIN(trace):{
520
+ return depth + 0;
521
+ }
522
+ case BIN(defineclass):{
523
+ return depth + -1;
524
+ }
525
+ case BIN(send):{
526
+ int inc = 0;
527
+ int op_argc = FIX2INT(opes[1]);
528
+ int op_flag = FIX2INT(opes[3]);
529
+ inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
530
+ return depth + inc;
531
+ }
532
+ case BIN(invokesuper):{
533
+ int inc = 0;
534
+ int op_argc = FIX2INT(opes[0]);
535
+ int op_flag = FIX2INT(opes[2]);
536
+ inc += - (int)(op_argc + ((op_flag & VM_CALL_ARGS_BLOCKARG_BIT) ? 1 : 0));;
537
+ return depth + inc;
538
+ }
539
+ case BIN(invokeblock):{
540
+ int inc = 0;
541
+ int num = FIX2INT(opes[0]);
542
+ inc += 1 - num;;
543
+ return depth + inc;
544
+ }
545
+ case BIN(leave):{
546
+ return depth + 0;
547
+ }
548
+ case BIN(finish):{
549
+ return depth + 0;
550
+ }
551
+ case BIN(throw):{
552
+ return depth + 0;
553
+ }
554
+ case BIN(jump):{
555
+ return depth + 0;
556
+ }
557
+ case BIN(branchif):{
558
+ return depth + -1;
559
+ }
560
+ case BIN(branchunless):{
561
+ return depth + -1;
562
+ }
563
+ case BIN(getinlinecache):{
564
+ return depth + 1;
565
+ }
566
+ case BIN(onceinlinecache):{
567
+ return depth + 1;
568
+ }
569
+ case BIN(setinlinecache):{
570
+ return depth + 0;
571
+ }
572
+ case BIN(opt_case_dispatch):{
573
+ int inc = 0;
574
+ inc += -1;;
575
+ return depth + inc;
576
+ }
577
+ case BIN(opt_checkenv):{
578
+ return depth + 0;
579
+ }
580
+ case BIN(opt_plus):{
581
+ return depth + -1;
582
+ }
583
+ case BIN(opt_minus):{
584
+ return depth + -1;
585
+ }
586
+ case BIN(opt_mult):{
587
+ return depth + -1;
588
+ }
589
+ case BIN(opt_div):{
590
+ return depth + -1;
591
+ }
592
+ case BIN(opt_mod):{
593
+ return depth + -1;
594
+ }
595
+ case BIN(opt_eq):{
596
+ return depth + -1;
597
+ }
598
+ case BIN(opt_neq):{
599
+ return depth + -1;
600
+ }
601
+ case BIN(opt_lt):{
602
+ return depth + -1;
603
+ }
604
+ case BIN(opt_le):{
605
+ return depth + -1;
606
+ }
607
+ case BIN(opt_gt):{
608
+ return depth + -1;
609
+ }
610
+ case BIN(opt_ge):{
611
+ return depth + -1;
612
+ }
613
+ case BIN(opt_ltlt):{
614
+ return depth + -1;
615
+ }
616
+ case BIN(opt_aref):{
617
+ return depth + -1;
618
+ }
619
+ case BIN(opt_aset):{
620
+ return depth + -2;
621
+ }
622
+ case BIN(opt_length):{
623
+ return depth + 0;
624
+ }
625
+ case BIN(opt_size):{
626
+ return depth + 0;
627
+ }
628
+ case BIN(opt_succ):{
629
+ return depth + 0;
630
+ }
631
+ case BIN(opt_not):{
632
+ return depth + 0;
633
+ }
634
+ case BIN(opt_regexpmatch1):{
635
+ return depth + 0;
636
+ }
637
+ case BIN(opt_regexpmatch2):{
638
+ return depth + -1;
639
+ }
640
+ case BIN(opt_call_c_function):{
641
+ return depth + 0;
642
+ }
643
+ case BIN(bitblt):{
644
+ return depth + 1;
645
+ }
646
+ case BIN(answer):{
647
+ return depth + 1;
648
+ }
649
+
650
+ default:
651
+ rb_bug("insn_sp_increase: unreachable");
652
+ }
653
+ return 0;
654
+ }
655
+ #endif
656
+
657
+ /* some utilities */
658
+
659
+ static int
660
+ insn_len(VALUE insn)
661
+ {
662
+ return insn_len_info[(int)insn];
663
+ }
664
+
665
+ static const char *
666
+ insn_name(VALUE insn)
667
+ {
668
+ return insn_name_info[(int)insn];
669
+ }
670
+
671
+ static const char *
672
+ insn_op_types(VALUE insn)
673
+ {
674
+ return insn_operand_info[(int)insn];
675
+ }
676
+
677
+ static int
678
+ insn_op_type(VALUE insn, long pos)
679
+ {
680
+ int len = insn_len(insn) - 1;
681
+ if(pos < len){
682
+ return insn_operand_info[(int)insn][pos];
683
+ }
684
+ else{
685
+ return 0;
686
+ }
687
+ }
688
+
689
+ #ifdef USE_INSN_RET_NUM
690
+ static int
691
+ insn_ret_num(VALUE insn)
692
+ {
693
+ return insn_stack_push_num_info[(int)insn];
694
+ }
695
+ #endif