mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Collapse if
conditions to decrease indentation
in mjit_compile_send to clarify it's not that deeply branched.
This commit is contained in:
parent
a7e7000387
commit
f984975c4d
1 changed files with 63 additions and 65 deletions
|
@ -16,21 +16,20 @@
|
||||||
% # compiler: Use copied cc to avoid race condition
|
% # compiler: Use copied cc to avoid race condition
|
||||||
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
const struct rb_callcache *captured_cc = captured_cc_entries(status)[call_data_index(cd, body)];
|
||||||
%
|
%
|
||||||
if (!status->compile_info->disable_send_cache && has_valid_method_type(captured_cc)) {
|
|
||||||
const rb_iseq_t *iseq;
|
const rb_iseq_t *iseq;
|
||||||
const CALL_INFO ci = cd->ci;
|
const CALL_INFO ci = cd->ci;
|
||||||
|
if (!status->compile_info->disable_send_cache && has_valid_method_type(captured_cc)
|
||||||
|
// CC_SET_FASTPATH in vm_callee_setup_arg
|
||||||
|
&& !(vm_ci_flag(ci) & VM_CALL_TAILCALL) // inlining non-tailcall path
|
||||||
|
&& vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_ISEQ
|
||||||
|
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))) {
|
||||||
|
|
||||||
|
int param_size = iseq->body->param.size;
|
||||||
unsigned int argc = vm_ci_argc(ci); // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
unsigned int argc = vm_ci_argc(ci); // this `argc` variable is for calculating a value's position on stack considering `blockarg`.
|
||||||
% if insn.name == 'send'
|
% if insn.name == 'send'
|
||||||
argc += ((vm_ci_flag(ci) & VM_CALL_ARGS_BLOCKARG) ? 1 : 0); // simulate `vm_caller_setup_arg_block`'s `--reg_cfp->sp`
|
argc += ((vm_ci_flag(ci) & VM_CALL_ARGS_BLOCKARG) ? 1 : 0); // simulate `vm_caller_setup_arg_block`'s `--reg_cfp->sp`
|
||||||
% end
|
% end
|
||||||
|
|
||||||
if (!(vm_ci_flag(ci) & VM_CALL_TAILCALL) // inlining non-tailcall path
|
|
||||||
&& vm_cc_cme(captured_cc)->def->type == VM_METHOD_TYPE_ISEQ
|
|
||||||
&& fastpath_applied_iseq_p(ci, captured_cc, iseq = def_iseq_ptr(vm_cc_cme(captured_cc)->def))) {
|
|
||||||
// CC_SET_FASTPATH in vm_callee_setup_arg
|
|
||||||
|
|
||||||
int param_size = iseq->body->param.size;
|
|
||||||
|
|
||||||
fprintf(f, "{\n");
|
fprintf(f, "{\n");
|
||||||
% # JIT: Declare stack_size to be used in some macro of _mjit_compile_insn_body.erb
|
% # JIT: Declare stack_size to be used in some macro of _mjit_compile_insn_body.erb
|
||||||
if (status->local_stack_p) {
|
if (status->local_stack_p) {
|
||||||
|
@ -107,5 +106,4 @@
|
||||||
fprintf(f, "}\n");
|
fprintf(f, "}\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue