debase-ruby_core_source 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/addr2line.h +21 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/list/list.h +773 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ccan/str/str.h +16 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/constant.h +50 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/dln.h +51 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/encindex.h +67 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/eval_intern.h +304 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/gc.h +114 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/id.h +211 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/id_table.h +30 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/insns.inc +110 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/insns_info.inc +776 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/internal.h +1407 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/iseq.h +249 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/known_errors.inc +746 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/method.h +213 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/node.h +520 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/node_name.inc +208 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/opt_sc.inc +758 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/optinsn.inc +83 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/optunifs.inc +127 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/parse.h +185 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/probes_helper.h +43 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regenc.h +237 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regint.h +987 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/regparse.h +367 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/revision.h +1 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/ruby_atomic.h +233 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/symbol.h +108 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/thread_pthread.h +54 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/thread_win32.h +36 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/timev.h +42 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/transcode_data.h +139 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/version.h +55 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm.inc +3414 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_call_iseq_optimized.inc +212 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_core.h +1240 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_debug.h +37 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_exec.h +182 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_insnhelper.h +227 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vm_opts.h +57 -0
- data/lib/debase/ruby_core_source/ruby-2.3.4-p301/vmtc.inc +108 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +48 -2
@@ -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
|
+
const VALUE value; /* should be mark */
|
35
|
+
const 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(st_table *tbl);
|
42
|
+
VALUE rb_public_const_get(VALUE klass, ID id);
|
43
|
+
VALUE rb_public_const_get_at(VALUE klass, ID id);
|
44
|
+
VALUE rb_public_const_get_from(VALUE klass, ID id);
|
45
|
+
int rb_public_const_defined(VALUE klass, ID id);
|
46
|
+
int rb_public_const_defined_at(VALUE klass, ID id);
|
47
|
+
int rb_public_const_defined_from(VALUE klass, ID id);
|
48
|
+
rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
|
49
|
+
|
50
|
+
#endif /* CONSTANT_H */
|
@@ -0,0 +1,51 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
dln.h -
|
4
|
+
|
5
|
+
$Author: nobu $
|
6
|
+
created at: Wed Jan 19 16:53:09 JST 1994
|
7
|
+
|
8
|
+
Copyright (C) 1993-2007 Yukihiro Matsumoto
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#ifndef DLN_H
|
13
|
+
#define DLN_H
|
14
|
+
|
15
|
+
#ifdef __cplusplus
|
16
|
+
# ifndef HAVE_PROTOTYPES
|
17
|
+
# define HAVE_PROTOTYPES 1
|
18
|
+
# endif
|
19
|
+
# ifndef HAVE_STDARG_PROTOTYPES
|
20
|
+
# define HAVE_STDARG_PROTOTYPES 1
|
21
|
+
# endif
|
22
|
+
#endif
|
23
|
+
|
24
|
+
#undef _
|
25
|
+
#ifdef HAVE_PROTOTYPES
|
26
|
+
# define _(args) args
|
27
|
+
#else
|
28
|
+
# define _(args) ()
|
29
|
+
#endif
|
30
|
+
|
31
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
32
|
+
|
33
|
+
#ifndef DLN_FIND_EXTRA_ARG
|
34
|
+
#define DLN_FIND_EXTRA_ARG
|
35
|
+
#endif
|
36
|
+
#ifndef DLN_FIND_EXTRA_ARG_DECL
|
37
|
+
#define DLN_FIND_EXTRA_ARG_DECL
|
38
|
+
#endif
|
39
|
+
|
40
|
+
char *dln_find_exe_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL);
|
41
|
+
char *dln_find_file_r(const char*,const char*,char*,size_t DLN_FIND_EXTRA_ARG_DECL);
|
42
|
+
|
43
|
+
#ifdef USE_DLN_A_OUT
|
44
|
+
extern char *dln_argv0;
|
45
|
+
#endif
|
46
|
+
|
47
|
+
void *dln_load(const char*);
|
48
|
+
|
49
|
+
RUBY_SYMBOL_EXPORT_END
|
50
|
+
|
51
|
+
#endif
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/**********************************************************************
|
2
|
+
|
3
|
+
encindex.h -
|
4
|
+
|
5
|
+
$Author$
|
6
|
+
created at: Tue Sep 15 13:21:14 JST 2015
|
7
|
+
|
8
|
+
Copyright (C) 2015 Yukihiro Matsumoto
|
9
|
+
|
10
|
+
**********************************************************************/
|
11
|
+
|
12
|
+
#ifndef RUBY_ENCINDEX_H
|
13
|
+
#define RUBY_ENCINDEX_H 1
|
14
|
+
#if defined(__cplusplus)
|
15
|
+
extern "C" {
|
16
|
+
#if 0
|
17
|
+
} /* satisfy cc-mode */
|
18
|
+
#endif
|
19
|
+
#endif
|
20
|
+
|
21
|
+
enum ruby_preserved_encindex {
|
22
|
+
RUBY_ENCINDEX_ASCII,
|
23
|
+
RUBY_ENCINDEX_UTF_8,
|
24
|
+
RUBY_ENCINDEX_US_ASCII,
|
25
|
+
|
26
|
+
/* preserved indexes */
|
27
|
+
RUBY_ENCINDEX_UTF_16BE,
|
28
|
+
RUBY_ENCINDEX_UTF_16LE,
|
29
|
+
RUBY_ENCINDEX_UTF_32BE,
|
30
|
+
RUBY_ENCINDEX_UTF_32LE,
|
31
|
+
RUBY_ENCINDEX_UTF_16,
|
32
|
+
RUBY_ENCINDEX_UTF_32,
|
33
|
+
RUBY_ENCINDEX_UTF8_MAC,
|
34
|
+
|
35
|
+
/* for old options of regexp */
|
36
|
+
RUBY_ENCINDEX_EUC_JP,
|
37
|
+
RUBY_ENCINDEX_Windows_31J,
|
38
|
+
|
39
|
+
RUBY_ENCINDEX_BUILTIN_MAX
|
40
|
+
};
|
41
|
+
|
42
|
+
#define ENCINDEX_ASCII RUBY_ENCINDEX_ASCII
|
43
|
+
#define ENCINDEX_UTF_8 RUBY_ENCINDEX_UTF_8
|
44
|
+
#define ENCINDEX_US_ASCII RUBY_ENCINDEX_US_ASCII
|
45
|
+
#define ENCINDEX_UTF_16BE RUBY_ENCINDEX_UTF_16BE
|
46
|
+
#define ENCINDEX_UTF_16LE RUBY_ENCINDEX_UTF_16LE
|
47
|
+
#define ENCINDEX_UTF_32BE RUBY_ENCINDEX_UTF_32BE
|
48
|
+
#define ENCINDEX_UTF_32LE RUBY_ENCINDEX_UTF_32LE
|
49
|
+
#define ENCINDEX_UTF_16 RUBY_ENCINDEX_UTF_16
|
50
|
+
#define ENCINDEX_UTF_32 RUBY_ENCINDEX_UTF_32
|
51
|
+
#define ENCINDEX_UTF8_MAC RUBY_ENCINDEX_UTF8_MAC
|
52
|
+
#define ENCINDEX_EUC_JP RUBY_ENCINDEX_EUC_JP
|
53
|
+
#define ENCINDEX_Windows_31J RUBY_ENCINDEX_Windows_31J
|
54
|
+
#define ENCINDEX_BUILTIN_MAX RUBY_ENCINDEX_BUILTIN_MAX
|
55
|
+
|
56
|
+
#define rb_ascii8bit_encindex() RUBY_ENCINDEX_ASCII
|
57
|
+
#define rb_utf8_encindex() RUBY_ENCINDEX_UTF_8
|
58
|
+
#define rb_usascii_encindex() RUBY_ENCINDEX_US_ASCII
|
59
|
+
|
60
|
+
#if defined(__cplusplus)
|
61
|
+
#if 0
|
62
|
+
{ /* satisfy cc-mode */
|
63
|
+
#endif
|
64
|
+
} /* extern "C" { */
|
65
|
+
#endif
|
66
|
+
|
67
|
+
#endif /* RUBY_ENCINDEX_H */
|
@@ -0,0 +1,304 @@
|
|
1
|
+
#ifndef RUBY_EVAL_INTERN_H
|
2
|
+
#define RUBY_EVAL_INTERN_H
|
3
|
+
|
4
|
+
#include "ruby/ruby.h"
|
5
|
+
#include "vm_core.h"
|
6
|
+
|
7
|
+
static inline void
|
8
|
+
pass_passed_block(rb_thread_t *th)
|
9
|
+
{
|
10
|
+
th->passed_block = rb_vm_control_frame_block_ptr(th->cfp);
|
11
|
+
th->cfp->flag |= VM_FRAME_FLAG_PASSED;
|
12
|
+
}
|
13
|
+
#define PASS_PASSED_BLOCK_TH(th) pass_passed_block(th)
|
14
|
+
#define PASS_PASSED_BLOCK() pass_passed_block(GET_THREAD())
|
15
|
+
|
16
|
+
#ifdef HAVE_STDLIB_H
|
17
|
+
#include <stdlib.h>
|
18
|
+
#endif
|
19
|
+
#ifndef EXIT_SUCCESS
|
20
|
+
#define EXIT_SUCCESS 0
|
21
|
+
#endif
|
22
|
+
#ifndef EXIT_FAILURE
|
23
|
+
#define EXIT_FAILURE 1
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#include <stdio.h>
|
27
|
+
#include <setjmp.h>
|
28
|
+
|
29
|
+
#ifdef __APPLE__
|
30
|
+
# ifdef HAVE_CRT_EXTERNS_H
|
31
|
+
# include <crt_externs.h>
|
32
|
+
# else
|
33
|
+
# include "missing/crt_externs.h"
|
34
|
+
# endif
|
35
|
+
#endif
|
36
|
+
|
37
|
+
#ifndef HAVE_STRING_H
|
38
|
+
char *strrchr(const char *, const char);
|
39
|
+
#endif
|
40
|
+
|
41
|
+
#ifdef HAVE_UNISTD_H
|
42
|
+
#include <unistd.h>
|
43
|
+
#endif
|
44
|
+
|
45
|
+
#ifdef HAVE_NET_SOCKET_H
|
46
|
+
#include <net/socket.h>
|
47
|
+
#endif
|
48
|
+
|
49
|
+
#define ruby_setjmp(env) RUBY_SETJMP(env)
|
50
|
+
#define ruby_longjmp(env,val) RUBY_LONGJMP((env),(val))
|
51
|
+
#ifdef __CYGWIN__
|
52
|
+
# ifndef _setjmp
|
53
|
+
int _setjmp(jmp_buf);
|
54
|
+
# endif
|
55
|
+
# ifndef _longjmp
|
56
|
+
NORETURN(void _longjmp(jmp_buf, int));
|
57
|
+
# endif
|
58
|
+
#endif
|
59
|
+
|
60
|
+
#include <sys/types.h>
|
61
|
+
#include <signal.h>
|
62
|
+
#include <errno.h>
|
63
|
+
|
64
|
+
#ifdef HAVE_SYS_SELECT_H
|
65
|
+
#include <sys/select.h>
|
66
|
+
#endif
|
67
|
+
|
68
|
+
/*
|
69
|
+
Solaris sys/select.h switches select to select_large_fdset to support larger
|
70
|
+
file descriptors if FD_SETSIZE is larger than 1024 on 32bit environment.
|
71
|
+
But Ruby doesn't change FD_SETSIZE because fd_set is allocated dynamically.
|
72
|
+
So following definition is required to use select_large_fdset.
|
73
|
+
*/
|
74
|
+
#ifdef HAVE_SELECT_LARGE_FDSET
|
75
|
+
#define select(n, r, w, e, t) select_large_fdset((n), (r), (w), (e), (t))
|
76
|
+
extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
77
|
+
#endif
|
78
|
+
|
79
|
+
#ifdef HAVE_SYS_PARAM_H
|
80
|
+
#include <sys/param.h>
|
81
|
+
#endif
|
82
|
+
|
83
|
+
#include <sys/stat.h>
|
84
|
+
|
85
|
+
#ifdef _MSC_VER
|
86
|
+
#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
87
|
+
__try {
|
88
|
+
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
|
89
|
+
} \
|
90
|
+
__except (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW ? \
|
91
|
+
(rb_thread_raised_set(GET_THREAD(), RAISED_STACKOVERFLOW), \
|
92
|
+
raise(SIGSEGV), \
|
93
|
+
EXCEPTION_EXECUTE_HANDLER) : \
|
94
|
+
EXCEPTION_CONTINUE_SEARCH) { \
|
95
|
+
/* never reaches here */ \
|
96
|
+
}
|
97
|
+
#elif defined(__MINGW32__)
|
98
|
+
LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
|
99
|
+
#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
100
|
+
do { \
|
101
|
+
PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler);
|
102
|
+
|
103
|
+
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
|
104
|
+
RemoveVectoredExceptionHandler(_handler); \
|
105
|
+
} while (0);
|
106
|
+
#else
|
107
|
+
#define SAVE_ROOT_JMPBUF_BEFORE_STMT
|
108
|
+
#define SAVE_ROOT_JMPBUF_AFTER_STMT
|
109
|
+
#endif
|
110
|
+
|
111
|
+
#define SAVE_ROOT_JMPBUF(th, stmt) do \
|
112
|
+
if (ruby_setjmp((th)->root_jmpbuf) == 0) { \
|
113
|
+
SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
114
|
+
stmt; \
|
115
|
+
SAVE_ROOT_JMPBUF_AFTER_STMT \
|
116
|
+
} \
|
117
|
+
else { \
|
118
|
+
rb_fiber_start(); \
|
119
|
+
} while (0)
|
120
|
+
|
121
|
+
#define TH_PUSH_TAG(th) do { \
|
122
|
+
rb_thread_t * const _th = (th); \
|
123
|
+
struct rb_vm_tag _tag; \
|
124
|
+
_tag.tag = Qundef; \
|
125
|
+
_tag.prev = _th->tag;
|
126
|
+
|
127
|
+
#define TH_POP_TAG() \
|
128
|
+
_th->tag = _tag.prev; \
|
129
|
+
} while (0)
|
130
|
+
|
131
|
+
#define TH_TMPPOP_TAG() \
|
132
|
+
_th->tag = _tag.prev
|
133
|
+
|
134
|
+
#define TH_REPUSH_TAG() (void)(_th->tag = &_tag)
|
135
|
+
|
136
|
+
#define PUSH_TAG() TH_PUSH_TAG(GET_THREAD())
|
137
|
+
#define POP_TAG() TH_POP_TAG()
|
138
|
+
|
139
|
+
#if defined __GNUC__ && __GNUC__ == 4 && (__GNUC_MINOR__ >= 6 && __GNUC_MINOR__ <= 8)
|
140
|
+
# define VAR_FROM_MEMORY(var) __extension__(*(__typeof__(var) volatile *)&(var))
|
141
|
+
# define VAR_INITIALIZED(var) ((var) = VAR_FROM_MEMORY(var))
|
142
|
+
#else
|
143
|
+
# define VAR_FROM_MEMORY(var) (var)
|
144
|
+
# define VAR_INITIALIZED(var) ((void)&(var))
|
145
|
+
#endif
|
146
|
+
|
147
|
+
/* clear th->state, and return the value */
|
148
|
+
static inline int
|
149
|
+
rb_threadptr_tag_state(rb_thread_t *th)
|
150
|
+
{
|
151
|
+
int state = th->state;
|
152
|
+
th->state = 0;
|
153
|
+
return state;
|
154
|
+
}
|
155
|
+
|
156
|
+
NORETURN(static inline void rb_threadptr_tag_jump(rb_thread_t *, int));
|
157
|
+
static inline void
|
158
|
+
rb_threadptr_tag_jump(rb_thread_t *th, int st)
|
159
|
+
{
|
160
|
+
th->state = st;
|
161
|
+
ruby_longjmp(th->tag->buf, 1);
|
162
|
+
}
|
163
|
+
|
164
|
+
/*
|
165
|
+
setjmp() in assignment expression rhs is undefined behavior
|
166
|
+
[ISO/IEC 9899:1999] 7.13.1.1
|
167
|
+
*/
|
168
|
+
#define TH_EXEC_TAG() \
|
169
|
+
(ruby_setjmp(_tag.buf) ? rb_threadptr_tag_state(VAR_FROM_MEMORY(_th)) : (TH_REPUSH_TAG(), 0))
|
170
|
+
|
171
|
+
#define EXEC_TAG() \
|
172
|
+
TH_EXEC_TAG()
|
173
|
+
|
174
|
+
#define TH_JUMP_TAG(th, st) rb_threadptr_tag_jump(th, st)
|
175
|
+
|
176
|
+
#define JUMP_TAG(st) TH_JUMP_TAG(GET_THREAD(), (st))
|
177
|
+
|
178
|
+
#define INTERNAL_EXCEPTION_P(exc) FIXNUM_P(exc)
|
179
|
+
|
180
|
+
/* CREF operators */
|
181
|
+
|
182
|
+
#define CREF_FL_PUSHED_BY_EVAL IMEMO_FL_USER1
|
183
|
+
#define CREF_FL_OMOD_SHARED IMEMO_FL_USER2
|
184
|
+
|
185
|
+
static inline VALUE
|
186
|
+
CREF_CLASS(const rb_cref_t *cref)
|
187
|
+
{
|
188
|
+
return cref->klass;
|
189
|
+
}
|
190
|
+
|
191
|
+
static inline rb_cref_t *
|
192
|
+
CREF_NEXT(const rb_cref_t *cref)
|
193
|
+
{
|
194
|
+
return cref->next;
|
195
|
+
}
|
196
|
+
|
197
|
+
static inline const rb_scope_visibility_t *
|
198
|
+
CREF_SCOPE_VISI(const rb_cref_t *cref)
|
199
|
+
{
|
200
|
+
return &cref->scope_visi;
|
201
|
+
}
|
202
|
+
|
203
|
+
static inline VALUE
|
204
|
+
CREF_REFINEMENTS(const rb_cref_t *cref)
|
205
|
+
{
|
206
|
+
return cref->refinements;
|
207
|
+
}
|
208
|
+
|
209
|
+
static inline void
|
210
|
+
CREF_REFINEMENTS_SET(rb_cref_t *cref, VALUE refs)
|
211
|
+
{
|
212
|
+
RB_OBJ_WRITE(cref, &cref->refinements, refs);
|
213
|
+
}
|
214
|
+
|
215
|
+
static inline int
|
216
|
+
CREF_PUSHED_BY_EVAL(const rb_cref_t *cref)
|
217
|
+
{
|
218
|
+
return cref->flags & CREF_FL_PUSHED_BY_EVAL;
|
219
|
+
}
|
220
|
+
|
221
|
+
static inline void
|
222
|
+
CREF_PUSHED_BY_EVAL_SET(rb_cref_t *cref)
|
223
|
+
{
|
224
|
+
cref->flags |= CREF_FL_PUSHED_BY_EVAL;
|
225
|
+
}
|
226
|
+
|
227
|
+
static inline int
|
228
|
+
CREF_OMOD_SHARED(const rb_cref_t *cref)
|
229
|
+
{
|
230
|
+
return cref->flags & CREF_FL_OMOD_SHARED;
|
231
|
+
}
|
232
|
+
|
233
|
+
static inline void
|
234
|
+
CREF_OMOD_SHARED_SET(rb_cref_t *cref)
|
235
|
+
{
|
236
|
+
cref->flags |= CREF_FL_OMOD_SHARED;
|
237
|
+
}
|
238
|
+
|
239
|
+
static inline void
|
240
|
+
CREF_OMOD_SHARED_UNSET(rb_cref_t *cref)
|
241
|
+
{
|
242
|
+
cref->flags &= ~CREF_FL_OMOD_SHARED;
|
243
|
+
}
|
244
|
+
|
245
|
+
void rb_thread_cleanup(void);
|
246
|
+
void rb_thread_wait_other_threads(void);
|
247
|
+
|
248
|
+
enum {
|
249
|
+
RAISED_EXCEPTION = 1,
|
250
|
+
RAISED_STACKOVERFLOW = 2,
|
251
|
+
RAISED_NOMEMORY = 4
|
252
|
+
};
|
253
|
+
int rb_threadptr_set_raised(rb_thread_t *th);
|
254
|
+
int rb_threadptr_reset_raised(rb_thread_t *th);
|
255
|
+
#define rb_thread_raised_set(th, f) ((th)->raised_flag |= (f))
|
256
|
+
#define rb_thread_raised_reset(th, f) ((th)->raised_flag &= ~(f))
|
257
|
+
#define rb_thread_raised_p(th, f) (((th)->raised_flag & (f)) != 0)
|
258
|
+
#define rb_thread_raised_clear(th) ((th)->raised_flag = 0)
|
259
|
+
|
260
|
+
VALUE rb_f_eval(int argc, const VALUE *argv, VALUE self);
|
261
|
+
VALUE rb_make_exception(int argc, const VALUE *argv);
|
262
|
+
|
263
|
+
NORETURN(void rb_method_name_error(VALUE, VALUE));
|
264
|
+
|
265
|
+
NORETURN(void rb_fiber_start(void));
|
266
|
+
|
267
|
+
NORETURN(void rb_print_undef(VALUE, ID, int));
|
268
|
+
NORETURN(void rb_print_undef_str(VALUE, VALUE));
|
269
|
+
NORETURN(void rb_print_inaccessible(VALUE, ID, rb_method_visibility_t));
|
270
|
+
NORETURN(void rb_vm_localjump_error(const char *,VALUE, int));
|
271
|
+
NORETURN(void rb_vm_jump_tag_but_local_jump(int));
|
272
|
+
NORETURN(void rb_raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv,
|
273
|
+
VALUE obj, int call_status));
|
274
|
+
|
275
|
+
VALUE rb_vm_make_jump_tag_but_local_jump(int state, VALUE val);
|
276
|
+
rb_cref_t *rb_vm_cref(void);
|
277
|
+
rb_cref_t *rb_vm_cref_replace_with_duplicated_cref(void);
|
278
|
+
VALUE rb_vm_call_cfunc(VALUE recv, VALUE (*func)(VALUE), VALUE arg, const rb_block_t *blockptr, VALUE filename);
|
279
|
+
void rb_vm_set_progname(VALUE filename);
|
280
|
+
void rb_thread_terminate_all(void);
|
281
|
+
VALUE rb_vm_top_self();
|
282
|
+
VALUE rb_vm_cbase(void);
|
283
|
+
|
284
|
+
#ifndef CharNext /* defined as CharNext[AW] on Windows. */
|
285
|
+
# ifdef HAVE_MBLEN
|
286
|
+
# define CharNext(p) ((p) + mblen((p), RUBY_MBCHAR_MAXSIZE))
|
287
|
+
# else
|
288
|
+
# define CharNext(p) ((p) + 1)
|
289
|
+
# endif
|
290
|
+
#endif
|
291
|
+
|
292
|
+
#if defined DOSISH || defined __CYGWIN__
|
293
|
+
static inline void
|
294
|
+
translit_char(char *p, int from, int to)
|
295
|
+
{
|
296
|
+
while (*p) {
|
297
|
+
if ((unsigned char)*p == from)
|
298
|
+
*p = to;
|
299
|
+
p = CharNext(p);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
#endif
|
303
|
+
|
304
|
+
#endif /* RUBY_EVAL_INTERN_H */
|