diff options
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 46 |
1 files changed, 27 insertions, 19 deletions
@@ -135,13 +135,20 @@ union iseq_inline_storage_entry { struct rb_thread_struct; struct rb_control_frame_struct; +typedef struct rb_call_info_kw_arg_struct { + int keyword_len; + ID keywords[1]; +} rb_call_info_kw_arg_t; + /* rb_call_info_t contains calling information including inline cache */ typedef struct rb_call_info_struct { /* fixed at compile time */ ID mid; + unsigned int flag; int orig_argc; rb_iseq_t *blockiseq; + rb_call_info_kw_arg_t *kw_arg; /* inline cache: keys */ rb_serial_t method_state; @@ -240,23 +247,23 @@ struct rb_iseq_struct { * *c, # rest * d1, d2, ..., dO, # post * e1:(...), e2:(...), ..., eK:(...), # keyword - * **f, # keyword rest + * **f, # keyword_rest * &g) # block * => * - * argc = M // or 0 if no mandatory arg - * arg_opts = N+1 // or 0 if no optional arg - * arg_rest = M+N // or -1 if no rest arg - * arg_opt_table = [ (arg_opts entries) ] - * arg_post_start = M+N+(*1) // or 0 if no post arguments - * arg_post_len = O // or 0 if no post arguments - * arg_keywords = K // or 0 if no keyword arg - * arg_block = M+N+(*1)+O+K // or -1 if no block arg - * arg_keyword = M+N+(*1)+O+K+(&1) // or -1 if no keyword arg/rest - * arg_simple = 0 if not simple arguments. - * = 1 if no opt, rest, post, block. - * = 2 if ambiguous block parameter ({|a|}). - * arg_size = M+N+O+(*1)+K+(&1)+(**1) argument size. + * argc = M // or 0 if no mandatory arg + * arg_opts = N+1 // or 0 if no optional arg + * arg_rest = M+N // or -1 if no rest arg + * arg_opt_table = [ (arg_opts entries) ] + * arg_post_start = M+N+(*1) // or 0 if no post arguments + * arg_post_num = O // or 0 if no post arguments + * arg_keyword_num = K // or 0 if no keyword arg + * arg_block = M+N+(*1)+O+K // or -1 if no block arg + * arg_keyword_bits = M+N+(*1)+O+K+(&1) // or -1 if no keyword arg/rest + * arg_simple = 0 if not simple arguments. + * = 1 if no opt, rest, post, block. + * = 2 if ambiguous block parameter ({|a|}). + * arg_size = M+N+O+(*1)+K+(&1)+(**1) argument size. */ int argc; @@ -264,15 +271,16 @@ struct rb_iseq_struct { int arg_rest; int arg_block; int arg_opts; - int arg_post_len; + int arg_post_num; int arg_post_start; int arg_size; VALUE *arg_opt_table; - int arg_keyword; - int arg_keyword_check; /* if this is true, raise an ArgumentError when unknown keyword argument is passed */ - int arg_keywords; + int arg_keyword_num; + int arg_keyword_bits; + int arg_keyword_rest; int arg_keyword_required; ID *arg_keyword_table; + VALUE *arg_keyword_default_values; /* catch table */ struct iseq_catch_table *catch_table; @@ -793,7 +801,7 @@ enum vm_check_match_type { #define VM_CALL_TAILCALL (0x01 << 5) /* located at tail position */ #define VM_CALL_SUPER (0x01 << 6) /* super */ #define VM_CALL_OPT_SEND (0x01 << 7) /* internal flag */ -#define VM_CALL_ARGS_SKIP_SETUP (0x01 << 8) /* (flag & (SPLAT|BLOCKARG)) && blockiseq == 0 */ +#define VM_CALL_ARGS_SIMPLE (0x01 << 8) /* (ci->flag & (SPLAT|BLOCKARG)) && ci->blockiseq == NULL && ci->kw_arg == NULL */ enum vm_special_object_type { VM_SPECIAL_OBJECT_VMCORE = 1, |