Remove obsoleted MJIT_STATIC macro

This commit is contained in:
Takashi Kokubun 2023-03-06 22:02:03 -08:00
parent f68580890f
commit 7fb36a0054
Notes: git 2023-03-07 06:29:55 +00:00
6 changed files with 16 additions and 35 deletions

View File

@ -59,25 +59,6 @@
# define RUBY_FUNC_EXPORTED /* void */
#endif
/**
* @cond INTERNAL_MACRO
*
* These MJIT related macros are placed here because translate_mjit_header can
* need them. Extension libraries should not touch.
*/
/* These macros are used for functions which are exported only for MJIT
and NOT ensured to be exported in future versions. */
/* On mswin, MJIT header transformation can't be used since cl.exe can't output
preprocessed output preserving macros. So this `MJIT_STATIC` is needed
to force non-static function to static on MJIT header to avoid symbol conflict. */
#ifdef MJIT_HEADER
# define MJIT_STATIC static
#else
# define MJIT_STATIC
#endif
/** @endcond */
/** Shortcut macro equivalent to `RUBY_SYMBOL_EXPORT_BEGIN extern "C" {`.

View File

@ -235,7 +235,7 @@ RBIMPL_ATTR_NORETURN()
* @param[in] max Maximum allowed `argc`.
* @exception rb_eArgError Always.
*/
MJIT_STATIC void rb_error_arity(int argc, int min, int max);
void rb_error_arity(int argc, int min, int max);
RBIMPL_SYMBOL_EXPORT_END()

View File

@ -50,12 +50,12 @@ PUREFUNC(VALUE rb_vm_top_self(void));
const void **rb_vm_get_insns_address_table(void);
VALUE rb_source_location(int *pline);
const char *rb_source_location_cstr(int *pline);
MJIT_STATIC void rb_vm_pop_cfunc_frame(void);
void rb_vm_pop_cfunc_frame(void);
int rb_vm_add_root_module(VALUE module);
void rb_vm_check_redefinition_by_prepend(VALUE klass);
int rb_vm_check_optimizable_mid(VALUE mid);
VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
MJIT_STATIC VALUE ruby_vm_special_exception_copy(VALUE);
VALUE ruby_vm_special_exception_copy(VALUE);
PUREFUNC(st_table *rb_vm_fstring_table(void));
VALUE vm_exec(struct rb_execution_context_struct *, bool); /* used in JIT-ed code */

2
vm.c
View File

@ -712,7 +712,7 @@ vm_get_ruby_level_caller_cfp(const rb_execution_context_t *ec, const rb_control_
return 0;
}
MJIT_STATIC void
void
rb_vm_pop_cfunc_frame(void)
{
rb_execution_context_t *ec = GET_EC();

View File

@ -1748,7 +1748,7 @@ void rb_vm_inc_const_missing_count(void);
VALUE rb_vm_call_kw(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc,
const VALUE *argv, const rb_callable_method_entry_t *me, int kw_splat);
void rb_vm_pop_frame_no_int(rb_execution_context_t *ec);
MJIT_STATIC void rb_vm_pop_frame(rb_execution_context_t *ec);
void rb_vm_pop_frame(rb_execution_context_t *ec);
void rb_thread_start_timer_thread(void);
void rb_thread_stop_timer_thread(void);
@ -1776,7 +1776,7 @@ rb_thread_t * ruby_thread_from_native(void);
int ruby_thread_set_native(rb_thread_t *th);
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp);
MJIT_STATIC VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler);
VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler);
void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg);
@ -1787,7 +1787,7 @@ void rb_gc_mark_machine_stack(const rb_execution_context_t *ec);
void rb_vm_rewrite_cref(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr);
MJIT_STATIC const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
const rb_callable_method_entry_t *rb_vm_frame_method_entry(const rb_control_frame_t *cfp);
#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]

View File

@ -46,7 +46,7 @@ static const struct rb_callcache vm_empty_cc_for_super;
static rb_control_frame_t *vm_get_ruby_level_caller_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
MJIT_STATIC VALUE
VALUE
ruby_vm_special_exception_copy(VALUE exc)
{
VALUE e = rb_obj_alloc(rb_class_real(RBASIC_CLASS(exc)));
@ -81,8 +81,8 @@ vm_stackoverflow(void)
ec_stack_overflow(GET_EC(), TRUE);
}
NORETURN(MJIT_STATIC void rb_ec_stack_overflow(rb_execution_context_t *ec, int crit));
MJIT_STATIC void
NORETURN(void rb_ec_stack_overflow(rb_execution_context_t *ec, int crit));
void
rb_ec_stack_overflow(rb_execution_context_t *ec, int crit)
{
if (rb_during_gc()) {
@ -431,7 +431,7 @@ vm_pop_frame(rb_execution_context_t *ec, rb_control_frame_t *cfp, const VALUE *e
return flags & VM_FRAME_FLAG_FINISH;
}
MJIT_STATIC void
void
rb_vm_pop_frame(rb_execution_context_t *ec)
{
vm_pop_frame(ec, ec->cfp, ec->cfp->ep);
@ -483,7 +483,7 @@ rb_arity_error_new(int argc, int min, int max)
return rb_exc_new3(rb_eArgError, err_mess);
}
MJIT_STATIC void
void
rb_error_arity(int argc, int min, int max)
{
rb_exc_raise(rb_arity_error_new(argc, min, max));
@ -515,7 +515,7 @@ vm_env_write(const VALUE *ep, int index, VALUE v)
}
}
MJIT_STATIC VALUE
VALUE
rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler)
{
if (block_handler == VM_BLOCK_HANDLER_NONE) {
@ -708,7 +708,7 @@ check_method_entry(VALUE obj, int can_be_svar)
}
}
MJIT_STATIC const rb_callable_method_entry_t *
const rb_callable_method_entry_t *
rb_vm_frame_method_entry(const rb_control_frame_t *cfp)
{
const VALUE *ep = cfp->ep;
@ -2505,7 +2505,7 @@ vm_call_iseq_setup_normal_0start(rb_execution_context_t *ec, rb_control_frame_t
return vm_call_iseq_setup_normal(ec, cfp, calling, vm_cc_cme(cc), 0, param, local);
}
MJIT_STATIC bool
bool
rb_simple_iseq_p(const rb_iseq_t *iseq)
{
return ISEQ_BODY(iseq)->param.flags.has_opt == FALSE &&
@ -3362,7 +3362,7 @@ vm_call_cfunc_with_frame_(rb_execution_context_t *ec, rb_control_frame_t *reg_cf
}
// If true, cc->call needs to include `CALLER_SETUP_ARG` (i.e. can't be skipped in fastpath)
MJIT_STATIC bool
bool
rb_splat_or_kwargs_p(const struct rb_callinfo *restrict ci)
{
return IS_ARGS_SPLAT(ci) || IS_ARGS_KW_OR_KW_SPLAT(ci);