diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 16:57:59 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 16:57:59 +0000 |
commit | 35f1b8f54660cb0c022bc742c406cab46380c31a (patch) | |
tree | c22faf6e6b0aa924fd421b95a38460d793b52491 /tool/ruby_vm/views | |
parent | 46697c7e26472e39dbe963ebc33924a37e81d026 (diff) |
_mjit_compile_send.erb: simplify control flow
to introduce additional optimization for another `cc->me->def->type`
later. I carved out the `cc->me->def->type == VM_METHOD_TYPE_ISEQ`
part because I wanted to check other types as well.
mjit_compile.c: drop get_iseq_if_available and define simplified version
of it, has_valid_method_type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm/views')
-rw-r--r-- | tool/ruby_vm/views/_mjit_compile_send.erb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tool/ruby_vm/views/_mjit_compile_send.erb b/tool/ruby_vm/views/_mjit_compile_send.erb index 5b32ac42db..d26224c084 100644 --- a/tool/ruby_vm/views/_mjit_compile_send.erb +++ b/tool/ruby_vm/views/_mjit_compile_send.erb @@ -7,19 +7,20 @@ % # details. % % # Optimized case of send / opt_send_without_block instructions. - { +{ % # compiler: Prepare operands which may be used by `insn.call_attribute` % insn.opes.each_with_index do |ope, i| - MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>]; + MAYBE_UNUSED(<%= ope.fetch(:decl) %>) = (<%= ope.fetch(:type) %>)operands[<%= i %>]; % end % + if (has_valid_method_type(cc)) { const rb_iseq_t *iseq; unsigned int argc = ci->orig_argc; /* unlike `ci->orig_argc`, `argc` may include blockarg */ % if insn.name == 'send' argc += ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0); % end - if (inlinable_iseq_p(ci, cc, iseq = get_iseq_if_available(cc))) { + if (cc->me->def->type == VM_METHOD_TYPE_ISEQ && inlinable_iseq_p(ci, cc, iseq = rb_iseq_check(cc->me->def->body.iseq.iseqptr))) { int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */ fprintf(f, "{\n"); @@ -88,3 +89,4 @@ break; } } +} |