llrb 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +21 -0
- data/.gitmodules +4 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +56 -0
- data/README.md +311 -0
- data/Rakefile +30 -0
- data/bin/bm_app_fib +41 -0
- data/bin/bm_empty_method +33 -0
- data/bin/bm_loop_while +27 -0
- data/bin/bm_plus +33 -0
- data/bin/console +14 -0
- data/bin/loop_while.rb +5 -0
- data/bin/setup +8 -0
- data/ext/llrb/cfg.h +124 -0
- data/ext/llrb/compiler.c +987 -0
- data/ext/llrb/compiler/funcs.h +164 -0
- data/ext/llrb/compiler/stack.h +43 -0
- data/ext/llrb/cruby.h +42 -0
- data/ext/llrb/cruby/ccan/build_assert/build_assert.h +40 -0
- data/ext/llrb/cruby/ccan/check_type/check_type.h +63 -0
- data/ext/llrb/cruby/ccan/container_of/container_of.h +142 -0
- data/ext/llrb/cruby/ccan/list/list.h +773 -0
- data/ext/llrb/cruby/ccan/str/str.h +16 -0
- data/ext/llrb/cruby/internal.h +1774 -0
- data/ext/llrb/cruby/iseq.h +252 -0
- data/ext/llrb/cruby/method.h +213 -0
- data/ext/llrb/cruby/node.h +520 -0
- data/ext/llrb/cruby/probes_helper.h +43 -0
- data/ext/llrb/cruby/ruby_assert.h +54 -0
- data/ext/llrb/cruby/ruby_atomic.h +233 -0
- data/ext/llrb/cruby/thread_pthread.h +54 -0
- data/ext/llrb/cruby/vm_core.h +1646 -0
- data/ext/llrb/cruby/vm_debug.h +37 -0
- data/ext/llrb/cruby/vm_exec.h +182 -0
- data/ext/llrb/cruby/vm_opts.h +57 -0
- data/ext/llrb/cruby_extra/id.h +220 -0
- data/ext/llrb/cruby_extra/insns.inc +113 -0
- data/ext/llrb/cruby_extra/insns_info.inc +796 -0
- data/ext/llrb/cruby_extra/probes.h +80 -0
- data/ext/llrb/extconf.rb +102 -0
- data/ext/llrb/llrb.c +148 -0
- data/ext/llrb/optimizer.cc +118 -0
- data/ext/llrb/parser.c +191 -0
- data/ext/llrb/profiler.c +336 -0
- data/ext/llrb_insn_checkkeyword.c +20 -0
- data/ext/llrb_insn_checkmatch.c +28 -0
- data/ext/llrb_insn_concatarray.c +23 -0
- data/ext/llrb_insn_concatstrings.c +21 -0
- data/ext/llrb_insn_defined.c +9 -0
- data/ext/llrb_insn_getclassvariable.c +10 -0
- data/ext/llrb_insn_getinstancevariable.c +44 -0
- data/ext/llrb_insn_getlocal.c +14 -0
- data/ext/llrb_insn_getlocal_level0.c +8 -0
- data/ext/llrb_insn_getlocal_level1.c +8 -0
- data/ext/llrb_insn_getspecial.c +14 -0
- data/ext/llrb_insn_invokeblock.c +39 -0
- data/ext/llrb_insn_invokesuper.c +47 -0
- data/ext/llrb_insn_opt_aref.c +25 -0
- data/ext/llrb_insn_opt_aset.c +28 -0
- data/ext/llrb_insn_opt_div.c +32 -0
- data/ext/llrb_insn_opt_eq.c +57 -0
- data/ext/llrb_insn_opt_ge.c +28 -0
- data/ext/llrb_insn_opt_gt.c +38 -0
- data/ext/llrb_insn_opt_le.c +29 -0
- data/ext/llrb_insn_opt_lt.c +38 -0
- data/ext/llrb_insn_opt_ltlt.c +27 -0
- data/ext/llrb_insn_opt_minus.c +36 -0
- data/ext/llrb_insn_opt_mod.c +32 -0
- data/ext/llrb_insn_opt_mult.c +30 -0
- data/ext/llrb_insn_opt_neq.c +103 -0
- data/ext/llrb_insn_opt_plus.c +48 -0
- data/ext/llrb_insn_opt_send_without_block.c +45 -0
- data/ext/llrb_insn_opt_str_freeze.c +12 -0
- data/ext/llrb_insn_putspecialobject.c +23 -0
- data/ext/llrb_insn_send.c +49 -0
- data/ext/llrb_insn_setclassvariable.c +19 -0
- data/ext/llrb_insn_setconstant.c +23 -0
- data/ext/llrb_insn_setinstancevariable.c +48 -0
- data/ext/llrb_insn_setlocal.c +16 -0
- data/ext/llrb_insn_setlocal_level0.c +9 -0
- data/ext/llrb_insn_setlocal_level1.c +10 -0
- data/ext/llrb_insn_setspecial.c +15 -0
- data/ext/llrb_insn_splatarray.c +13 -0
- data/ext/llrb_insn_throw.c +11 -0
- data/ext/llrb_insn_trace.c +37 -0
- data/ext/llrb_push_result.c +14 -0
- data/ext/llrb_self_from_cfp.c +12 -0
- data/ext/llrb_set_pc.c +8 -0
- data/lib/llrb.rb +2 -0
- data/lib/llrb/jit.rb +76 -0
- data/lib/llrb/start.rb +2 -0
- data/lib/llrb/version.rb +3 -0
- data/llrb.gemspec +48 -0
- data/wercker.yml +31 -0
- metadata +227 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**********************************************************************
|
|
2
|
+
|
|
3
|
+
vm_debug.h - YARV Debug function interface
|
|
4
|
+
|
|
5
|
+
$Author$
|
|
6
|
+
created at: 04/08/25 02:33:49 JST
|
|
7
|
+
|
|
8
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
|
9
|
+
|
|
10
|
+
**********************************************************************/
|
|
11
|
+
|
|
12
|
+
#ifndef RUBY_DEBUG_H
|
|
13
|
+
#define RUBY_DEBUG_H
|
|
14
|
+
|
|
15
|
+
#include "ruby/ruby.h"
|
|
16
|
+
#include "node.h"
|
|
17
|
+
|
|
18
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
19
|
+
|
|
20
|
+
#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v))
|
|
21
|
+
#define dp(v) ruby_debug_print_value(-1, 0, "", (v))
|
|
22
|
+
#define dpi(i) ruby_debug_print_id(-1, 0, "", (i))
|
|
23
|
+
#define dpn(n) ruby_debug_print_node(-1, 0, "", (n))
|
|
24
|
+
|
|
25
|
+
#define bp() ruby_debug_breakpoint()
|
|
26
|
+
|
|
27
|
+
VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v);
|
|
28
|
+
ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id);
|
|
29
|
+
NODE *ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node);
|
|
30
|
+
int ruby_debug_print_indent(int level, int debug_level, int indent_level);
|
|
31
|
+
void ruby_debug_breakpoint(void);
|
|
32
|
+
void ruby_debug_gc_check_func(void);
|
|
33
|
+
void ruby_set_debug_option(const char *str);
|
|
34
|
+
|
|
35
|
+
RUBY_SYMBOL_EXPORT_END
|
|
36
|
+
|
|
37
|
+
#endif /* RUBY_DEBUG_H */
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**********************************************************************
|
|
2
|
+
|
|
3
|
+
vm.h -
|
|
4
|
+
|
|
5
|
+
$Author$
|
|
6
|
+
created at: 04/01/01 16:56:59 JST
|
|
7
|
+
|
|
8
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
|
9
|
+
|
|
10
|
+
**********************************************************************/
|
|
11
|
+
|
|
12
|
+
#ifndef RUBY_VM_EXEC_H
|
|
13
|
+
#define RUBY_VM_EXEC_H
|
|
14
|
+
|
|
15
|
+
typedef long OFFSET;
|
|
16
|
+
typedef unsigned long lindex_t;
|
|
17
|
+
typedef VALUE GENTRY;
|
|
18
|
+
typedef rb_iseq_t *ISEQ;
|
|
19
|
+
|
|
20
|
+
#ifdef __GCC__
|
|
21
|
+
/* TODO: machine dependent prefetch instruction */
|
|
22
|
+
#define PREFETCH(pc)
|
|
23
|
+
#else
|
|
24
|
+
#define PREFETCH(pc)
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#if VMDEBUG > 0
|
|
28
|
+
#define debugs printf
|
|
29
|
+
#define DEBUG_ENTER_INSN(insn) \
|
|
30
|
+
rb_vmdebug_debug_print_pre(th, GET_CFP(),GET_PC());
|
|
31
|
+
|
|
32
|
+
#if OPT_STACK_CACHING
|
|
33
|
+
#define SC_REGS() , reg_a, reg_b
|
|
34
|
+
#else
|
|
35
|
+
#define SC_REGS()
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#define DEBUG_END_INSN() \
|
|
39
|
+
rb_vmdebug_debug_print_post(th, GET_CFP() SC_REGS());
|
|
40
|
+
|
|
41
|
+
#else
|
|
42
|
+
|
|
43
|
+
#define debugs
|
|
44
|
+
#define DEBUG_ENTER_INSN(insn)
|
|
45
|
+
#define DEBUG_END_INSN()
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
#define throwdebug if(0)printf
|
|
49
|
+
/* #define throwdebug printf */
|
|
50
|
+
|
|
51
|
+
/************************************************/
|
|
52
|
+
#if defined(DISPATCH_XXX)
|
|
53
|
+
error !
|
|
54
|
+
/************************************************/
|
|
55
|
+
#elif OPT_CALL_THREADED_CODE
|
|
56
|
+
|
|
57
|
+
#define LABEL(x) insn_func_##x
|
|
58
|
+
#define ELABEL(x)
|
|
59
|
+
#define LABEL_PTR(x) &LABEL(x)
|
|
60
|
+
|
|
61
|
+
#define INSN_ENTRY(insn) \
|
|
62
|
+
static rb_control_frame_t * \
|
|
63
|
+
FUNC_FASTCALL(LABEL(insn))(rb_thread_t *th, rb_control_frame_t *reg_cfp) {
|
|
64
|
+
|
|
65
|
+
#define END_INSN(insn) return reg_cfp;}
|
|
66
|
+
|
|
67
|
+
#define NEXT_INSN() return reg_cfp;
|
|
68
|
+
|
|
69
|
+
/************************************************/
|
|
70
|
+
#elif OPT_TOKEN_THREADED_CODE || OPT_DIRECT_THREADED_CODE
|
|
71
|
+
/* threaded code with gcc */
|
|
72
|
+
|
|
73
|
+
#define LABEL(x) INSN_LABEL_##x
|
|
74
|
+
#define ELABEL(x) INSN_ELABEL_##x
|
|
75
|
+
#define LABEL_PTR(x) &&LABEL(x)
|
|
76
|
+
|
|
77
|
+
#define INSN_ENTRY_SIG(insn)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
#define INSN_DISPATCH_SIG(insn)
|
|
81
|
+
|
|
82
|
+
#define INSN_ENTRY(insn) \
|
|
83
|
+
LABEL(insn): \
|
|
84
|
+
INSN_ENTRY_SIG(insn); \
|
|
85
|
+
|
|
86
|
+
/* dispatcher */
|
|
87
|
+
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) && __GNUC__ == 3
|
|
88
|
+
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
|
89
|
+
__asm__ __volatile__("jmp *%0;\t# -- inserted by vm.h\t[length = 2]" : : "r" (addr))
|
|
90
|
+
|
|
91
|
+
#else
|
|
92
|
+
#define DISPATCH_ARCH_DEPEND_WAY(addr) \
|
|
93
|
+
/* do nothing */
|
|
94
|
+
|
|
95
|
+
#endif
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
/**********************************/
|
|
99
|
+
#if OPT_DIRECT_THREADED_CODE
|
|
100
|
+
|
|
101
|
+
/* for GCC 3.4.x */
|
|
102
|
+
#define TC_DISPATCH(insn) \
|
|
103
|
+
INSN_DISPATCH_SIG(insn); \
|
|
104
|
+
goto *(void const *)GET_CURRENT_INSN(); \
|
|
105
|
+
;
|
|
106
|
+
|
|
107
|
+
#else
|
|
108
|
+
/* token threaded code */
|
|
109
|
+
|
|
110
|
+
#define TC_DISPATCH(insn) \
|
|
111
|
+
DISPATCH_ARCH_DEPEND_WAY(insns_address_table[GET_CURRENT_INSN()]); \
|
|
112
|
+
INSN_DISPATCH_SIG(insn); \
|
|
113
|
+
goto *insns_address_table[GET_CURRENT_INSN()]; \
|
|
114
|
+
rb_bug("tc error");
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
#endif /* DISPATCH_DIRECT_THREADED_CODE */
|
|
118
|
+
|
|
119
|
+
#define END_INSN(insn) \
|
|
120
|
+
DEBUG_END_INSN(); \
|
|
121
|
+
TC_DISPATCH(insn);
|
|
122
|
+
|
|
123
|
+
#define INSN_DISPATCH() \
|
|
124
|
+
TC_DISPATCH(__START__) \
|
|
125
|
+
{
|
|
126
|
+
|
|
127
|
+
#define END_INSNS_DISPATCH() \
|
|
128
|
+
rb_bug("unknown insn: %"PRIdVALUE, GET_CURRENT_INSN()); \
|
|
129
|
+
} /* end of while loop */ \
|
|
130
|
+
|
|
131
|
+
#define NEXT_INSN() TC_DISPATCH(__NEXT_INSN__)
|
|
132
|
+
|
|
133
|
+
/************************************************/
|
|
134
|
+
#else /* no threaded code */
|
|
135
|
+
/* most common method */
|
|
136
|
+
|
|
137
|
+
#define INSN_ENTRY(insn) \
|
|
138
|
+
case BIN(insn):
|
|
139
|
+
|
|
140
|
+
#define END_INSN(insn) \
|
|
141
|
+
DEBUG_END_INSN(); \
|
|
142
|
+
break;
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
#define INSN_DISPATCH() \
|
|
146
|
+
while (1) { \
|
|
147
|
+
switch (GET_CURRENT_INSN()) {
|
|
148
|
+
|
|
149
|
+
#define END_INSNS_DISPATCH() \
|
|
150
|
+
default: \
|
|
151
|
+
SDR(); \
|
|
152
|
+
rb_bug("unknown insn: %ld", GET_CURRENT_INSN()); \
|
|
153
|
+
} /* end of switch */ \
|
|
154
|
+
} /* end of while loop */ \
|
|
155
|
+
|
|
156
|
+
#define NEXT_INSN() goto first
|
|
157
|
+
|
|
158
|
+
#endif
|
|
159
|
+
|
|
160
|
+
#define VM_SP_CNT(th, sp) ((sp) - (th)->stack)
|
|
161
|
+
|
|
162
|
+
#if OPT_CALL_THREADED_CODE
|
|
163
|
+
#define THROW_EXCEPTION(exc) do { \
|
|
164
|
+
th->errinfo = (VALUE)(exc); \
|
|
165
|
+
return 0; \
|
|
166
|
+
} while (0)
|
|
167
|
+
#else
|
|
168
|
+
#define THROW_EXCEPTION(exc) return (VALUE)(exc)
|
|
169
|
+
#endif
|
|
170
|
+
|
|
171
|
+
#define SCREG(r) (reg_##r)
|
|
172
|
+
|
|
173
|
+
#define VM_DEBUG_STACKOVERFLOW 0
|
|
174
|
+
|
|
175
|
+
#if VM_DEBUG_STACKOVERFLOW
|
|
176
|
+
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin) \
|
|
177
|
+
WHEN_VM_STACK_OVERFLOWED(cfp, (cfp)->sp, margin) vm_stack_overflow_for_insn()
|
|
178
|
+
#else
|
|
179
|
+
#define CHECK_VM_STACK_OVERFLOW_FOR_INSN(cfp, margin)
|
|
180
|
+
#endif
|
|
181
|
+
|
|
182
|
+
#endif /* RUBY_VM_EXEC_H */
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*-*-c-*-*/
|
|
2
|
+
/**********************************************************************
|
|
3
|
+
|
|
4
|
+
vm_opts.h - VM optimize option
|
|
5
|
+
|
|
6
|
+
$Author$
|
|
7
|
+
|
|
8
|
+
Copyright (C) 2004-2007 Koichi Sasada
|
|
9
|
+
|
|
10
|
+
**********************************************************************/
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
#ifndef RUBY_VM_OPTS_H
|
|
14
|
+
#define RUBY_VM_OPTS_H
|
|
15
|
+
|
|
16
|
+
/* Compile options.
|
|
17
|
+
* You can change these options at runtime by VM::CompileOption.
|
|
18
|
+
* Following definitions are default values.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#define OPT_TRACE_INSTRUCTION 1
|
|
22
|
+
#define OPT_TAILCALL_OPTIMIZATION 0
|
|
23
|
+
#define OPT_PEEPHOLE_OPTIMIZATION 1
|
|
24
|
+
#define OPT_SPECIALISED_INSTRUCTION 1
|
|
25
|
+
#define OPT_INLINE_CONST_CACHE 1
|
|
26
|
+
#define OPT_FROZEN_STRING_LITERAL 0
|
|
27
|
+
#define OPT_DEBUG_FROZEN_STRING_LITERAL 0
|
|
28
|
+
|
|
29
|
+
/* Build Options.
|
|
30
|
+
* You can't change these options at runtime.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/* C compiler dependent */
|
|
34
|
+
#define OPT_DIRECT_THREADED_CODE 1
|
|
35
|
+
#define OPT_TOKEN_THREADED_CODE 0
|
|
36
|
+
#define OPT_CALL_THREADED_CODE 0
|
|
37
|
+
|
|
38
|
+
/* VM running option */
|
|
39
|
+
#define OPT_CHECKED_RUN 1
|
|
40
|
+
#define OPT_INLINE_METHOD_CACHE 1
|
|
41
|
+
#define OPT_GLOBAL_METHOD_CACHE 1
|
|
42
|
+
#define OPT_BLOCKINLINING 0
|
|
43
|
+
|
|
44
|
+
/* architecture independent, affects generated code */
|
|
45
|
+
#define OPT_OPERANDS_UNIFICATION 1
|
|
46
|
+
#define OPT_INSTRUCTIONS_UNIFICATION 0
|
|
47
|
+
#define OPT_UNIFY_ALL_COMBINATION 0
|
|
48
|
+
#define OPT_STACK_CACHING 0
|
|
49
|
+
|
|
50
|
+
/* misc */
|
|
51
|
+
#define SUPPORT_JOKE 0
|
|
52
|
+
|
|
53
|
+
#ifndef VM_COLLECT_USAGE_DETAILS
|
|
54
|
+
#define VM_COLLECT_USAGE_DETAILS 0
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
#endif /* RUBY_VM_OPTS_H */
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/* DO NOT EDIT THIS FILE DIRECTLY */
|
|
2
|
+
/**********************************************************************
|
|
3
|
+
|
|
4
|
+
id.h -
|
|
5
|
+
|
|
6
|
+
$Author$
|
|
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_info,
|
|
120
|
+
tPRESERVED_ID_END,
|
|
121
|
+
tMax,
|
|
122
|
+
tMin,
|
|
123
|
+
tFreeze,
|
|
124
|
+
tInspect,
|
|
125
|
+
tIntern,
|
|
126
|
+
tObject_id,
|
|
127
|
+
tConst_missing,
|
|
128
|
+
tMethodMissing,
|
|
129
|
+
tMethod_added,
|
|
130
|
+
tSingleton_method_added,
|
|
131
|
+
tMethod_removed,
|
|
132
|
+
tSingleton_method_removed,
|
|
133
|
+
tMethod_undefined,
|
|
134
|
+
tSingleton_method_undefined,
|
|
135
|
+
tLength,
|
|
136
|
+
tSize,
|
|
137
|
+
tGets,
|
|
138
|
+
tSucc,
|
|
139
|
+
tEach,
|
|
140
|
+
tProc,
|
|
141
|
+
tLambda,
|
|
142
|
+
tSend,
|
|
143
|
+
t__send__,
|
|
144
|
+
t__attached__,
|
|
145
|
+
tInitialize,
|
|
146
|
+
tInitialize_copy,
|
|
147
|
+
tInitialize_clone,
|
|
148
|
+
tInitialize_dup,
|
|
149
|
+
tTo_int,
|
|
150
|
+
tTo_ary,
|
|
151
|
+
tTo_str,
|
|
152
|
+
tTo_sym,
|
|
153
|
+
tTo_hash,
|
|
154
|
+
tTo_proc,
|
|
155
|
+
tTo_io,
|
|
156
|
+
tTo_a,
|
|
157
|
+
tTo_s,
|
|
158
|
+
tTo_i,
|
|
159
|
+
tBt,
|
|
160
|
+
tBt_locations,
|
|
161
|
+
tCall,
|
|
162
|
+
tMesg,
|
|
163
|
+
tException,
|
|
164
|
+
tUScore,
|
|
165
|
+
tLASTLINE,
|
|
166
|
+
tBACKREF,
|
|
167
|
+
tNEXT_ID,
|
|
168
|
+
#define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL|ID_STATIC_SYM)
|
|
169
|
+
TOKEN2LOCALID(Max),
|
|
170
|
+
TOKEN2LOCALID(Min),
|
|
171
|
+
TOKEN2LOCALID(Freeze),
|
|
172
|
+
TOKEN2LOCALID(Inspect),
|
|
173
|
+
TOKEN2LOCALID(Intern),
|
|
174
|
+
TOKEN2LOCALID(Object_id),
|
|
175
|
+
TOKEN2LOCALID(Const_missing),
|
|
176
|
+
TOKEN2LOCALID(MethodMissing),
|
|
177
|
+
TOKEN2LOCALID(Method_added),
|
|
178
|
+
TOKEN2LOCALID(Singleton_method_added),
|
|
179
|
+
TOKEN2LOCALID(Method_removed),
|
|
180
|
+
TOKEN2LOCALID(Singleton_method_removed),
|
|
181
|
+
TOKEN2LOCALID(Method_undefined),
|
|
182
|
+
TOKEN2LOCALID(Singleton_method_undefined),
|
|
183
|
+
TOKEN2LOCALID(Length),
|
|
184
|
+
TOKEN2LOCALID(Size),
|
|
185
|
+
TOKEN2LOCALID(Gets),
|
|
186
|
+
TOKEN2LOCALID(Succ),
|
|
187
|
+
TOKEN2LOCALID(Each),
|
|
188
|
+
TOKEN2LOCALID(Proc),
|
|
189
|
+
TOKEN2LOCALID(Lambda),
|
|
190
|
+
TOKEN2LOCALID(Send),
|
|
191
|
+
TOKEN2LOCALID(__send__),
|
|
192
|
+
TOKEN2LOCALID(__attached__),
|
|
193
|
+
TOKEN2LOCALID(Initialize),
|
|
194
|
+
TOKEN2LOCALID(Initialize_copy),
|
|
195
|
+
TOKEN2LOCALID(Initialize_clone),
|
|
196
|
+
TOKEN2LOCALID(Initialize_dup),
|
|
197
|
+
TOKEN2LOCALID(To_int),
|
|
198
|
+
TOKEN2LOCALID(To_ary),
|
|
199
|
+
TOKEN2LOCALID(To_str),
|
|
200
|
+
TOKEN2LOCALID(To_sym),
|
|
201
|
+
TOKEN2LOCALID(To_hash),
|
|
202
|
+
TOKEN2LOCALID(To_proc),
|
|
203
|
+
TOKEN2LOCALID(To_io),
|
|
204
|
+
TOKEN2LOCALID(To_a),
|
|
205
|
+
TOKEN2LOCALID(To_s),
|
|
206
|
+
TOKEN2LOCALID(To_i),
|
|
207
|
+
TOKEN2LOCALID(Bt),
|
|
208
|
+
TOKEN2LOCALID(Bt_locations),
|
|
209
|
+
TOKEN2LOCALID(Call),
|
|
210
|
+
TOKEN2LOCALID(Mesg),
|
|
211
|
+
TOKEN2LOCALID(Exception),
|
|
212
|
+
TOKEN2LOCALID(UScore),
|
|
213
|
+
#define TOKEN2GLOBALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_GLOBAL|ID_STATIC_SYM)
|
|
214
|
+
TOKEN2GLOBALID(LASTLINE),
|
|
215
|
+
TOKEN2GLOBALID(BACKREF),
|
|
216
|
+
tLAST_OP_ID = tPRESERVED_ID_END-1,
|
|
217
|
+
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
#endif /* RUBY_ID_H */
|