YJIT: add asm comment when we clear local types (#9713)

Small PR to add a comment when we clear local variable types,
so we can be aware that it's happening when looking at the disasm.
This commit is contained in:
Maxime Chevalier-Boisvert 2024-01-29 10:36:34 -05:00 committed by GitHub
parent fde3d065e6
commit adf29c9a98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 5 deletions

View File

@ -1173,6 +1173,13 @@ impl Assembler
}
}
/// Erase local variable type information
/// eg: because of a call we can't track
pub fn clear_local_types(&mut self) {
asm_comment!(self, "clear local variable types");
self.ctx.clear_local_types();
}
/// Spill all live stack temps from registers to the stack
pub fn spill_temps(&mut self) {
// Forget registers above the stack top

View File

@ -356,7 +356,7 @@ fn jit_prepare_routine_call(
// In case the routine calls Ruby methods, it can set local variables
// through Kernel#binding and other means.
asm.ctx.clear_local_types();
asm.clear_local_types();
}
/// Record the current codeblock write position for rewriting into a jump into
@ -5892,7 +5892,7 @@ fn gen_send_cfunc(
asm.store(ec_cfp_opnd, CFP);
// cfunc calls may corrupt types
asm.ctx.clear_local_types();
asm.clear_local_types();
// Note: the return block of gen_send_iseq() has ctx->sp_offset == 1
// which allows for sharing the same successor.
@ -6951,7 +6951,7 @@ fn gen_send_iseq(
callee_ctx.upgrade_opnd_type(SelfOpnd, recv_type);
// The callee might change locals through Kernel#binding and other means.
asm.ctx.clear_local_types();
asm.clear_local_types();
// Pop arguments and receiver in return context and
// mark it as a continuation of gen_leave()
@ -8012,7 +8012,7 @@ fn gen_invokeblock_specialized(
asm.mov(stack_ret, ret);
// cfunc calls may corrupt types
asm.ctx.clear_local_types();
asm.clear_local_types();
// Share the successor with other chains
jump_to_next_insn(jit, asm, ocb);
@ -8170,7 +8170,7 @@ fn gen_invokesuper_specialized(
jit.assume_method_lookup_stable(asm, ocb, cme);
// Method calls may corrupt types
asm.ctx.clear_local_types();
asm.clear_local_types();
match cme_def_type {
VM_METHOD_TYPE_ISEQ => {