-
Notifications
You must be signed in to change notification settings - Fork 5.5k
ZJIT: Propagate and count CompileError on exits #14408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0956e53
to
22cf464
Compare
22cf464
to
7c78022
Compare
let code_ptr = match code_ptr { | ||
Ok(code_ptr) => code_ptr, | ||
Err(compile_error) => { | ||
prepare_for_exit(iseq, cfp, sp, &compile_error); | ||
ZJITState::get_exit_trampoline_with_counter() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let code_ptr = match code_ptr { | |
Ok(code_ptr) => code_ptr, | |
Err(compile_error) => { | |
prepare_for_exit(iseq, cfp, sp, &compile_error); | |
ZJITState::get_exit_trampoline_with_counter() | |
} | |
let code_ptr = code_ptr.unwrap_or_else(|compile_error| { | |
prepare_for_exit(iseq, cfp, sp, &compile_error); | |
ZJITState::get_exit_trampoline_with_counter() | |
}; |
This may be less line noise and more idiomatic
let start_ptr = match gen_iseq(cb, iseq, Some(&function)) { | ||
Ok(start_ptr) => start_ptr, | ||
Err(err) => { | ||
debug!("Failed to compile iseq: gen_iseq failed: {}", iseq_get_location(iseq, 0)); | ||
return Err(err); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let start_ptr = match gen_iseq(cb, iseq, Some(&function)) { | |
Ok(start_ptr) => start_ptr, | |
Err(err) => { | |
debug!("Failed to compile iseq: gen_iseq failed: {}", iseq_get_location(iseq, 0)); | |
return Err(err); | |
} | |
}; | |
let start_ptr = match gen_iseq(cb, iseq, Some(&function)) | |
.inspect_err(|_| { | |
debug!("Failed to compile iseq: gen_iseq failed: {}", iseq_get_location(iseq, 0)); | |
})?; |
This is supported as of 1.76.0 and is slightly more idiomatic.
Ah whoops, was a bit late on submitting my comments. |
will file a separate PR to address them, thanks! |
This PR propagates compile-error reasons all the way up and counts them at run-time instead of at compile time.
I also changed the order of
print_counters_with_prefix
sinceunhandled_yarv_insn_
isn't that important compared tocompile_error_
at the moment, and placingexit_
from the rest didn't seem useful. (past discussion)Example
On lobsters,