Module: DeepCover::InstructionSequenceLoadIseq

Defined in:
lib/deep_cover/core_ext/instruction_sequence_load_iseq.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load_iseq_logic(path) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/deep_cover/core_ext/instruction_sequence_load_iseq.rb', line 18

def self.load_iseq_logic(path)
  return unless DeepCover.running?
  return unless DeepCover.within_lookup_paths?(path)

  covered_code = DeepCover.coverage.covered_code_or_warn(path)
  return unless covered_code

  covered_code.compile_or_warn
end

Instance Method Details

#load_iseq(path) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/deep_cover/core_ext/instruction_sequence_load_iseq.rb', line 7

def load_iseq(path)
  compiled = InstructionSequenceLoadIseq.load_iseq_logic(path)

  return compiled if compiled

  # By default there is no super, but if bootsnap is there, and things are in the right order,
  # we could possibly fallback to it as usual to keep the perf gain. Same for other possible
  # tools using #load_iseq
  super if defined?(super)
end