debase-ruby_core_source 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/CHANGELOG.md +4 -0
- data/lib/debase/ruby_core_source.rb +1 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ccan/list/list.h +773 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/constant.h +50 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/dln.h +51 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/encindex.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/eval_intern.h +325 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/gc.h +114 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/id.h +212 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/id_table.h +30 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/insns.inc +109 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/insns_info.inc +769 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/internal.h +1373 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/iseq.h +181 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/known_errors.inc +746 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/method.h +210 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/node.h +521 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/opt_sc.inc +750 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/optunifs.inc +126 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/parse.h +204 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/probes_helper.h +43 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/regenc.h +234 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/regint.h +972 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/regparse.h +363 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/ruby_atomic.h +233 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/symbol.h +108 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/thread_pthread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/thread_win32.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/timev.h +42 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/transcode_data.h +139 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/version.h +55 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm.inc +3374 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_call_iseq_optimized.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_core.h +1216 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_debug.h +37 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_exec.h +182 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_insnhelper.h +246 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vm_opts.h +57 -0
- data/lib/debase/ruby_core_source/ruby-2.3.0-preview1/vmtc.inc +107 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +49 -3
@@ -0,0 +1,114 @@
|
|
1
|
+
|
2
|
+
#ifndef RUBY_GC_H
|
3
|
+
#define RUBY_GC_H 1
|
4
|
+
|
5
|
+
#if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__) && !defined(__native_client__)
|
6
|
+
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
|
7
|
+
#elif defined(__i386) && defined(__GNUC__) && !defined(__native_client__)
|
8
|
+
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("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 inline void
|
25
|
+
rb_gc_debug_indent(void)
|
26
|
+
{
|
27
|
+
printf("%*s", ruby_gc_debug_indent, "");
|
28
|
+
}
|
29
|
+
|
30
|
+
static inline 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) do { \
|
61
|
+
VALUE markobj = (ptr); \
|
62
|
+
if (RTEST(markobj)) {rb_gc_mark(markobj);} \
|
63
|
+
} while (0)
|
64
|
+
#define RUBY_FREE_UNLESS_NULL(ptr) if(ptr){ruby_xfree(ptr);(ptr)=NULL;}
|
65
|
+
|
66
|
+
#if STACK_GROW_DIRECTION > 0
|
67
|
+
# define STACK_UPPER(x, a, b) (a)
|
68
|
+
#elif STACK_GROW_DIRECTION < 0
|
69
|
+
# define STACK_UPPER(x, a, b) (b)
|
70
|
+
#else
|
71
|
+
RUBY_EXTERN int ruby_stack_grow_direction;
|
72
|
+
int ruby_get_stack_grow_direction(volatile VALUE *addr);
|
73
|
+
# define stack_growup_p(x) ( \
|
74
|
+
(ruby_stack_grow_direction ? \
|
75
|
+
ruby_stack_grow_direction : \
|
76
|
+
ruby_get_stack_grow_direction(x)) > 0)
|
77
|
+
# define STACK_UPPER(x, a, b) (stack_growup_p(x) ? (a) : (b))
|
78
|
+
#endif
|
79
|
+
|
80
|
+
#if STACK_GROW_DIRECTION
|
81
|
+
#define STACK_GROW_DIR_DETECTION
|
82
|
+
#define STACK_DIR_UPPER(a,b) STACK_UPPER(0, (a), (b))
|
83
|
+
#else
|
84
|
+
#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
|
85
|
+
#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
|
86
|
+
#endif
|
87
|
+
#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
|
88
|
+
|
89
|
+
const char *rb_obj_info(VALUE obj);
|
90
|
+
const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
|
91
|
+
void rb_obj_info_dump(VALUE obj);
|
92
|
+
|
93
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
94
|
+
|
95
|
+
/* exports for objspace module */
|
96
|
+
size_t rb_objspace_data_type_memsize(VALUE obj);
|
97
|
+
void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
|
98
|
+
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
|
99
|
+
int rb_objspace_markable_object_p(VALUE obj);
|
100
|
+
int rb_objspace_internal_object_p(VALUE obj);
|
101
|
+
int rb_objspace_marked_object_p(VALUE obj);
|
102
|
+
int rb_objspace_garbage_object_p(VALUE obj);
|
103
|
+
|
104
|
+
void rb_objspace_each_objects(
|
105
|
+
int (*callback)(void *start, void *end, size_t stride, void *data),
|
106
|
+
void *data);
|
107
|
+
|
108
|
+
void rb_objspace_each_objects_without_setup(
|
109
|
+
int (*callback)(void *, void *, size_t, void *),
|
110
|
+
void *data);
|
111
|
+
|
112
|
+
RUBY_SYMBOL_EXPORT_END
|
113
|
+
|
114
|
+
#endif /* RUBY_GC_H */
|
@@ -0,0 +1,212 @@
|
|
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 symIFUNC ID2SYM(idIFUNC)
|
43
|
+
#define symCFUNC ID2SYM(idCFUNC)
|
44
|
+
|
45
|
+
#define RUBY_TOKEN_DOT2 128
|
46
|
+
#define RUBY_TOKEN_DOT3 129
|
47
|
+
#define RUBY_TOKEN_UPLUS 130
|
48
|
+
#define RUBY_TOKEN_UMINUS 131
|
49
|
+
#define RUBY_TOKEN_POW 132
|
50
|
+
#define RUBY_TOKEN_DSTAR 133
|
51
|
+
#define RUBY_TOKEN_CMP 134
|
52
|
+
#define RUBY_TOKEN_LSHFT 135
|
53
|
+
#define RUBY_TOKEN_RSHFT 136
|
54
|
+
#define RUBY_TOKEN_LEQ 137
|
55
|
+
#define RUBY_TOKEN_GEQ 138
|
56
|
+
#define RUBY_TOKEN_EQ 139
|
57
|
+
#define RUBY_TOKEN_EQQ 140
|
58
|
+
#define RUBY_TOKEN_NEQ 141
|
59
|
+
#define RUBY_TOKEN_MATCH 142
|
60
|
+
#define RUBY_TOKEN_NMATCH 143
|
61
|
+
#define RUBY_TOKEN_AREF 144
|
62
|
+
#define RUBY_TOKEN_ASET 145
|
63
|
+
#define RUBY_TOKEN_COLON2 146
|
64
|
+
#define RUBY_TOKEN_COLON3 147
|
65
|
+
#define RUBY_TOKEN_ANDOP 148
|
66
|
+
#define RUBY_TOKEN_OROP 149
|
67
|
+
#define RUBY_TOKEN_ANDDOT 150
|
68
|
+
#define RUBY_TOKEN(t) RUBY_TOKEN_##t
|
69
|
+
|
70
|
+
enum ruby_method_ids {
|
71
|
+
idDot2 = RUBY_TOKEN(DOT2),
|
72
|
+
idDot3 = RUBY_TOKEN(DOT3),
|
73
|
+
idUPlus = RUBY_TOKEN(UPLUS),
|
74
|
+
idUMinus = RUBY_TOKEN(UMINUS),
|
75
|
+
idPow = RUBY_TOKEN(POW),
|
76
|
+
idCmp = RUBY_TOKEN(CMP),
|
77
|
+
idPLUS = '+',
|
78
|
+
idMINUS = '-',
|
79
|
+
idMULT = '*',
|
80
|
+
idDIV = '/',
|
81
|
+
idMOD = '%',
|
82
|
+
idLTLT = RUBY_TOKEN(LSHFT),
|
83
|
+
idGTGT = RUBY_TOKEN(RSHFT),
|
84
|
+
idLT = '<',
|
85
|
+
idLE = RUBY_TOKEN(LEQ),
|
86
|
+
idGT = '>',
|
87
|
+
idGE = RUBY_TOKEN(GEQ),
|
88
|
+
idEq = RUBY_TOKEN(EQ),
|
89
|
+
idEqq = RUBY_TOKEN(EQQ),
|
90
|
+
idNeq = RUBY_TOKEN(NEQ),
|
91
|
+
idNot = '!',
|
92
|
+
idBackquote = '`',
|
93
|
+
idEqTilde = RUBY_TOKEN(MATCH),
|
94
|
+
idNeqTilde = RUBY_TOKEN(NMATCH),
|
95
|
+
idAREF = RUBY_TOKEN(AREF),
|
96
|
+
idASET = RUBY_TOKEN(ASET),
|
97
|
+
idCOLON2 = RUBY_TOKEN(COLON2),
|
98
|
+
idANDOP = RUBY_TOKEN(ANDOP),
|
99
|
+
idOROP = RUBY_TOKEN(OROP),
|
100
|
+
idANDDOT = RUBY_TOKEN(ANDDOT),
|
101
|
+
tPRESERVED_ID_BEGIN = 150,
|
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
|
+
id_debug_created_path,
|
120
|
+
id_debug_created_line,
|
121
|
+
tPRESERVED_ID_END,
|
122
|
+
tFreeze,
|
123
|
+
tInspect,
|
124
|
+
tIntern,
|
125
|
+
tObject_id,
|
126
|
+
tConst_missing,
|
127
|
+
tMethodMissing,
|
128
|
+
tMethod_added,
|
129
|
+
tSingleton_method_added,
|
130
|
+
tMethod_removed,
|
131
|
+
tSingleton_method_removed,
|
132
|
+
tMethod_undefined,
|
133
|
+
tSingleton_method_undefined,
|
134
|
+
tLength,
|
135
|
+
tSize,
|
136
|
+
tGets,
|
137
|
+
tSucc,
|
138
|
+
tEach,
|
139
|
+
tProc,
|
140
|
+
tLambda,
|
141
|
+
tSend,
|
142
|
+
t__send__,
|
143
|
+
t__attached__,
|
144
|
+
tInitialize,
|
145
|
+
tInitialize_copy,
|
146
|
+
tInitialize_clone,
|
147
|
+
tInitialize_dup,
|
148
|
+
tTo_int,
|
149
|
+
tTo_ary,
|
150
|
+
tTo_str,
|
151
|
+
tTo_sym,
|
152
|
+
tTo_hash,
|
153
|
+
tTo_proc,
|
154
|
+
tTo_io,
|
155
|
+
tTo_a,
|
156
|
+
tTo_s,
|
157
|
+
tTo_i,
|
158
|
+
tBt,
|
159
|
+
tBt_locations,
|
160
|
+
tCall,
|
161
|
+
tMesg,
|
162
|
+
tException,
|
163
|
+
tUScore,
|
164
|
+
tNEXT_ID,
|
165
|
+
#define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL|ID_STATIC_SYM)
|
166
|
+
TOKEN2LOCALID(Freeze),
|
167
|
+
TOKEN2LOCALID(Inspect),
|
168
|
+
TOKEN2LOCALID(Intern),
|
169
|
+
TOKEN2LOCALID(Object_id),
|
170
|
+
TOKEN2LOCALID(Const_missing),
|
171
|
+
TOKEN2LOCALID(MethodMissing),
|
172
|
+
TOKEN2LOCALID(Method_added),
|
173
|
+
TOKEN2LOCALID(Singleton_method_added),
|
174
|
+
TOKEN2LOCALID(Method_removed),
|
175
|
+
TOKEN2LOCALID(Singleton_method_removed),
|
176
|
+
TOKEN2LOCALID(Method_undefined),
|
177
|
+
TOKEN2LOCALID(Singleton_method_undefined),
|
178
|
+
TOKEN2LOCALID(Length),
|
179
|
+
TOKEN2LOCALID(Size),
|
180
|
+
TOKEN2LOCALID(Gets),
|
181
|
+
TOKEN2LOCALID(Succ),
|
182
|
+
TOKEN2LOCALID(Each),
|
183
|
+
TOKEN2LOCALID(Proc),
|
184
|
+
TOKEN2LOCALID(Lambda),
|
185
|
+
TOKEN2LOCALID(Send),
|
186
|
+
TOKEN2LOCALID(__send__),
|
187
|
+
TOKEN2LOCALID(__attached__),
|
188
|
+
TOKEN2LOCALID(Initialize),
|
189
|
+
TOKEN2LOCALID(Initialize_copy),
|
190
|
+
TOKEN2LOCALID(Initialize_clone),
|
191
|
+
TOKEN2LOCALID(Initialize_dup),
|
192
|
+
TOKEN2LOCALID(To_int),
|
193
|
+
TOKEN2LOCALID(To_ary),
|
194
|
+
TOKEN2LOCALID(To_str),
|
195
|
+
TOKEN2LOCALID(To_sym),
|
196
|
+
TOKEN2LOCALID(To_hash),
|
197
|
+
TOKEN2LOCALID(To_proc),
|
198
|
+
TOKEN2LOCALID(To_io),
|
199
|
+
TOKEN2LOCALID(To_a),
|
200
|
+
TOKEN2LOCALID(To_s),
|
201
|
+
TOKEN2LOCALID(To_i),
|
202
|
+
TOKEN2LOCALID(Bt),
|
203
|
+
TOKEN2LOCALID(Bt_locations),
|
204
|
+
TOKEN2LOCALID(Call),
|
205
|
+
TOKEN2LOCALID(Mesg),
|
206
|
+
TOKEN2LOCALID(Exception),
|
207
|
+
TOKEN2LOCALID(UScore),
|
208
|
+
tLAST_OP_ID = tPRESERVED_ID_END-1,
|
209
|
+
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
|
210
|
+
};
|
211
|
+
|
212
|
+
#endif /* RUBY_ID_H */
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#ifndef RUBY_ID_TABLE_H
|
2
|
+
#define RUBY_ID_TABLE_H 1
|
3
|
+
#include "ruby/ruby.h"
|
4
|
+
|
5
|
+
struct rb_id_table;
|
6
|
+
|
7
|
+
/* compatible with ST_* */
|
8
|
+
enum rb_id_table_iterator_result {
|
9
|
+
ID_TABLE_CONTINUE = ST_CONTINUE,
|
10
|
+
ID_TABLE_STOP = ST_STOP,
|
11
|
+
ID_TABLE_DELETE = ST_DELETE,
|
12
|
+
};
|
13
|
+
|
14
|
+
struct rb_id_table *rb_id_table_create(size_t size);
|
15
|
+
void rb_id_table_free(struct rb_id_table *tbl);
|
16
|
+
void rb_id_table_clear(struct rb_id_table *tbl);
|
17
|
+
|
18
|
+
size_t rb_id_table_size(const struct rb_id_table *tbl);
|
19
|
+
size_t rb_id_table_memsize(const struct rb_id_table *tbl);
|
20
|
+
|
21
|
+
int rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val);
|
22
|
+
int rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp);
|
23
|
+
int rb_id_table_delete(struct rb_id_table *tbl, ID id);
|
24
|
+
|
25
|
+
typedef enum rb_id_table_iterator_result rb_id_table_foreach_func_t(ID id, VALUE val, void *data);
|
26
|
+
typedef enum rb_id_table_iterator_result rb_id_table_foreach_values_func_t(VALUE val, void *data);
|
27
|
+
void rb_id_table_foreach(struct rb_id_table *tbl, rb_id_table_foreach_func_t *func, void *data);
|
28
|
+
void rb_id_table_foreach_values(struct rb_id_table *tbl, rb_id_table_foreach_values_func_t *func, void *data);
|
29
|
+
|
30
|
+
#endif /* RUBY_ID_TABLE_H */
|
@@ -0,0 +1,109 @@
|
|
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(reverse) = 33,
|
51
|
+
BIN(reput) = 34,
|
52
|
+
BIN(topn) = 35,
|
53
|
+
BIN(setn) = 36,
|
54
|
+
BIN(adjuststack) = 37,
|
55
|
+
BIN(defined) = 38,
|
56
|
+
BIN(checkmatch) = 39,
|
57
|
+
BIN(checkkeyword) = 40,
|
58
|
+
BIN(trace) = 41,
|
59
|
+
BIN(defineclass) = 42,
|
60
|
+
BIN(send) = 43,
|
61
|
+
BIN(opt_str_freeze) = 44,
|
62
|
+
BIN(opt_send_without_block) = 45,
|
63
|
+
BIN(invokesuper) = 46,
|
64
|
+
BIN(invokeblock) = 47,
|
65
|
+
BIN(leave) = 48,
|
66
|
+
BIN(throw) = 49,
|
67
|
+
BIN(jump) = 50,
|
68
|
+
BIN(branchif) = 51,
|
69
|
+
BIN(branchunless) = 52,
|
70
|
+
BIN(branchnil) = 53,
|
71
|
+
BIN(getinlinecache) = 54,
|
72
|
+
BIN(setinlinecache) = 55,
|
73
|
+
BIN(once) = 56,
|
74
|
+
BIN(opt_case_dispatch) = 57,
|
75
|
+
BIN(opt_plus) = 58,
|
76
|
+
BIN(opt_minus) = 59,
|
77
|
+
BIN(opt_mult) = 60,
|
78
|
+
BIN(opt_div) = 61,
|
79
|
+
BIN(opt_mod) = 62,
|
80
|
+
BIN(opt_eq) = 63,
|
81
|
+
BIN(opt_neq) = 64,
|
82
|
+
BIN(opt_lt) = 65,
|
83
|
+
BIN(opt_le) = 66,
|
84
|
+
BIN(opt_gt) = 67,
|
85
|
+
BIN(opt_ge) = 68,
|
86
|
+
BIN(opt_ltlt) = 69,
|
87
|
+
BIN(opt_aref) = 70,
|
88
|
+
BIN(opt_aset) = 71,
|
89
|
+
BIN(opt_aset_with) = 72,
|
90
|
+
BIN(opt_aref_with) = 73,
|
91
|
+
BIN(opt_length) = 74,
|
92
|
+
BIN(opt_size) = 75,
|
93
|
+
BIN(opt_empty_p) = 76,
|
94
|
+
BIN(opt_succ) = 77,
|
95
|
+
BIN(opt_not) = 78,
|
96
|
+
BIN(opt_regexpmatch1) = 79,
|
97
|
+
BIN(opt_regexpmatch2) = 80,
|
98
|
+
BIN(opt_call_c_function) = 81,
|
99
|
+
BIN(bitblt) = 82,
|
100
|
+
BIN(answer) = 83,
|
101
|
+
BIN(getlocal_OP__WC__0) = 84,
|
102
|
+
BIN(getlocal_OP__WC__1) = 85,
|
103
|
+
BIN(setlocal_OP__WC__0) = 86,
|
104
|
+
BIN(setlocal_OP__WC__1) = 87,
|
105
|
+
BIN(putobject_OP_INT2FIX_O_0_C_) = 88,
|
106
|
+
BIN(putobject_OP_INT2FIX_O_1_C_) = 89,
|
107
|
+
VM_INSTRUCTION_SIZE = 90
|
108
|
+
};
|
109
|
+
|