Skip to content

Commit 233ddfa

Browse files
committed
Stop exporting symbols for MJIT
1 parent 31f4b2d commit 233ddfa

Some content is hidden

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

49 files changed

+116
-193
lines changed

Diff for: array.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ VALUE
881881
return ary;
882882
}
883883

884-
MJIT_FUNC_EXPORTED VALUE
884+
VALUE
885885
rb_ary_tmp_new_from_values(VALUE klass, long n, const VALUE *elts)
886886
{
887887
VALUE ary;
@@ -1123,7 +1123,7 @@ rb_check_array_type(VALUE ary)
11231123
return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_ary);
11241124
}
11251125

1126-
MJIT_FUNC_EXPORTED VALUE
1126+
VALUE
11271127
rb_check_to_array(VALUE ary)
11281128
{
11291129
return rb_check_convert_type_with_id(ary, T_ARRAY, "Array", idTo_a);
@@ -1655,7 +1655,7 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
16551655
return result;
16561656
}
16571657

1658-
MJIT_FUNC_EXPORTED VALUE
1658+
VALUE
16591659
rb_ary_behead(VALUE ary, long n)
16601660
{
16611661
if (n <= 0) {
@@ -1981,7 +1981,7 @@ rb_ary_aref2(VALUE ary, VALUE b, VALUE e)
19811981
return rb_ary_subseq(ary, beg, len);
19821982
}
19831983

1984-
MJIT_FUNC_EXPORTED VALUE
1984+
VALUE
19851985
rb_ary_aref1(VALUE ary, VALUE arg)
19861986
{
19871987
long beg, len, step;

Diff for: bignum.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4541,7 +4541,7 @@ rb_uint128t2big(uint128_t n)
45414541
return big;
45424542
}
45434543

4544-
MJIT_FUNC_EXPORTED VALUE
4544+
VALUE
45454545
rb_int128t2big(int128_t n)
45464546
{
45474547
int neg = 0;

Diff for: class.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ rb_define_class_id(ID id, VALUE super)
924924
* \return the value \c Class#inherited's returns
925925
* \pre Each of \a super and \a klass must be a \c Class object.
926926
*/
927-
MJIT_FUNC_EXPORTED VALUE
927+
VALUE
928928
rb_class_inherited(VALUE super, VALUE klass)
929929
{
930930
ID inherited;
@@ -2306,7 +2306,7 @@ rb_define_attr(VALUE klass, const char *name, int read, int write)
23062306
rb_attr(klass, rb_intern(name), read, write, FALSE);
23072307
}
23082308

2309-
MJIT_FUNC_EXPORTED VALUE
2309+
VALUE
23102310
rb_keyword_error_new(const char *error, VALUE keys)
23112311
{
23122312
long i = 0, len = RARRAY_LEN(keys);

Diff for: compile.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13194,7 +13194,7 @@ rb_ibf_load_iseq_complete(rb_iseq_t *iseq)
1319413194
}
1319513195

1319613196
#if USE_LAZY_LOAD
13197-
MJIT_FUNC_EXPORTED const rb_iseq_t *
13197+
const rb_iseq_t *
1319813198
rb_iseq_complete(const rb_iseq_t *iseq)
1319913199
{
1320013200
rb_ibf_load_iseq_complete((rb_iseq_t *)iseq);

Diff for: constant.h

-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ VALUE rb_mod_deprecate_constant(int argc, const VALUE *argv, VALUE obj);
4343
void rb_free_const_table(struct rb_id_table *tbl);
4444
VALUE rb_const_source_location(VALUE, ID);
4545

46-
MJIT_SYMBOL_EXPORT_BEGIN
4746
int rb_autoloading_value(VALUE mod, ID id, VALUE *value, rb_const_flag_t *flag);
4847
rb_const_entry_t *rb_const_lookup(VALUE klass, ID id);
4948
VALUE rb_public_const_get_at(VALUE klass, ID id);
5049
VALUE rb_public_const_get_from(VALUE klass, ID id);
5150
int rb_public_const_defined_from(VALUE klass, ID id);
5251
VALUE rb_const_source_location_at(VALUE, ID);
53-
MJIT_SYMBOL_EXPORT_END
5452

5553
#endif /* CONSTANT_H */

Diff for: debug_counter.c

-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ const char *const rb_debug_counter_names[] = {
2525
#undef RB_DEBUG_COUNTER
2626
};
2727

28-
MJIT_SYMBOL_EXPORT_BEGIN
2928
size_t rb_debug_counter[numberof(rb_debug_counter_names)];
3029
void rb_debug_counter_add_atomic(enum rb_debug_counter_type type, int add);
31-
MJIT_SYMBOL_EXPORT_END
3230

3331
static rb_nativethread_lock_t debug_counter_lock;
3432

Diff for: error.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ rb_warning_category_update(unsigned int mask, unsigned int bits)
187187
warning_disabled_categories |= mask & ~bits;
188188
}
189189

190-
MJIT_FUNC_EXPORTED bool
190+
bool
191191
rb_warning_category_enabled_p(rb_warning_category_t category)
192192
{
193193
return !(warning_disabled_categories & (1U << category));
@@ -867,7 +867,7 @@ rb_report_bug_valist(VALUE file, int line, const char *fmt, va_list args)
867867
report_bug_valist(RSTRING_PTR(file), line, fmt, NULL, args);
868868
}
869869

870-
MJIT_FUNC_EXPORTED void
870+
void
871871
rb_assert_failure(const char *file, int line, const char *name, const char *expr)
872872
{
873873
FILE *out = stderr;
@@ -1582,7 +1582,7 @@ exc_set_backtrace(VALUE exc, VALUE bt)
15821582
return rb_ivar_set(exc, id_bt, rb_check_backtrace(bt));
15831583
}
15841584

1585-
MJIT_FUNC_EXPORTED VALUE
1585+
VALUE
15861586
rb_exc_set_backtrace(VALUE exc, VALUE bt)
15871587
{
15881588
return exc_set_backtrace(exc, bt);

Diff for: gc.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -3129,7 +3129,7 @@ rb_imemo_new_debug(enum imemo_type type, VALUE v1, VALUE v2, VALUE v3, VALUE v0,
31293129
}
31303130
#endif
31313131

3132-
MJIT_FUNC_EXPORTED VALUE
3132+
VALUE
31333133
rb_class_allocate_instance(VALUE klass)
31343134
{
31353135
return rb_class_instance_allocate_internal(klass, T_OBJECT | ROBJECT_EMBED, RGENGC_WB_PROTECTED_OBJECT);
@@ -6526,7 +6526,7 @@ stack_check(rb_execution_context_t *ec, int water_mark)
65266526

65276527
#define STACKFRAME_FOR_CALL_CFUNC 2048
65286528

6529-
MJIT_FUNC_EXPORTED int
6529+
int
65306530
rb_ec_stack_check(rb_execution_context_t *ec)
65316531
{
65326532
return stack_check(ec, STACKFRAME_FOR_CALL_CFUNC);
@@ -9167,7 +9167,7 @@ rb_gc_writebarrier_unprotect(VALUE obj)
91679167
/*
91689168
* remember `obj' if needed.
91699169
*/
9170-
MJIT_FUNC_EXPORTED void
9170+
void
91719171
rb_gc_writebarrier_remember(VALUE obj)
91729172
{
91739173
rb_objspace_t *objspace = &rb_objspace;
@@ -14661,7 +14661,7 @@ obj_info(VALUE obj)
1466114661
}
1466214662
#endif
1466314663

14664-
MJIT_FUNC_EXPORTED const char *
14664+
const char *
1466514665
rb_obj_info(VALUE obj)
1466614666
{
1466714667
return obj_info(obj);
@@ -14674,7 +14674,7 @@ rb_obj_info_dump(VALUE obj)
1467414674
fprintf(stderr, "rb_obj_info_dump: %s\n", rb_raw_obj_info(buff, 0x100, obj));
1467514675
}
1467614676

14677-
MJIT_FUNC_EXPORTED void
14677+
void
1467814678
rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func)
1467914679
{
1468014680
char buff[0x100];

Diff for: hash.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ copy_compare_by_id(VALUE hash, VALUE basis)
15341534
return hash;
15351535
}
15361536

1537-
MJIT_FUNC_EXPORTED VALUE
1537+
VALUE
15381538
rb_hash_new_with_size(st_index_t size)
15391539
{
15401540
VALUE ret = rb_hash_new();
@@ -1594,7 +1594,7 @@ rb_hash_dup(VALUE hash)
15941594
return ret;
15951595
}
15961596

1597-
MJIT_FUNC_EXPORTED VALUE
1597+
VALUE
15981598
rb_hash_resurrect(VALUE hash)
15991599
{
16001600
VALUE ret = hash_dup(hash, rb_cHash, 0);
@@ -1607,7 +1607,7 @@ rb_hash_modify_check(VALUE hash)
16071607
rb_check_frozen(hash);
16081608
}
16091609

1610-
MJIT_FUNC_EXPORTED struct st_table *
1610+
struct st_table *
16111611
rb_hash_tbl_raw(VALUE hash, const char *file, int line)
16121612
{
16131613
return ar_force_convert_table(hash, file, line);
@@ -1887,7 +1887,7 @@ rb_hash_s_create(int argc, VALUE *argv, VALUE klass)
18871887
return hash;
18881888
}
18891889

1890-
MJIT_FUNC_EXPORTED VALUE
1890+
VALUE
18911891
rb_to_hash_type(VALUE hash)
18921892
{
18931893
return rb_convert_type_with_id(hash, T_HASH, "Hash", idTo_hash);
@@ -2078,7 +2078,7 @@ hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval)
20782078
}
20792079
}
20802080

2081-
MJIT_FUNC_EXPORTED int
2081+
int
20822082
rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval)
20832083
{
20842084
return hash_stlike_lookup(hash, key, pval);
@@ -3550,7 +3550,7 @@ keys_i(VALUE key, VALUE value, VALUE ary)
35503550
* h.keys # => [:foo, :bar, :baz]
35513551
*/
35523552

3553-
MJIT_FUNC_EXPORTED VALUE
3553+
VALUE
35543554
rb_hash_keys(VALUE hash)
35553555
{
35563556
st_index_t size = RHASH_SIZE(hash);
@@ -3637,7 +3637,7 @@ rb_hash_values(VALUE hash)
36373637
* Returns +true+ if +key+ is a key in +self+, otherwise +false+.
36383638
*/
36393639

3640-
MJIT_FUNC_EXPORTED VALUE
3640+
VALUE
36413641
rb_hash_has_key(VALUE hash, VALUE key)
36423642
{
36433643
return RBOOL(hash_stlike_lookup(hash, key, NULL));
@@ -4406,7 +4406,7 @@ rb_hash_compare_by_id(VALUE hash)
44064406
* Returns +true+ if #compare_by_identity has been called, +false+ otherwise.
44074407
*/
44084408

4409-
MJIT_FUNC_EXPORTED VALUE
4409+
VALUE
44104410
rb_hash_compare_by_id_p(VALUE hash)
44114411
{
44124412
return RBOOL(RHASH_ST_TABLE_P(hash) && RHASH_ST_TABLE(hash)->type == &identhash);

Diff for: id_table.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ rb_id_table_init(struct rb_id_table *tbl, int capa)
9292
return tbl;
9393
}
9494

95-
MJIT_FUNC_EXPORTED struct rb_id_table *
95+
struct rb_id_table *
9696
rb_id_table_create(size_t capa)
9797
{
9898
struct rb_id_table *tbl = ALLOC(struct rb_id_table);
@@ -223,7 +223,7 @@ hash_table_show(struct rb_id_table *tbl)
223223
}
224224
#endif
225225

226-
MJIT_FUNC_EXPORTED int
226+
int
227227
rb_id_table_lookup(struct rb_id_table *tbl, ID id, VALUE *valp)
228228
{
229229
id_key_t key = id2key(id);
@@ -253,7 +253,7 @@ rb_id_table_insert_key(struct rb_id_table *tbl, const id_key_t key, const VALUE
253253
return TRUE;
254254
}
255255

256-
MJIT_FUNC_EXPORTED int
256+
int
257257
rb_id_table_insert(struct rb_id_table *tbl, ID id, VALUE val)
258258
{
259259
return rb_id_table_insert_key(tbl, id2key(id), val);

Diff for: include/ruby/internal/dllexport.h

-11
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@
6969
/* These macros are used for functions which are exported only for MJIT
7070
and NOT ensured to be exported in future versions. */
7171

72-
#if ! defined(MJIT_HEADER)
73-
# define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED
74-
#elif ! RBIMPL_COMPILER_IS(MSVC)
75-
# define MJIT_FUNC_EXPORTED RUBY_FUNC_EXPORTED
76-
#else
77-
# define MJIT_FUNC_EXPORTED static
78-
#endif
79-
80-
#define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN
81-
#define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END
82-
8372
/* On mswin, MJIT header transformation can't be used since cl.exe can't output
8473
preprocessed output preserving macros. So this `MJIT_STATIC` is needed
8574
to force non-static function to static on MJIT header to avoid symbol conflict. */

Diff for: internal/array.h

-2
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,13 @@ static inline bool ARY_PTR_USING_P(VALUE ary);
4242
static inline void RARY_TRANSIENT_SET(VALUE ary);
4343
static inline void RARY_TRANSIENT_UNSET(VALUE ary);
4444

45-
MJIT_SYMBOL_EXPORT_BEGIN
4645
VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *);
4746
VALUE rb_check_to_array(VALUE ary);
4847
VALUE rb_ary_behead(VALUE, long);
4948
VALUE rb_ary_aref1(VALUE ary, VALUE i);
5049

5150
struct rb_execution_context_struct;
5251
VALUE rb_ec_ary_new_from_values(struct rb_execution_context_struct *ec, long n, const VALUE *elts);
53-
MJIT_SYMBOL_EXPORT_END
5452

5553
// YJIT needs this function to never allocate and never raise
5654
static inline VALUE

Diff for: internal/basic_operators.h

-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ enum ruby_basic_operators {
4040
BOP_LAST_
4141
};
4242

43-
MJIT_SYMBOL_EXPORT_BEGIN
4443
RUBY_EXTERN short ruby_vm_redefined_flag[BOP_LAST_];
45-
MJIT_SYMBOL_EXPORT_END
4644

4745
/* optimize insn */
4846
#define INTEGER_REDEFINED_OP_FLAG (1 << 0)

Diff for: internal/bignum.h

-2
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,9 @@ VALUE rb_str2big_gmp(VALUE arg, int base, int badcheck);
163163
VALUE rb_int_parse_cstr(const char *str, ssize_t len, char **endp, size_t *ndigits, int base, int flags);
164164
RUBY_SYMBOL_EXPORT_END
165165

166-
MJIT_SYMBOL_EXPORT_BEGIN
167166
#if defined(HAVE_INT128_T)
168167
VALUE rb_int128t2big(int128_t n);
169168
#endif
170-
MJIT_SYMBOL_EXPORT_END
171169

172170
/* sign: positive:1, negative:0 */
173171
static inline bool

Diff for: internal/class.h

-2
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,8 @@ static inline VALUE RCLASS_SUPER(VALUE klass);
148148
static inline VALUE RCLASS_SET_SUPER(VALUE klass, VALUE super);
149149
static inline void RCLASS_SET_INCLUDER(VALUE iclass, VALUE klass);
150150

151-
MJIT_SYMBOL_EXPORT_BEGIN
152151
VALUE rb_class_inherited(VALUE, VALUE);
153152
VALUE rb_keyword_error_new(const char *, VALUE);
154-
MJIT_SYMBOL_EXPORT_END
155153

156154
static inline rb_alloc_func_t
157155
RCLASS_ALLOCATOR(VALUE klass)

Diff for: internal/compile.h

-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ int rb_vm_insn_addr2insn(const void *);
2929
int rb_vm_insn_decode(const VALUE encoded);
3030
extern bool ruby_vm_keep_script_lines;
3131

32-
MJIT_SYMBOL_EXPORT_BEGIN
3332
/* iseq.c (export) */
3433
rb_event_flag_t rb_iseq_event_flags(const struct rb_iseq_struct *iseq, size_t pos);
35-
MJIT_SYMBOL_EXPORT_END
3634

3735
#endif /* INTERNAL_COMPILE_H */

Diff for: internal/gc.h

-2
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,9 @@ void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, siz
291291
void ruby_sized_xfree(void *x, size_t size);
292292
RUBY_SYMBOL_EXPORT_END
293293

294-
MJIT_SYMBOL_EXPORT_BEGIN
295294
int rb_ec_stack_check(struct rb_execution_context_struct *ec);
296295
void rb_gc_writebarrier_remember(VALUE obj);
297296
const char *rb_obj_info(VALUE obj);
298-
MJIT_SYMBOL_EXPORT_END
299297

300298
#if defined(HAVE_MALLOC_USABLE_SIZE) || defined(HAVE_MALLOC_SIZE) || defined(_WIN32)
301299

Diff for: internal/hash.h

-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ VALUE rb_ident_hash_new(void);
107107
int rb_hash_stlike_foreach(VALUE hash, st_foreach_callback_func *func, st_data_t arg);
108108
RUBY_SYMBOL_EXPORT_END
109109

110-
MJIT_SYMBOL_EXPORT_BEGIN
111110
VALUE rb_hash_new_with_size(st_index_t size);
112111
VALUE rb_hash_resurrect(VALUE hash);
113112
int rb_hash_stlike_lookup(VALUE hash, st_data_t key, st_data_t *pval);
@@ -117,7 +116,6 @@ VALUE rb_hash_compare_by_id_p(VALUE hash);
117116

118117
st_table *rb_hash_tbl_raw(VALUE hash, const char *file, int line);
119118
#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h, __FILE__, __LINE__)
120-
MJIT_SYMBOL_EXPORT_END
121119

122120
VALUE rb_hash_compare_by_id(VALUE hash);
123121

Diff for: internal/numeric.h

-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ RUBY_SYMBOL_EXPORT_BEGIN
111111
/* numeric.c (export) */
112112
RUBY_SYMBOL_EXPORT_END
113113

114-
MJIT_SYMBOL_EXPORT_BEGIN
115114
VALUE rb_flo_div_flo(VALUE x, VALUE y);
116115
double ruby_float_mod(double x, double y);
117116
VALUE rb_float_equal(VALUE x, VALUE y);
@@ -125,7 +124,6 @@ VALUE rb_int_abs(VALUE num);
125124
VALUE rb_int_bit_length(VALUE num);
126125
VALUE rb_int_uminus(VALUE num);
127126
VALUE rb_int_comp(VALUE num);
128-
MJIT_SYMBOL_EXPORT_END
129127

130128
static inline bool
131129
INT_POSITIVE_P(VALUE num)

0 commit comments

Comments
 (0)