Skip to content

Commit 75c93a8

Browse files
committed
RUBY-32905 Added headers for ruby-3.4.0-preview2
1 parent 8300d9f commit 75c93a8

File tree

144 files changed

+48927
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+48927
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## [3.3.6](https://github.com/ruby-debug/debase-ruby_core_source/compare/3.3.5...3.3.6)
2+
3+
* ruby-3.4.0-preview2 sources added
4+
5+
## [3.3.5](https://github.com/ruby-debug/debase-ruby_core_source/compare/3.3.1...3.3.5)
6+
7+
* ruby-3.4.0-preview1 sources added
8+
19
## [3.3.1](https://github.com/ruby-debug/debase-ruby_core_source/compare/3.3.0...3.3.1)
210

311
* prism headers added for ruby-3.3.0
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#ifndef RUBY_ADDR2LINE_H
2+
#define RUBY_ADDR2LINE_H
3+
/**********************************************************************
4+
5+
addr2line.h -
6+
7+
$Author$
8+
9+
Copyright (C) 2010 Shinichiro Hamaji
10+
11+
**********************************************************************/
12+
13+
#if (defined(USE_ELF) || defined(HAVE_MACH_O_LOADER_H))
14+
15+
#include <stdio.h>
16+
17+
void
18+
rb_dump_backtrace_with_lines(int num_traces, void **traces, FILE *errout);
19+
20+
#endif /* USE_ELF */
21+
22+
#endif /* RUBY_ADDR2LINE_H */
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#ifndef BUILTIN_H_INCLUDED
2+
#define BUILTIN_H_INCLUDED
3+
4+
// invoke
5+
6+
struct rb_builtin_function {
7+
// for invocation
8+
const void * const func_ptr;
9+
const int argc;
10+
11+
// for load
12+
const int index;
13+
const char * const name;
14+
};
15+
16+
#define RB_BUILTIN_FUNCTION(_i, _name, _fname, _arity) {\
17+
.name = _i < 0 ? NULL : #_name, \
18+
.func_ptr = (void *)_fname, \
19+
.argc = _arity, \
20+
.index = _i, \
21+
}
22+
23+
void rb_load_with_builtin_functions(const char *feature_name, const struct rb_builtin_function *table);
24+
25+
#ifndef rb_execution_context_t
26+
typedef struct rb_execution_context_struct rb_execution_context_t;
27+
#define rb_execution_context_t rb_execution_context_t
28+
#endif
29+
30+
/* The following code is generated by the following Ruby script:
31+
32+
typedef = proc {|i, args|
33+
"typedef VALUE (*rb_builtin_arity#{i}_function_type)(rb_execution_context_t *ec, VALUE self#{args});"
34+
}
35+
puts typedef[0, ""]
36+
(1..15).each {|i|
37+
puts typedef[i, ",\n " + (0...i).map{"VALUE"}.join(", ")]
38+
}
39+
16.times{|i|
40+
puts "static inline void rb_builtin_function_check_arity#{i}(rb_builtin_arity#{i}_function_type f){}"
41+
}
42+
*/
43+
44+
typedef VALUE (*rb_builtin_arity0_function_type)(rb_execution_context_t *ec, VALUE self);
45+
typedef VALUE (*rb_builtin_arity1_function_type)(rb_execution_context_t *ec, VALUE self,
46+
VALUE);
47+
typedef VALUE (*rb_builtin_arity2_function_type)(rb_execution_context_t *ec, VALUE self,
48+
VALUE, VALUE);
49+
typedef VALUE (*rb_builtin_arity3_function_type)(rb_execution_context_t *ec, VALUE self,
50+
VALUE, VALUE, VALUE);
51+
typedef VALUE (*rb_builtin_arity4_function_type)(rb_execution_context_t *ec, VALUE self,
52+
VALUE, VALUE, VALUE, VALUE);
53+
typedef VALUE (*rb_builtin_arity5_function_type)(rb_execution_context_t *ec, VALUE self,
54+
VALUE, VALUE, VALUE, VALUE, VALUE);
55+
typedef VALUE (*rb_builtin_arity6_function_type)(rb_execution_context_t *ec, VALUE self,
56+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
57+
typedef VALUE (*rb_builtin_arity7_function_type)(rb_execution_context_t *ec, VALUE self,
58+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
59+
typedef VALUE (*rb_builtin_arity8_function_type)(rb_execution_context_t *ec, VALUE self,
60+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
61+
typedef VALUE (*rb_builtin_arity9_function_type)(rb_execution_context_t *ec, VALUE self,
62+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
63+
typedef VALUE (*rb_builtin_arity10_function_type)(rb_execution_context_t *ec, VALUE self,
64+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
65+
typedef VALUE (*rb_builtin_arity11_function_type)(rb_execution_context_t *ec, VALUE self,
66+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
67+
typedef VALUE (*rb_builtin_arity12_function_type)(rb_execution_context_t *ec, VALUE self,
68+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
69+
typedef VALUE (*rb_builtin_arity13_function_type)(rb_execution_context_t *ec, VALUE self,
70+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
71+
typedef VALUE (*rb_builtin_arity14_function_type)(rb_execution_context_t *ec, VALUE self,
72+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
73+
typedef VALUE (*rb_builtin_arity15_function_type)(rb_execution_context_t *ec, VALUE self,
74+
VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE, VALUE);
75+
static inline void rb_builtin_function_check_arity0(rb_builtin_arity0_function_type f){}
76+
static inline void rb_builtin_function_check_arity1(rb_builtin_arity1_function_type f){}
77+
static inline void rb_builtin_function_check_arity2(rb_builtin_arity2_function_type f){}
78+
static inline void rb_builtin_function_check_arity3(rb_builtin_arity3_function_type f){}
79+
static inline void rb_builtin_function_check_arity4(rb_builtin_arity4_function_type f){}
80+
static inline void rb_builtin_function_check_arity5(rb_builtin_arity5_function_type f){}
81+
static inline void rb_builtin_function_check_arity6(rb_builtin_arity6_function_type f){}
82+
static inline void rb_builtin_function_check_arity7(rb_builtin_arity7_function_type f){}
83+
static inline void rb_builtin_function_check_arity8(rb_builtin_arity8_function_type f){}
84+
static inline void rb_builtin_function_check_arity9(rb_builtin_arity9_function_type f){}
85+
static inline void rb_builtin_function_check_arity10(rb_builtin_arity10_function_type f){}
86+
static inline void rb_builtin_function_check_arity11(rb_builtin_arity11_function_type f){}
87+
static inline void rb_builtin_function_check_arity12(rb_builtin_arity12_function_type f){}
88+
static inline void rb_builtin_function_check_arity13(rb_builtin_arity13_function_type f){}
89+
static inline void rb_builtin_function_check_arity14(rb_builtin_arity14_function_type f){}
90+
static inline void rb_builtin_function_check_arity15(rb_builtin_arity15_function_type f){}
91+
92+
PUREFUNC(VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index));
93+
VALUE rb_vm_lvar_exposed(rb_execution_context_t *ec, int index);
94+
95+
// __builtin_inline!
96+
97+
PUREFUNC(static inline VALUE rb_vm_lvar(rb_execution_context_t *ec, int index));
98+
99+
static inline VALUE
100+
rb_vm_lvar(rb_execution_context_t *ec, int index)
101+
{
102+
#if defined(VM_CORE_H_EC_DEFINED) && VM_CORE_H_EC_DEFINED
103+
return ec->cfp->ep[index];
104+
#else
105+
return rb_vm_lvar_exposed(ec, index);
106+
#endif
107+
}
108+
109+
#define LOCAL_PTR(local) local ## __ptr
110+
111+
// dump/load
112+
113+
struct builtin_binary {
114+
const char *feature; // feature name
115+
const unsigned char *bin; // binary by ISeq#to_binary
116+
size_t bin_size;
117+
};
118+
119+
#endif // BUILTIN_H_INCLUDED
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
2+
#ifndef CCAN_BUILD_ASSERT_H
3+
#define CCAN_BUILD_ASSERT_H
4+
5+
/**
6+
* CCAN_BUILD_ASSERT - assert a build-time dependency.
7+
* @cond: the compile-time condition which must be true.
8+
*
9+
* Your compile will fail if the condition isn't true, or can't be evaluated
10+
* by the compiler. This can only be used within a function.
11+
*
12+
* Example:
13+
* #include <stddef.h>
14+
* ...
15+
* static char *foo_to_char(struct foo *foo)
16+
* {
17+
* // This code needs string to be at start of foo.
18+
* CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0);
19+
* return (char *)foo;
20+
* }
21+
*/
22+
#define CCAN_BUILD_ASSERT(cond) \
23+
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
24+
25+
/**
26+
* CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
27+
* @cond: the compile-time condition which must be true.
28+
*
29+
* Your compile will fail if the condition isn't true, or can't be evaluated
30+
* by the compiler. This can be used in an expression: its value is "0".
31+
*
32+
* Example:
33+
* #define foo_to_char(foo) \
34+
* ((char *)(foo) \
35+
* + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
36+
*/
37+
#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \
38+
(sizeof(char [1 - 2*!(cond)]) - 1)
39+
40+
#endif /* CCAN_BUILD_ASSERT_H */
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/* CC0 (Public domain) - see ccan/licenses/CC0 file for details */
2+
#ifndef CCAN_CHECK_TYPE_H
3+
#define CCAN_CHECK_TYPE_H
4+
5+
/**
6+
* ccan_check_type - issue a warning or build failure if type is not correct.
7+
* @expr: the expression whose type we should check (not evaluated).
8+
* @type: the exact type we expect the expression to be.
9+
*
10+
* This macro is usually used within other macros to try to ensure that a macro
11+
* argument is of the expected type. No type promotion of the expression is
12+
* done: an unsigned int is not the same as an int!
13+
*
14+
* ccan_check_type() always evaluates to 0.
15+
*
16+
* If your compiler does not support typeof, then the best we can do is fail
17+
* to compile if the sizes of the types are unequal (a less complete check).
18+
*
19+
* Example:
20+
* // They should always pass a 64-bit value to _set_some_value!
21+
* #define set_some_value(expr) \
22+
* _set_some_value((ccan_check_type((expr), uint64_t), (expr)))
23+
*/
24+
25+
/**
26+
* ccan_check_types_match - issue a warning or build failure if types are not same.
27+
* @expr1: the first expression (not evaluated).
28+
* @expr2: the second expression (not evaluated).
29+
*
30+
* This macro is usually used within other macros to try to ensure that
31+
* arguments are of identical types. No type promotion of the expressions is
32+
* done: an unsigned int is not the same as an int!
33+
*
34+
* ccan_check_types_match() always evaluates to 0.
35+
*
36+
* If your compiler does not support typeof, then the best we can do is fail
37+
* to compile if the sizes of the types are unequal (a less complete check).
38+
*
39+
* Example:
40+
* // Do subtraction to get to enclosing type, but make sure that
41+
* // pointer is of correct type for that member.
42+
* #define ccan_container_of(mbr_ptr, encl_type, mbr) \
43+
* (ccan_check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
44+
* ((encl_type *) \
45+
* ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
46+
*/
47+
#if defined(HAVE_TYPEOF) && HAVE_TYPEOF
48+
#define ccan_check_type(expr, type) \
49+
((typeof(expr) *)0 != (type *)0)
50+
51+
#define ccan_check_types_match(expr1, expr2) \
52+
((typeof(expr1) *)0 != (typeof(expr2) *)0)
53+
#else
54+
#include "ccan/build_assert/build_assert.h"
55+
/* Without typeof, we can only test the sizes. */
56+
#define ccan_check_type(expr, type) \
57+
CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
58+
59+
#define ccan_check_types_match(expr1, expr2) \
60+
CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
61+
#endif /* HAVE_TYPEOF */
62+
63+
#endif /* CCAN_CHECK_TYPE_H */

0 commit comments

Comments
 (0)