mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
TracePoint support
This change fixes some cases where YJIT fails to fire tracing events. Most of the situations YJIT did not handle correctly involves enabling tracing while running inside generated code. A new operation to invalidate all generated code is added, which uses patching to make generated code exit at the next VM instruction boundary. A new routine called `jit_prepare_routine_call()` is introduced to facilitate this and should be used when generating code that could allocate, or could otherwise use `RB_VM_LOCK_ENTER()`. The `c_return` event is fired in the middle of an instruction as opposed to at an instruction boundary, so it requires special handling. C method call return points are patched to go to a fucntion which does everything the interpreter does, including firing the `c_return` event. The generated code for C method calls normally does not fire the event. Invalided code should not change after patching so the exits are not clobbered. A new variable is introduced to track the region of code that should not change.
This commit is contained in:
parent
0562459473
commit
bd876c243a
11 changed files with 550 additions and 84 deletions
1
yjit.h
1
yjit.h
|
@ -73,5 +73,6 @@ void rb_yjit_iseq_update_references(const struct rb_iseq_constant_body *body);
|
|||
void rb_yjit_iseq_free(const struct rb_iseq_constant_body *body);
|
||||
void rb_yjit_before_ractor_spawn(void);
|
||||
void yjit_constant_ic_update(const rb_iseq_t *iseq, IC ic);
|
||||
void yjit_tracing_invalidate_all(void);
|
||||
|
||||
#endif // #ifndef YJIT_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue