debase-ruby_core_source 3.4.1 → 4.0.0.preview2
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/addr2line.h +22 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/builtin.h +125 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +40 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +63 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +142 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +791 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +17 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/constant.h +53 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/darray.h +278 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/debug_counter.h +425 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/dln.h +33 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/encindex.h +70 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/eval_intern.h +331 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/hrtime.h +237 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/id.h +354 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/id_table.h +54 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/insns.inc +302 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/insns_info.inc +11241 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +154 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/basic_operators.h +65 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/bignum.h +245 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/bits.h +650 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +81 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +805 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +64 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +29 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +34 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +107 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +29 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +21 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/cont.h +35 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +16 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +19 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +39 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +18 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +21 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +251 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/eval.h +41 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +38 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +185 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/gc.h +358 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +194 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +322 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +51 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +163 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +20 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +16 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +23 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +19 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/numeric.h +275 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +63 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +131 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +30 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +124 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +10 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +17 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +40 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +71 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +33 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +102 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +346 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +23 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +70 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +25 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +11 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +16 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +203 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +160 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +46 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/thread.h +112 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/time.h +37 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +23 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +27 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +74 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/vm.h +136 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +16 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/internal.h +105 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/iseq.h +357 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/known_errors.inc +1419 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/method.h +271 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/node.h +122 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/node_name.inc +224 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/optinsn.inc +128 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/optunifs.inc +41 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parse.h +244 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_bits.h +564 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_node.h +32 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +162 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +106 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/ast.h +8233 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +260 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +458 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +283 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +19 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +129 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/options.h +485 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +163 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +936 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +34 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/prism.h +408 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +43 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +121 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +236 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +204 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +218 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +130 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +103 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +29 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +113 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +200 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +32 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +46 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +29 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +106 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/probes_helper.h +42 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +306 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regenc.h +259 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regint.h +1005 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/regparse.h +371 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/revision.h +5 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +14 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +66 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/rubyparser.h +1394 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/shape.h +444 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/siphash.h +48 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/symbol.h +116 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +21 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_pthread.h +175 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/thread_win32.h +58 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/timev.h +58 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/transcode_data.h +138 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/variable.h +27 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/version.h +69 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm.inc +6183 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_call_iseq_optimized.inc +244 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_callinfo.h +640 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_core.h +2350 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_debug.h +124 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_exec.h +210 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_insnhelper.h +277 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +67 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vm_sync.h +156 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/vmtc.inc +289 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/yjit.h +81 -0
- data/lib/debase/ruby_core_source/ruby-4.0.0-preview2/zjit.h +47 -0
- data/lib/debase/ruby_core_source/version.rb +1 -1
- metadata +148 -3
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#ifndef INTERNAL_CMDLINEOPT_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_CMDLINEOPT_H
|
|
3
|
+
|
|
4
|
+
#include "yjit.h"
|
|
5
|
+
|
|
6
|
+
typedef struct {
|
|
7
|
+
unsigned int mask;
|
|
8
|
+
unsigned int set;
|
|
9
|
+
} ruby_features_t;
|
|
10
|
+
|
|
11
|
+
typedef struct ruby_cmdline_options {
|
|
12
|
+
const char *script;
|
|
13
|
+
VALUE script_name;
|
|
14
|
+
VALUE e_script;
|
|
15
|
+
struct {
|
|
16
|
+
struct {
|
|
17
|
+
VALUE name;
|
|
18
|
+
int index;
|
|
19
|
+
} enc;
|
|
20
|
+
} src, ext, intern;
|
|
21
|
+
VALUE req_list;
|
|
22
|
+
ruby_features_t features;
|
|
23
|
+
ruby_features_t warn;
|
|
24
|
+
unsigned int dump;
|
|
25
|
+
long backtrace_length_limit;
|
|
26
|
+
|
|
27
|
+
const char *crash_report;
|
|
28
|
+
|
|
29
|
+
signed int sflag: 2;
|
|
30
|
+
unsigned int xflag: 1;
|
|
31
|
+
unsigned int warning: 1;
|
|
32
|
+
unsigned int verbose: 1;
|
|
33
|
+
unsigned int do_loop: 1;
|
|
34
|
+
unsigned int do_print: 1;
|
|
35
|
+
unsigned int do_line: 1;
|
|
36
|
+
unsigned int do_split: 1;
|
|
37
|
+
unsigned int do_search: 1;
|
|
38
|
+
unsigned int setids: 2;
|
|
39
|
+
#if USE_YJIT
|
|
40
|
+
unsigned int yjit: 1;
|
|
41
|
+
#endif
|
|
42
|
+
#if USE_ZJIT
|
|
43
|
+
unsigned int zjit: 1;
|
|
44
|
+
#endif
|
|
45
|
+
} ruby_cmdline_options_t;
|
|
46
|
+
|
|
47
|
+
struct ruby_opt_message {
|
|
48
|
+
const char *str;
|
|
49
|
+
unsigned short namelen, secondlen;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
#define RUBY_OPT_MESSAGE(shortopt, longopt, desc) { \
|
|
53
|
+
shortopt " " longopt " " desc, \
|
|
54
|
+
(unsigned short)sizeof(shortopt), \
|
|
55
|
+
(unsigned short)sizeof(longopt), \
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#define opt_match(s, l, name) \
|
|
59
|
+
((((l) > rb_strlen_lit(name)) ? (s)[rb_strlen_lit(name)] == '=' : \
|
|
60
|
+
(l) == rb_strlen_lit(name)) && \
|
|
61
|
+
memcmp((s), name, rb_strlen_lit(name)) == 0 && \
|
|
62
|
+
(((s) += rb_strlen_lit(name)), 1))
|
|
63
|
+
|
|
64
|
+
#endif
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#ifndef INTERNAL_COMPAR_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_COMPAR_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Comparable.
|
|
10
|
+
*/
|
|
11
|
+
#include "internal/basic_operators.h"
|
|
12
|
+
|
|
13
|
+
#define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
|
|
14
|
+
|
|
15
|
+
#define CMP_OPTIMIZABLE(type) BASIC_OP_UNREDEFINED_P(BOP_CMP, type##_REDEFINED_OP_FLAG)
|
|
16
|
+
|
|
17
|
+
#define OPTIMIZED_CMP(a, b) \
|
|
18
|
+
((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(INTEGER)) ? \
|
|
19
|
+
(((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
|
|
20
|
+
(STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(STRING)) ? \
|
|
21
|
+
rb_str_cmp(a, b) : \
|
|
22
|
+
(RB_FLOAT_TYPE_P(a) && RB_FLOAT_TYPE_P(b) && CMP_OPTIMIZABLE(FLOAT)) ? \
|
|
23
|
+
rb_float_cmp(a, b) : \
|
|
24
|
+
rb_cmpint(rb_funcallv(a, id_cmp, 1, &b), a, b))
|
|
25
|
+
|
|
26
|
+
/* compar.c */
|
|
27
|
+
VALUE rb_invcmp(VALUE, VALUE);
|
|
28
|
+
|
|
29
|
+
#endif /* INTERNAL_COMPAR_H */
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef INTERNAL_COMPILE_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_COMPILE_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for the compiler.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/config.h"
|
|
12
|
+
#include <stddef.h> /* for size_t */
|
|
13
|
+
#include "ruby/ruby.h" /* for rb_event_flag_t */
|
|
14
|
+
|
|
15
|
+
struct rb_iseq_struct; /* in vm_core.h */
|
|
16
|
+
|
|
17
|
+
/* compile.c */
|
|
18
|
+
int rb_dvar_defined(ID, const struct rb_iseq_struct *);
|
|
19
|
+
int rb_local_defined(ID, const struct rb_iseq_struct *);
|
|
20
|
+
int rb_insn_len(VALUE insn);
|
|
21
|
+
const char *rb_insns_name(int i);
|
|
22
|
+
VALUE rb_insns_name_array(void);
|
|
23
|
+
int rb_iseq_cdhash_cmp(VALUE val, VALUE lit);
|
|
24
|
+
st_index_t rb_iseq_cdhash_hash(VALUE a);
|
|
25
|
+
|
|
26
|
+
/* iseq.c */
|
|
27
|
+
int rb_vm_insn_addr2insn(const void *);
|
|
28
|
+
int rb_vm_insn_decode(const VALUE encoded);
|
|
29
|
+
extern bool ruby_vm_keep_script_lines;
|
|
30
|
+
|
|
31
|
+
/* iseq.c (export) */
|
|
32
|
+
rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos);
|
|
33
|
+
|
|
34
|
+
#endif /* INTERNAL_COMPILE_H */
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#ifndef INTERNAL_COMPILERS_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_COMPILERS_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header absorbing C compiler differences.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/compiler_since.h"
|
|
12
|
+
#include "ruby/internal/has/attribute.h"
|
|
13
|
+
#include "ruby/internal/has/builtin.h"
|
|
14
|
+
#include "ruby/internal/has/c_attribute.h"
|
|
15
|
+
#include "ruby/internal/has/declspec_attribute.h"
|
|
16
|
+
#include "ruby/internal/has/extension.h"
|
|
17
|
+
#include "ruby/internal/has/feature.h"
|
|
18
|
+
#include "ruby/internal/has/warning.h"
|
|
19
|
+
#include "ruby/backward/2/gcc_version_since.h"
|
|
20
|
+
|
|
21
|
+
#define MSC_VERSION_SINCE(_) RBIMPL_COMPILER_SINCE(MSVC, (_) / 100, (_) % 100, 0)
|
|
22
|
+
#define MSC_VERSION_BEFORE(_) RBIMPL_COMPILER_BEFORE(MSVC, (_) / 100, (_) % 100, 0)
|
|
23
|
+
|
|
24
|
+
#ifndef __has_attribute
|
|
25
|
+
# define __has_attribute(...) RBIMPL_HAS_ATTRIBUTE(__VA_ARGS__)
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifndef __has_c_attribute
|
|
29
|
+
# /* As of writing everything that lacks __has_c_attribute also completely
|
|
30
|
+
# * lacks C2x attributes as well. Might change in future? */
|
|
31
|
+
# define __has_c_attribute(...) 0
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#ifndef __has_declspec_attribute
|
|
35
|
+
# define __has_declspec_attribute(...) RBIMPL_HAS_DECLSPEC_ATTRIBUTE(__VA_ARGS__)
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#ifndef __has_builtin
|
|
39
|
+
# define __has_builtin(...) RBIMPL_HAS_BUILTIN(__VA_ARGS__)
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#ifndef __has_feature
|
|
43
|
+
# define __has_feature(...) RBIMPL_HAS_FEATURE(__VA_ARGS__)
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
#ifndef __has_extension
|
|
47
|
+
# define __has_extension(...) RBIMPL_HAS_EXTENSION(__VA_ARGS__)
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
#ifndef __has_warning
|
|
51
|
+
# define __has_warning(...) RBIMPL_HAS_WARNING(__VA_ARGS__)
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
#ifndef __GNUC__
|
|
55
|
+
# define __extension__ /* void */
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
#ifndef MAYBE_UNUSED
|
|
59
|
+
# define MAYBE_UNUSED(x) x
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
#ifndef WARN_UNUSED_RESULT
|
|
63
|
+
# define WARN_UNUSED_RESULT(x) x
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
#define RB_OBJ_BUILTIN_TYPE(obj) rb_obj_builtin_type(obj)
|
|
67
|
+
#define OBJ_BUILTIN_TYPE(obj) RB_OBJ_BUILTIN_TYPE(obj)
|
|
68
|
+
#ifdef __GNUC__
|
|
69
|
+
#define rb_obj_builtin_type(obj) \
|
|
70
|
+
__extension__({ \
|
|
71
|
+
VALUE arg_obj = (obj); \
|
|
72
|
+
RB_SPECIAL_CONST_P(arg_obj) ? -1 : \
|
|
73
|
+
(int)RB_BUILTIN_TYPE(arg_obj); \
|
|
74
|
+
})
|
|
75
|
+
#else
|
|
76
|
+
# include "ruby/ruby.h"
|
|
77
|
+
static inline int
|
|
78
|
+
rb_obj_builtin_type(VALUE obj)
|
|
79
|
+
{
|
|
80
|
+
return RB_SPECIAL_CONST_P(obj) ? -1 :
|
|
81
|
+
(int)RB_BUILTIN_TYPE(obj);
|
|
82
|
+
}
|
|
83
|
+
#endif
|
|
84
|
+
|
|
85
|
+
/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
|
|
86
|
+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
87
|
+
# define FLEX_ARY_LEN /* VALUE ary[]; */
|
|
88
|
+
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
|
89
|
+
# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
|
|
90
|
+
#else
|
|
91
|
+
# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
|
|
92
|
+
#endif
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* For declaring bitfields out of non-unsigned int types:
|
|
96
|
+
* struct date {
|
|
97
|
+
* BITFIELD(enum months, month, 4);
|
|
98
|
+
* ...
|
|
99
|
+
* };
|
|
100
|
+
*/
|
|
101
|
+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
|
102
|
+
# define BITFIELD(type, name, size) type name : size
|
|
103
|
+
#else
|
|
104
|
+
# define BITFIELD(type, name, size) unsigned int name : size
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
#endif /* INTERNAL_COMPILERS_H */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#ifndef INTERNAL_COMPLEX_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_COMPLEX_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Complex.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/internal/value.h" /* for struct RBasic */
|
|
12
|
+
|
|
13
|
+
struct RComplex {
|
|
14
|
+
struct RBasic basic;
|
|
15
|
+
VALUE real;
|
|
16
|
+
VALUE imag;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
#define RCOMPLEX(obj) ((struct RComplex *)(obj))
|
|
20
|
+
|
|
21
|
+
/* shortcut macro for internal only */
|
|
22
|
+
#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
|
|
23
|
+
#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
|
|
24
|
+
|
|
25
|
+
/* complex.c */
|
|
26
|
+
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);
|
|
27
|
+
st_index_t rb_complex_hash(VALUE comp);
|
|
28
|
+
|
|
29
|
+
#endif /* INTERNAL_COMPLEX_H */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef RUBY_RACTOR_SAFE_TABLE_H
|
|
2
|
+
#define RUBY_RACTOR_SAFE_TABLE_H
|
|
3
|
+
|
|
4
|
+
#include "ruby/atomic.h"
|
|
5
|
+
#include "ruby/ruby.h"
|
|
6
|
+
|
|
7
|
+
struct rb_concurrent_set_funcs {
|
|
8
|
+
VALUE (*hash)(VALUE key);
|
|
9
|
+
bool (*cmp)(VALUE a, VALUE b);
|
|
10
|
+
VALUE (*create)(VALUE key, void *data);
|
|
11
|
+
void (*free)(VALUE key);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
VALUE rb_concurrent_set_new(const struct rb_concurrent_set_funcs *funcs, int capacity);
|
|
15
|
+
rb_atomic_t rb_concurrent_set_size(VALUE set_obj);
|
|
16
|
+
VALUE rb_concurrent_set_find(VALUE *set_obj_ptr, VALUE key);
|
|
17
|
+
VALUE rb_concurrent_set_find_or_insert(VALUE *set_obj_ptr, VALUE key, void *data);
|
|
18
|
+
VALUE rb_concurrent_set_delete_by_identity(VALUE set_obj, VALUE key);
|
|
19
|
+
void rb_concurrent_set_foreach_with_replace(VALUE set_obj, int (*callback)(VALUE *key, void *data), void *data);
|
|
20
|
+
|
|
21
|
+
#endif
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#ifndef INTERNAL_CONT_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_CONT_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Fiber.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
#include "iseq.h"
|
|
13
|
+
|
|
14
|
+
struct rb_thread_struct; /* in vm_core.h */
|
|
15
|
+
struct rb_fiber_struct; /* in cont.c */
|
|
16
|
+
struct rb_execution_context_struct; /* in vm_core.c */
|
|
17
|
+
|
|
18
|
+
/* cont.c */
|
|
19
|
+
void rb_fiber_reset_root_local_storage(struct rb_thread_struct *);
|
|
20
|
+
void ruby_register_rollback_func_for_ensure(VALUE (*ensure_func)(VALUE), VALUE (*rollback_func)(VALUE));
|
|
21
|
+
void rb_jit_cont_init(void);
|
|
22
|
+
void rb_jit_cont_each_iseq(rb_iseq_callback callback, void *data);
|
|
23
|
+
void rb_jit_cont_finish(void);
|
|
24
|
+
|
|
25
|
+
/* vm.c */
|
|
26
|
+
void rb_free_shared_fiber_pool(void);
|
|
27
|
+
|
|
28
|
+
// Copy locals from the current execution to the specified fiber.
|
|
29
|
+
VALUE rb_fiber_inherit_storage(struct rb_execution_context_struct *ec, struct rb_fiber_struct *fiber);
|
|
30
|
+
|
|
31
|
+
VALUE rb_fiberptr_self(struct rb_fiber_struct *fiber);
|
|
32
|
+
unsigned int rb_fiberptr_blocking(struct rb_fiber_struct *fiber);
|
|
33
|
+
struct rb_execution_context_struct * rb_fiberptr_get_ec(struct rb_fiber_struct *fiber);
|
|
34
|
+
|
|
35
|
+
#endif /* INTERNAL_CONT_H */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#ifndef INTERNAL_DIR_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_DIR_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Dir.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
|
|
13
|
+
/* dir.c */
|
|
14
|
+
VALUE rb_dir_getwd_ospath(void);
|
|
15
|
+
|
|
16
|
+
#endif /* INTERNAL_DIR_H */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#ifndef INTERNAL_ENC_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_ENC_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Encoding.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/encoding.h" /* for rb_encoding */
|
|
12
|
+
|
|
13
|
+
/* us_ascii.c */
|
|
14
|
+
extern rb_encoding OnigEncodingUS_ASCII;
|
|
15
|
+
|
|
16
|
+
/* utf_8.c */
|
|
17
|
+
extern rb_encoding OnigEncodingUTF_8;
|
|
18
|
+
|
|
19
|
+
#endif /* INTERNAL_ENC_H */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#ifndef INTERNAL_ENCODING_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_ENCODING_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Encoding.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for ID */
|
|
12
|
+
#include "ruby/encoding.h" /* for rb_encoding */
|
|
13
|
+
|
|
14
|
+
#define rb_is_usascii_enc(enc) ((enc) == rb_usascii_encoding())
|
|
15
|
+
#define rb_is_ascii8bit_enc(enc) ((enc) == rb_ascii8bit_encoding())
|
|
16
|
+
#define rb_is_locale_enc(enc) ((enc) == rb_locale_encoding())
|
|
17
|
+
|
|
18
|
+
/* encoding.c */
|
|
19
|
+
ID rb_id_encoding(void);
|
|
20
|
+
const char * rb_enc_inspect_name(rb_encoding *enc);
|
|
21
|
+
rb_encoding *rb_enc_get_from_index(int index);
|
|
22
|
+
rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
|
|
23
|
+
int rb_encdb_replicate(const char *alias, const char *orig);
|
|
24
|
+
int rb_encdb_alias(const char *alias, const char *orig);
|
|
25
|
+
int rb_enc_autoload(rb_encoding *enc);
|
|
26
|
+
bool rb_enc_autoload_p(rb_encoding *enc);
|
|
27
|
+
int rb_encdb_dummy(const char *name);
|
|
28
|
+
void rb_encdb_declare(const char *name);
|
|
29
|
+
void rb_enc_set_base(const char *name, const char *orig);
|
|
30
|
+
int rb_enc_set_dummy(int index);
|
|
31
|
+
void rb_enc_raw_set(VALUE obj, rb_encoding *enc);
|
|
32
|
+
int rb_enc_registered(const char *name);
|
|
33
|
+
|
|
34
|
+
PUREFUNC(int rb_data_is_encoding(VALUE obj));
|
|
35
|
+
|
|
36
|
+
/* vm.c */
|
|
37
|
+
void rb_free_global_enc_table(void);
|
|
38
|
+
|
|
39
|
+
#endif /* INTERNAL_ENCODING_H */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef INTERNAL_ENUM_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_ENUM_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Enumerable.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
|
|
13
|
+
/* enum.c */
|
|
14
|
+
extern VALUE rb_cArithSeq;
|
|
15
|
+
VALUE rb_f_send(int argc, VALUE *argv, VALUE recv);
|
|
16
|
+
VALUE rb_nmin_run(VALUE obj, VALUE num, int by, int rev, int ary);
|
|
17
|
+
|
|
18
|
+
#endif /* INTERNAL_ENUM_H */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef INTERNAL_ENUMERATOR_H /*-*-C-*-vi:se ft=c:*/
|
|
2
|
+
#define INTERNAL_ENUMERATOR_H
|
|
3
|
+
/**
|
|
4
|
+
* @author Ruby developers <ruby-core@ruby-lang.org>
|
|
5
|
+
* @copyright This file is a part of the programming language Ruby.
|
|
6
|
+
* Permission is hereby granted, to either redistribute and/or
|
|
7
|
+
* modify this file, provided that the conditions mentioned in the
|
|
8
|
+
* file COPYING are met. Consult the file for details.
|
|
9
|
+
* @brief Internal header for Enumerator.
|
|
10
|
+
*/
|
|
11
|
+
#include "ruby/ruby.h" /* for VALUE */
|
|
12
|
+
#include "ruby/intern.h" /* for rb_enumerator_size_func */
|
|
13
|
+
|
|
14
|
+
RUBY_SYMBOL_EXPORT_BEGIN
|
|
15
|
+
/* enumerator.c (export) */
|
|
16
|
+
VALUE rb_arith_seq_new(VALUE obj, VALUE meth, int argc, VALUE const *argv,
|
|
17
|
+
rb_enumerator_size_func *size_fn,
|
|
18
|
+
VALUE beg, VALUE end, VALUE step, int excl);
|
|
19
|
+
RUBY_SYMBOL_EXPORT_END
|
|
20
|
+
|
|
21
|
+
#endif /* INTERNAL_ENUMERATOR_H */
|