зеркало из https://github.com/github/ruby.git
Refactor so we don't have _cd
This should make the diff more clean
This commit is contained in:
Родитель
cc97a27008
Коммит
a661c82972
19
insns.def
19
insns.def
|
@ -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)) {
|
||||
|
|
15
vm_args.c
15
vm_args.c
|
@ -1062,10 +1062,10 @@ static void vm_adjust_stack_forwarding(const struct rb_execution_context_struct
|
|||
|
||||
static VALUE
|
||||
vm_caller_setup_fwd_args(const rb_execution_context_t *ec, rb_control_frame_t *reg_cfp,
|
||||
CALL_DATA *cd, const rb_iseq_t *blockiseq, const int is_super,
|
||||
CALL_DATA cd, const rb_iseq_t *blockiseq, const int is_super,
|
||||
struct rb_forwarding_call_data *adjusted_cd, struct rb_callinfo *adjusted_ci)
|
||||
{
|
||||
CALL_INFO site_ci = (*cd)->ci;
|
||||
CALL_INFO site_ci = cd->ci;
|
||||
VALUE bh = Qundef;
|
||||
|
||||
RUBY_ASSERT(ISEQ_BODY(ISEQ_BODY(GET_ISEQ())->local_iseq)->param.flags.forwardable);
|
||||
|
@ -1098,17 +1098,8 @@ vm_caller_setup_fwd_args(const rb_execution_context_t *ec, rb_control_frame_t *r
|
|||
);
|
||||
|
||||
adjusted_cd->cd.ci = adjusted_ci;
|
||||
adjusted_cd->cd.cc = (*cd)->cc;
|
||||
adjusted_cd->cd.cc = cd->cc;
|
||||
adjusted_cd->caller_ci = caller_ci;
|
||||
|
||||
*cd = &adjusted_cd->cd;
|
||||
|
||||
return bh;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
vm_caller_setup_args(const rb_execution_context_t *ec, rb_control_frame_t *reg_cfp,
|
||||
CALL_DATA *cd, const rb_iseq_t *blockiseq, const int is_super)
|
||||
{
|
||||
return vm_caller_setup_arg_block(ec, GET_CFP(), (*cd)->ci, blockiseq, is_super);
|
||||
}
|
||||
|
|
|
@ -5927,23 +5927,22 @@ rb_vm_send(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, CALL_DATA cd
|
|||
|
||||
struct rb_forwarding_call_data adjusted_cd;
|
||||
struct rb_callinfo adjusted_ci;
|
||||
CALL_DATA _cd = cd;
|
||||
|
||||
VALUE bh;
|
||||
VALUE val;
|
||||
|
||||
if (vm_ci_flag(_cd->ci) & VM_CALL_FORWARDING) {
|
||||
bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), &cd, blockiseq, false, &adjusted_cd, &adjusted_ci);
|
||||
if (vm_ci_flag(cd->ci) & VM_CALL_FORWARDING) {
|
||||
bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, false, &adjusted_cd, &adjusted_ci);
|
||||
|
||||
val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_method);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
bh = vm_caller_setup_args(ec, GET_CFP(), &cd, blockiseq, false);
|
||||
}
|
||||
|
||||
VALUE val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);
|
||||
|
||||
if (vm_ci_flag(_cd->ci) & VM_CALL_FORWARDING) {
|
||||
if (_cd->cc != cd->cc && vm_cc_markable(cd->cc)) {
|
||||
RB_OBJ_WRITE(GET_ISEQ(), &_cd->cc, cd->cc);
|
||||
}
|
||||
bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, false);
|
||||
val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_method);
|
||||
}
|
||||
|
||||
VM_EXEC(ec, val);
|
||||
|
@ -5966,23 +5965,22 @@ rb_vm_invokesuper(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, CALL_
|
|||
stack_check(ec);
|
||||
struct rb_forwarding_call_data adjusted_cd;
|
||||
struct rb_callinfo adjusted_ci;
|
||||
CALL_DATA _cd = cd;
|
||||
|
||||
VALUE bh;
|
||||
VALUE val;
|
||||
|
||||
if (vm_ci_flag(_cd->ci) & VM_CALL_FORWARDING) {
|
||||
bh = vm_caller_setup_fwd_args(ec, GET_CFP(), &cd, blockiseq, true, &adjusted_cd, &adjusted_ci);
|
||||
if (vm_ci_flag(cd->ci) & VM_CALL_FORWARDING) {
|
||||
bh = vm_caller_setup_fwd_args(GET_EC(), GET_CFP(), cd, blockiseq, true, &adjusted_cd, &adjusted_ci);
|
||||
|
||||
val = vm_sendish(ec, GET_CFP(), &adjusted_cd.cd, bh, mexp_search_super);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
else {
|
||||
bh = vm_caller_setup_args(ec, GET_CFP(), &cd, blockiseq, true);
|
||||
}
|
||||
|
||||
VALUE val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super);
|
||||
|
||||
if (vm_ci_flag(_cd->ci) & VM_CALL_FORWARDING) {
|
||||
if (_cd->cc != cd->cc && vm_cc_markable(cd->cc)) {
|
||||
RB_OBJ_WRITE(GET_ISEQ(), &_cd->cc, cd->cc);
|
||||
}
|
||||
bh = vm_caller_setup_arg_block(ec, GET_CFP(), cd->ci, blockiseq, true);
|
||||
val = vm_sendish(ec, GET_CFP(), cd, bh, mexp_search_super);
|
||||
}
|
||||
|
||||
VM_EXEC(ec, val);
|
||||
|
|
Загрузка…
Ссылка в новой задаче