2023-03-06 23:15:30 -08:00
|
|
|
module RubyVM::RJIT
|
2023-02-10 11:43:53 -08:00
|
|
|
module Hooks # :nodoc: all
|
|
|
|
def self.on_bop_redefined(_redefined_flag, _bop)
|
2023-03-06 23:17:25 -08:00
|
|
|
# C.rjit_cancel_all("BOP is redefined")
|
2023-02-10 11:43:53 -08:00
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
|
2023-02-10 11:43:53 -08:00
|
|
|
def self.on_cme_invalidate(cme)
|
2023-02-18 14:45:17 -08:00
|
|
|
cme = C.rb_callable_method_entry_struct.new(cme)
|
2023-02-10 11:43:53 -08:00
|
|
|
Invariants.on_cme_invalidate(cme)
|
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
|
2023-02-10 11:43:53 -08:00
|
|
|
def self.on_ractor_spawn
|
2023-03-06 23:17:25 -08:00
|
|
|
# C.rjit_cancel_all("Ractor is spawned")
|
2023-02-10 11:43:53 -08:00
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
|
2023-03-01 21:32:36 -08:00
|
|
|
# Global constant changes like const_set
|
|
|
|
def self.on_constant_state_changed(id)
|
|
|
|
Invariants.on_constant_state_changed(id)
|
2023-02-10 11:43:53 -08:00
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
|
2023-03-01 21:32:36 -08:00
|
|
|
# ISEQ-specific constant invalidation
|
2023-02-18 14:45:17 -08:00
|
|
|
def self.on_constant_ic_update(iseq, ic, insn_idx)
|
|
|
|
iseq = C.rb_iseq_t.new(iseq)
|
|
|
|
ic = C.IC.new(ic)
|
|
|
|
Invariants.on_constant_ic_update(iseq, ic, insn_idx)
|
2023-02-10 11:43:53 -08:00
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
|
2023-02-10 11:43:53 -08:00
|
|
|
def self.on_tracing_invalidate_all(_new_iseq_events)
|
|
|
|
Invariants.on_tracing_invalidate_all
|
|
|
|
end
|
2023-02-24 13:19:42 -08:00
|
|
|
|
|
|
|
def self.on_update_references
|
|
|
|
Invariants.on_update_references
|
|
|
|
end
|
2023-02-03 22:42:13 -08:00
|
|
|
end
|
|
|
|
end
|