diff options
author | Alan Wu <[email protected]> | 2021-06-23 20:28:42 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2021-10-20 18:19:36 -0400 |
commit | 3996e0ab07d06b7685eecd56a542e9672702dee2 (patch) | |
tree | d659767dc3ce523b4bfae0fa23a8b95e0a4e9513 /yjit_codegen.c | |
parent | 6883aeda77c09c4982080f968491eacbc43a47e1 (diff) |
Add tests, comments, and an assert for invokesuper
Diffstat (limited to 'yjit_codegen.c')
-rw-r--r-- | yjit_codegen.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/yjit_codegen.c b/yjit_codegen.c index 68fadfc820..d61206c2c1 100644 --- a/yjit_codegen.c +++ b/yjit_codegen.c @@ -2995,7 +2995,8 @@ gen_send(jitstate_t *jit, ctx_t *ctx) return gen_send_general(jit, ctx, cd, block); } -RBIMPL_ATTR_MAYBE_UNUSED() // not in use as it has problems in some situations. +// Not in use as it's incorrect in some situations. See comments. +RBIMPL_ATTR_MAYBE_UNUSED() static codegen_status_t gen_invokesuper(jitstate_t *jit, ctx_t *ctx) { @@ -3096,6 +3097,9 @@ gen_invokesuper(jitstate_t *jit, ctx_t *ctx) insn_opnd_t recv_opnd = OPND_STACK(argc); mov(cb, REG0, recv); + // FIXME: This guard and the assume_method_lookup_stable() call below isn't + // always enough to correctly replicate the interpreter's behavior of + // searching at runtime for the callee through the method entry of the stack frame. if (!jit_guard_known_klass(jit, ctx, comptime_recv_klass, recv_opnd, comptime_recv, SEND_MAX_DEPTH, side_exit)) { return YJIT_CANT_COMPILE; } |