From f2286925f08406bc857f7b03ad6779a5d61443ae Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Wed, 8 Jan 2020 08:20:36 +0900 Subject: VALUE size packed callinfo (ci). Now, rb_call_info contains how to call the method with tuple of (mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and mid+argc+flags only requires 64bits. So this patch packed rb_call_info to VALUE (1 word) on such cases. If we can not represent it in VALUE, then use imemo_callinfo which contains conventional callinfo (rb_callinfo, renamed from rb_call_info). iseq->body->ci_kw_size is removed because all of callinfo is VALUE size (packed ci or a pointer to imemo_callinfo). To access ci information, we need to use these functions: vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci). struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg. rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc() is temporary removed because cd->ci should be marked. --- internal/vm.h | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'internal/vm.h') diff --git a/internal/vm.h b/internal/vm.h index c5986a1c24..4bd2bfb1e3 100644 --- a/internal/vm.h +++ b/internal/vm.h @@ -85,16 +85,9 @@ struct rb_call_cache { }; STATIC_ASSERT(cachelined, sizeof(struct rb_call_cache) <= CACHELINE); -struct rb_call_info { - /* fixed at compile time */ - ID mid; - unsigned int flag; - int orig_argc; -}; - struct rb_call_data { + const struct rb_callinfo *ci; struct rb_call_cache cc; - struct rb_call_info ci; }; /* vm_insnhelper.h */ @@ -150,12 +143,6 @@ MJIT_SYMBOL_EXPORT_BEGIN void rb_vm_search_method_slowpath(struct rb_call_data *cd, VALUE klass); MJIT_SYMBOL_EXPORT_END -RUBY_SYMBOL_EXPORT_BEGIN -/* vm_method.c */ -RUBY_FUNC_NONNULL(1, VALUE rb_funcallv_with_cc(struct rb_call_data*, VALUE, ID, int, const VALUE*)); -RUBY_FUNC_NONNULL(1, bool rb_method_basic_definition_p_with_cc(struct rb_call_data *, VALUE, ID)); -RUBY_SYMBOL_EXPORT_END - /* vm_dump.c */ void rb_print_backtrace(void); @@ -174,20 +161,6 @@ VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec); void rb_backtrace_use_iseq_first_lineno_for_last_location(VALUE self); MJIT_SYMBOL_EXPORT_END -#ifdef __GNUC__ -# define rb_funcallv(recv, mid, argc, argv) \ - __extension__({ \ - static struct rb_call_data rb_funcallv_data; \ - rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \ - }) -# define rb_method_basic_definition_p(klass, mid) \ - __extension__({ \ - static struct rb_call_data rb_mbdp; \ - (klass == Qfalse) ? /* hidden object cannot be overridden */ true : \ - rb_method_basic_definition_p_with_cc(&rb_mbdp, klass, mid); \ - }) -#endif - #define RUBY_DTRACE_CREATE_HOOK(name, arg) \ RUBY_DTRACE_HOOK(name##_CREATE, arg) #define RUBY_DTRACE_HOOK(name, arg) \ -- cgit v1.2.1