From 8c7cf2de98c56039820c2861d1f0ed85c0961e12 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 27 Jul 2023 17:31:12 -0700 Subject: Remove an unused argument in vm_exec_core --- vm.c | 20 ++++++++------------ vm_exec.c | 6 +++--- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/vm.c b/vm.c index cf412ddf30..4815d385e1 100644 --- a/vm.c +++ b/vm.c @@ -2297,8 +2297,7 @@ hook_before_rewind(rb_execution_context_t *ec, const rb_control_frame_t *cfp, */ static inline VALUE -vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, - VALUE errinfo, VALUE *initial); +vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, VALUE errinfo); // for non-Emscripten Wasm build, use vm_exec with optimized setjmp for runtime performance #if defined(__wasm__) && !defined(__EMSCRIPTEN__) @@ -2306,7 +2305,6 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, struct rb_vm_exec_context { rb_execution_context_t *ec; struct rb_vm_tag *tag; - VALUE initial; VALUE result; enum ruby_tag_type state; }; @@ -2321,9 +2319,9 @@ vm_exec_enter_vm_loop(rb_execution_context_t *ec, struct rb_vm_exec_context *ctx ctx->result = ec->errinfo; rb_ec_raised_reset(ec, RAISED_STACKOVERFLOW | RAISED_NOMEMORY); - while (UNDEF_P(ctx->result = vm_exec_handle_exception(ec, ctx->state, ctx->result, &ctx->initial))) { + while (UNDEF_P(ctx->result = vm_exec_handle_exception(ec, ctx->state, ctx->result))) { /* caught a jump, exec the handler */ - ctx->result = vm_exec_core(ec, ctx->initial); + ctx->result = vm_exec_core(ec); vm_loop_start: VM_ASSERT(ec->tag == _tag); /* when caught `throw`, `tag.state` is set. */ @@ -2339,7 +2337,7 @@ vm_exec_bottom_main(void *context) ctx->state = TAG_NONE; if (UNDEF_P(ctx->result = jit_exec(ctx->ec))) { - ctx->result = vm_exec_core(ctx->ec, ctx->initial); + ctx->result = vm_exec_core(ctx->ec); } vm_exec_enter_vm_loop(ctx->ec, ctx, ctx->tag, true); } @@ -2383,23 +2381,22 @@ vm_exec(rb_execution_context_t *ec) { enum ruby_tag_type state; VALUE result = Qundef; - VALUE initial = 0; EC_PUSH_TAG(ec); _tag.retval = Qnil; if ((state = EC_EXEC_TAG()) == TAG_NONE) { if (UNDEF_P(result = jit_exec(ec))) { - result = vm_exec_core(ec, initial); + result = vm_exec_core(ec); } goto vm_loop_start; /* fallback to the VM */ } else { result = ec->errinfo; rb_ec_raised_reset(ec, RAISED_STACKOVERFLOW | RAISED_NOMEMORY); - while (UNDEF_P(result = vm_exec_handle_exception(ec, state, result, &initial))) { + while (UNDEF_P(result = vm_exec_handle_exception(ec, state, result))) { /* caught a jump, exec the handler */ - result = vm_exec_core(ec, initial); + result = vm_exec_core(ec); vm_loop_start: VM_ASSERT(ec->tag == &_tag); /* when caught `throw`, `tag.state` is set. */ @@ -2413,8 +2410,7 @@ vm_exec(rb_execution_context_t *ec) #endif static inline VALUE -vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, - VALUE errinfo, VALUE *initial) +vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, VALUE errinfo) { struct vm_throw_data *err = (struct vm_throw_data *)errinfo; diff --git a/vm_exec.c b/vm_exec.c index 0d892c7d7d..947d4dc421 100644 --- a/vm_exec.c +++ b/vm_exec.c @@ -42,7 +42,7 @@ static void vm_analysis_insn(int insn); #if !OPT_CALL_THREADED_CODE static VALUE -vm_exec_core(rb_execution_context_t *ec, VALUE initial) +vm_exec_core(rb_execution_context_t *ec) { #if defined(__GNUC__) && defined(__i386__) DECL_SC_REG(const VALUE *, pc, "di"); @@ -112,7 +112,7 @@ vm_exec_core(rb_execution_context_t *ec, VALUE initial) const void ** rb_vm_get_insns_address_table(void) { - return (const void **)vm_exec_core(0, 0); + return (const void **)vm_exec_core(0); } #else /* OPT_CALL_THREADED_CODE */ @@ -127,7 +127,7 @@ rb_vm_get_insns_address_table(void) } static VALUE -vm_exec_core(rb_execution_context_t *ec, VALUE initial) +vm_exec_core(rb_execution_context_t *ec) { register rb_control_frame_t *reg_cfp = ec->cfp; rb_thread_t *th; -- cgit v1.2.3