aboutsummaryrefslogtreecommitdiffstats
path: root/mjit_compile.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2020-06-20 17:13:03 -0700
committerGitHub <noreply@github.com>2020-06-20 17:13:03 -0700
commit7561db8c009bb79a75024fa4ed0350bfb3d0626c (patch)
treee11e51b98e795e09d51b3062d7f71987d7225187 /mjit_compile.c
parentd95249ade34626dc3ae82f8bfc84e1668b1b8d01 (diff)
downloadruby-7561db8c009bb79a75024fa4ed0350bfb3d0626c.tar.gz
Introduce Primitive.attr! to annotate 'inline' (#3242)
[Feature #15589]
Diffstat (limited to 'mjit_compile.c')
-rw-r--r--mjit_compile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mjit_compile.c b/mjit_compile.c
index fe5c2413e4..c4c31aa251 100644
--- a/mjit_compile.c
+++ b/mjit_compile.c
@@ -374,7 +374,12 @@ inlinable_iseq_p(const struct rb_iseq_constant_body *body)
// * Do not require `cfp->sp` motion
// * Do not move `cfp->pc`
// * Do not read any `cfp->pc`
- if (insn != BIN(leave) && insn_may_depend_on_sp_or_pc(insn, body->iseq_encoded + (pos + 1)))
+ if (insn == BIN(invokebuiltin) || insn == BIN(opt_invokebuiltin_delegate) || insn == BIN(opt_invokebuiltin_delegate_leave)) {
+ // builtin insn's inlinability is handled by `Primitive.attr! 'inline'` per iseq
+ if (!body->builtin_inline_p)
+ return false;
+ }
+ else if (insn != BIN(leave) && insn_may_depend_on_sp_or_pc(insn, body->iseq_encoded + (pos + 1)))
return false;
// At this moment, `cfp->ep` in an inlined method is not working.
switch (insn) {