Refactor so we don't have _cd

This should make the diff more clean
This commit is contained in:
Aaron Patterson 2024-06-03 15:48:13 -07:00 committed by Aaron Patterson
parent cc97a27008
commit a661c82972
3 changed files with 33 additions and 47 deletions

View file

@ -889,15 +889,13 @@ sendforward
struct rb_forwarding_call_data adjusted_cd;
struct rb_callinfo adjusted_ci;
CALL_DATA _cd = cd;
VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, 0, &adjusted_cd, &adjusted_ci);
VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), &cd, blockiseq, 0, &adjusted_cd, &adjusted_ci);
val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);
val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_method);
JIT_EXEC(ec, val);
if (_cd->cc != cd->cc && vm_cc_markable(cd->cc)) {
RB_OBJ_WRITE(GET_ISEQ(), &_cd->cc, cd->cc);
if (cd->cc != adjusted_cd.cd.cc && vm_cc_markable(adjusted_cd.cd.cc)) {
RB_OBJ_WRITE(GET_ISEQ(), &cd->cc, adjusted_cd.cd.cc);
}
if (UNDEF_P(val)) {
@ -1042,17 +1040,16 @@ invokesuperforward
// attr rb_snum_t sp_inc = sp_inc_of_sendish(cd->ci);
// attr rb_snum_t comptime_sp_inc = sp_inc_of_sendish(ci);
{
CALL_DATA _cd = cd;
struct rb_forwarding_call_data adjusted_cd;
struct rb_callinfo adjusted_ci;
VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), &cd, blockiseq, 1, &adjusted_cd, &adjusted_ci);
VALUE bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, 1, &adjusted_cd, &adjusted_ci);
val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super);
val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_super);
JIT_EXEC(ec, val);
if (_cd->cc != cd->cc && vm_cc_markable(cd->cc)) {
RB_OBJ_WRITE(GET_ISEQ(), &_cd->cc, cd->cc);
if (cd->cc != adjusted_cd.cd.cc && vm_cc_markable(adjusted_cd.cd.cc)) {
RB_OBJ_WRITE(GET_ISEQ(), &cd->cc, adjusted_cd.cd.cc);
}
if (UNDEF_P(val)) {