summaryrefslogtreecommitdiff
path: root/ujit_codegen.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-02-18 11:54:37 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:29 -0400
commitfaabe2b0ad0917ac5cf88c2683c22c533ad6ddb9 (patch)
tree1ee2266b98ac118d68b86ce0e79447e3fac0bf20 /ujit_codegen.c
parent15b088bd6ed2c0b2116d5608fef6afc3b0b04940 (diff)
downloadruby-faabe2b0ad0917ac5cf88c2683c22c533ad6ddb9.tar.gz
Ujit bug fixes
* uJIT: don't compile tailcalls * Don't compile calls to protected methods We need to generate extra code to check whether the call goes through if we want to support these. * Fix copy pasta * Update blockids in branches * Update dependencies
Diffstat (limited to 'ujit_codegen.c')
-rw-r--r--ujit_codegen.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ujit_codegen.c b/ujit_codegen.c
index 6ab1ee1c9b..b6d5f5fbce 100644
--- a/ujit_codegen.c
+++ b/ujit_codegen.c
@@ -1277,6 +1277,11 @@ gen_opt_swb_iseq(jitstate_t* jit, ctx_t* ctx, struct rb_call_data * cd, const rb
return false;
}
+ if (vm_ci_flag(cd->ci) & VM_CALL_TAILCALL) {
+ // We can't handle tailcalls
+ return false;
+ }
+
rb_gc_register_mark_object((VALUE)iseq); // FIXME: intentional LEAK!
// Create a size-exit to fall back to the interpreter
@@ -1464,6 +1469,11 @@ gen_opt_send_without_block(jitstate_t* jit, ctx_t* ctx)
return false;
}
+ // We don't generate code to check protected method calls
+ if (METHOD_ENTRY_VISI(cme) == METHOD_VISI_PROTECTED) {
+ return false;
+ }
+
// If this is a C call
if (cme->def->type == VM_METHOD_TYPE_CFUNC)
{