summaryrefslogtreecommitdiff
path: root/mjit_compile.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-19 16:57:59 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-04-19 16:57:59 +0000
commit35f1b8f54660cb0c022bc742c406cab46380c31a (patch)
treec22faf6e6b0aa924fd421b95a38460d793b52491 /mjit_compile.c
parent46697c7e26472e39dbe963ebc33924a37e81d026 (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 'mjit_compile.c')
-rw-r--r--mjit_compile.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index 014a2e8927..7913e6836b 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -39,16 +39,12 @@ struct case_dispatch_var {
VALUE last_value;
};
-/* Returns iseq from cc if it's available and still not obsoleted. */
-static const rb_iseq_t *
-get_iseq_if_available(CALL_CACHE cc)
+/* Returns TRUE if call cache is still not obsoleted and cc->me->def->type is available. */
+static int
+has_valid_method_type(CALL_CACHE cc)
{
- if (GET_GLOBAL_METHOD_STATE() == cc->method_state
- && mjit_valid_class_serial_p(cc->class_serial)
- && cc->me && cc->me->def->type == VM_METHOD_TYPE_ISEQ) {
- return rb_iseq_check(cc->me->def->body.iseq.iseqptr);
- }
- return NULL;
+ return GET_GLOBAL_METHOD_STATE() == cc->method_state
+ && mjit_valid_class_serial_p(cc->class_serial) && cc->me;
}
/* Returns TRUE if iseq is inlinable, otherwise NULL. This becomes TRUE in the same condition