Skip to content

Commit

Permalink
Remove VM_NO_KEYWORDS, replace with RB_NO_KEYWORDS
Browse files Browse the repository at this point in the history
VM_NO_KEYWORDS was introduced first in vm_core.h, but it is best
to only use a single definition for this.
  • Loading branch information
jeremyevans committed Sep 29, 2019
1 parent 58dfea0 commit 6fdd701
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions proc.c
Expand Up @@ -960,7 +960,7 @@ rb_proc_call(VALUE self, VALUE args)
GetProcPtr(self, proc);
vret = rb_vm_invoke_proc(GET_EC(), proc,
check_argc(RARRAY_LEN(args)), RARRAY_CONST_PTR(args),
VM_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE);
RB_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE);
RB_GC_GUARD(self);
RB_GC_GUARD(args);
return vret;
Expand Down Expand Up @@ -993,7 +993,7 @@ rb_proc_call_with_block(VALUE self, int argc, const VALUE *argv, VALUE passed_pr
VALUE vret;
rb_proc_t *proc;
GetProcPtr(self, proc);
vret = rb_vm_invoke_proc(ec, proc, argc, argv, VM_NO_KEYWORDS, proc_to_block_handler(passed_procval));
vret = rb_vm_invoke_proc(ec, proc, argc, argv, RB_NO_KEYWORDS, proc_to_block_handler(passed_procval));
RB_GC_GUARD(self);
return vret;
}
Expand Down
2 changes: 1 addition & 1 deletion vm.c
Expand Up @@ -1191,7 +1191,7 @@ static VALUE
vm_yield_force_blockarg(rb_execution_context_t *ec, VALUE args)
{
return invoke_block_from_c_bh(ec, check_block_handler(ec), 1, &args,
VM_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE, NULL, FALSE, TRUE);
RB_NO_KEYWORDS, VM_BLOCK_HANDLER_NONE, NULL, FALSE, TRUE);
}

ALWAYS_INLINE(static VALUE
Expand Down
2 changes: 1 addition & 1 deletion vm_args.c
Expand Up @@ -1064,7 +1064,7 @@ vm_to_proc(VALUE proc)
rb_callable_method_entry_with_refinements(CLASS_OF(proc), idTo_proc, NULL);

if (me) {
b = rb_vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me, VM_NO_KEYWORDS);
b = rb_vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me, RB_NO_KEYWORDS);
}
else {
/* NOTE: calling method_missing */
Expand Down
1 change: 0 additions & 1 deletion vm_core.h
Expand Up @@ -1281,7 +1281,6 @@ VM_FRAME_RUBYFRAME_P(const rb_control_frame_t *cfp)

#define VM_GUARDED_PREV_EP(ep) GC_GUARDED_PTR(ep)
#define VM_BLOCK_HANDLER_NONE 0
#define VM_NO_KEYWORDS 0

static inline int
VM_ENV_LOCAL_P(const VALUE *ep)
Expand Down
6 changes: 3 additions & 3 deletions vm_eval.c
Expand Up @@ -267,7 +267,7 @@ rb_adjust_argv_kw_splat(int *argc, const VALUE **argv, int *kw_splat)
VALUE
rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me)
{
return rb_vm_call0(ec, recv, id, argc, argv, me, VM_NO_KEYWORDS);
return rb_vm_call0(ec, recv, id, argc, argv, me, RB_NO_KEYWORDS);
}

MJIT_FUNC_EXPORTED VALUE
Expand Down Expand Up @@ -371,7 +371,7 @@ rb_call0(rb_execution_context_t *ec,
const rb_callable_method_entry_t *me;
enum method_missing_reason call_status;
call_type scope = call_scope;
int kw_splat = VM_NO_KEYWORDS;
int kw_splat = RB_NO_KEYWORDS;

switch(scope) {
case(CALL_PUBLIC_KW):
Expand Down Expand Up @@ -1012,7 +1012,7 @@ rb_funcallv_with_cc(struct rb_call_cache_and_mid *cc, VALUE recv, ID mid, int ar
Qundef,
recv,
argc,
VM_NO_KEYWORDS,
RB_NO_KEYWORDS,
},
&ci,
&cc->cc,
Expand Down
2 changes: 1 addition & 1 deletion vm_insnhelper.c
Expand Up @@ -1625,7 +1625,7 @@ check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_che
const rb_callable_method_entry_t *me =
rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL);
if (me) {
return rb_vm_call0(ec, pattern, idEqq, 1, &target, me, VM_NO_KEYWORDS);
return rb_vm_call0(ec, pattern, idEqq, 1, &target, me, RB_NO_KEYWORDS);
}
else {
/* fallback to funcall (e.g. method_missing) */
Expand Down

0 comments on commit 6fdd701

Please sign in to comment.