Methods
- C
- E
- L
- N
Class Public methods
new()
Link
Instance Public methods
compile_and_save_iseq(fname, iseq_key = iseq_key_name(fname))
Link
# File sample/iseq_loader.rb, line 90 def compile_and_save_iseq fname, iseq_key = iseq_key_name(fname) $ISEQ_LOADER_COMPILED += 1 STDERR.puts "[RUBY_COMPILED_FILE] compile #{fname}" if COMPILE_DEBUG iseq = RubyVM::InstructionSequence.compile_file(fname) binary = iseq.to_binary(extra_data(fname)) write_compiled_iseq(fname, iseq_key, binary) iseq end
extra_data(fname)
Link
load_iseq(fname)
Link
# File sample/iseq_loader.rb, line 67 def load_iseq fname iseq_key = iseq_key_name(fname) if compiled_iseq_exist?(fname, iseq_key) && compiled_iseq_is_younger?(fname, iseq_key) $ISEQ_LOADER_LOADED += 1 STDERR.puts "[ISEQ_LOADER] #{Process.pid} load #{fname} from #{iseq_key}" if COMPILE_DEBUG binary = read_compiled_iseq(fname, iseq_key) iseq = RubyVM::InstructionSequence.load_from_binary(binary) # p [extra_data(iseq.path), RubyVM::InstructionSequence.load_from_binary_extra_data(binary)] # raise unless extra_data(iseq.path) == RubyVM::InstructionSequence.load_from_binary_extra_data(binary) iseq elsif COMPILE_IF_NOT_COMPILED compile_and_save_iseq(fname, iseq_key) else $ISEQ_LOADER_IGNORED += 1 # p fname nil end end