Skip to content

Commit 9930468

Browse files
committed
YJIT: Fix --yjit-dump-insns by removing {cpush,cpop}_all() in printers
cpush_all() and cpop_all() in theory enabled these `print_*` utilities to work in more spots, but with automatically spilling in asm.ccall(), the benefits are now limited. They also have a bug at the moment. Stop using them to dodge the bug.
1 parent ac22989 commit 9930468

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

yjit/src/utils.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ pub fn print_int(asm: &mut Assembler, opnd: Opnd) {
160160
}
161161
}
162162

163-
asm.cpush_all();
164-
165163
let argument = match opnd {
166164
Opnd::Mem(_) | Opnd::Reg(_) | Opnd::InsnOut { .. } => {
167165
// Sign-extend the value if necessary
@@ -176,7 +174,6 @@ pub fn print_int(asm: &mut Assembler, opnd: Opnd) {
176174
};
177175

178176
asm.ccall(print_int_fn as *const u8, vec![argument]);
179-
asm.cpop_all();
180177
}
181178

182179
/// Generate code to print a pointer
@@ -189,9 +186,7 @@ pub fn print_ptr(asm: &mut Assembler, opnd: Opnd) {
189186

190187
assert!(opnd.rm_num_bits() == 64);
191188

192-
asm.cpush_all();
193189
asm.ccall(print_ptr_fn as *const u8, vec![opnd]);
194-
asm.cpop_all();
195190
}
196191

197192
/// Generate code to print a value
@@ -204,9 +199,7 @@ pub fn print_value(asm: &mut Assembler, opnd: Opnd) {
204199

205200
assert!(matches!(opnd, Opnd::Value(_)));
206201

207-
asm.cpush_all();
208202
asm.ccall(print_value_fn as *const u8, vec![opnd]);
209-
asm.cpop_all();
210203
}
211204

212205
/// Generate code to print constant string to stdout
@@ -221,7 +214,6 @@ pub fn print_str(asm: &mut Assembler, str: &str) {
221214
}
222215
}
223216

224-
asm.cpush_all();
225217

226218
let string_data = asm.new_label("string_data");
227219
let after_string = asm.new_label("after_string");
@@ -233,8 +225,6 @@ pub fn print_str(asm: &mut Assembler, str: &str) {
233225

234226
let opnd = asm.lea_jump_target(string_data);
235227
asm.ccall(print_str_cfun as *const u8, vec![opnd, Opnd::UImm(str.len() as u64)]);
236-
237-
asm.cpop_all();
238228
}
239229

240230
pub fn stdout_supports_colors() -> bool {

0 commit comments

Comments
 (0)