diff options
author | Takashi Kokubun <[email protected]> | 2023-03-06 23:17:25 -0800 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2023-03-06 23:44:01 -0800 |
commit | 23ec248e48f696ae986e2b19cd572ece02a5ba55 () | |
tree | 3973e15ea1c34d000b40a64bd64e78880f28efec /lib/ruby_vm/rjit/compiler.rb | |
parent | 2e875549a934fa04b7939810fa0d8a2762702aaa (diff) |
s/mjit/rjit/
Notes: Merged: https://.com/ruby/ruby/pull/7462
-rw-r--r-- | lib/ruby_vm/rjit/compiler.rb | 44 |
1 files changed, 22 insertions, 22 deletions
@@ -1,13 +1,13 @@ -require 'ruby_vm/mjit/assembler' -require 'ruby_vm/mjit/block' -require 'ruby_vm/mjit/branch_stub' -require 'ruby_vm/mjit/code_block' -require 'ruby_vm/mjit/context' -require 'ruby_vm/mjit/exit_compiler' -require 'ruby_vm/mjit/insn_compiler' -require 'ruby_vm/mjit/instruction' -require 'ruby_vm/mjit/invariants' -require 'ruby_vm/mjit/jit_state' module RubyVM::RJIT # Compilation status @@ -266,45 +266,45 @@ module RubyVM::RJIT end def incr_counter(name) - if C.mjit_opts.stats - C.rb_mjit_counters[name][0] += 1 end end def list_blocks(iseq, pc) - mjit_blocks(iseq)[pc].values end # @param [Integer] pc # @param [RubyVM::RJIT::Context] ctx # @return [RubyVM::RJIT::Block,NilClass] def find_block(iseq, pc, ctx) - mjit_blocks(iseq)[pc][ctx] end # @param [RubyVM::RJIT::Block] block def set_block(iseq, block) - mjit_blocks(iseq)[block.pc][block.ctx] = block end # @param [RubyVM::RJIT::Block] block def remove_block(iseq, block) - mjit_blocks(iseq)[block.pc].delete(block.ctx) end - def mjit_blocks(iseq) # Guard against ISEQ GC at random moments if C.imemo_type(iseq) != C.imemo_iseq return Hash.new { |h, k| h[k] = {} } end - unless iseq.body.mjit_blocks - iseq.body.mjit_blocks = Hash.new { |h, k| h[k] = {} } - # For some reason, rb_mjit_iseq_mark didn't protect this Hash # from being freed. So we rely on GC_REFS to keep the Hash. - GC_REFS << iseq.body.mjit_blocks end - iseq.body.mjit_blocks end end end |