Module: Bootsnap::CompileCache::ISeq
- Defined in:
- lib/bootsnap/compile_cache/iseq.rb
Defined Under Namespace
Modules: InstructionSequenceMixin
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.cache_dir ⇒ Object
Returns the value of attribute cache_dir.
9
10
11
|
# File 'lib/bootsnap/compile_cache/iseq.rb', line 9
def cache_dir
@cache_dir
end
|
Class Method Details
.compile_option_updated ⇒ Object
71
72
73
74
75
|
# File 'lib/bootsnap/compile_cache/iseq.rb', line 71
def self.compile_option_updated
option = RubyVM::InstructionSequence.compile_option
crc = Zlib.crc32(option.inspect)
Bootsnap::CompileCache::Native.compile_option_crc32 = crc
end
|
.fetch(path, cache_dir: ISeq.cache_dir) ⇒ Object
46
47
48
|
# File 'lib/bootsnap/compile_cache/iseq.rb', line 46
def self.input_to_output(_data, _kwargs)
nil end
|
12
13
14
15
16
|
# File 'lib/bootsnap/compile_cache/iseq.rb', line 12
def self.input_to_storage(_, path)
RubyVM::InstructionSequence.compile_file(path).to_binary
rescue SyntaxError
raise(Uncompilable, 'syntax error')
end
|
.install!(cache_dir) ⇒ Object
.precompile(path, cache_dir: ISeq.cache_dir) ⇒ Object
.storage_to_output(binary, _args) ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/bootsnap/compile_cache/iseq.rb', line 18
def self.storage_to_output(binary, _args)
RubyVM::InstructionSequence.load_from_binary(binary)
rescue RuntimeError => e
if e.message == 'broken binary format'
STDERR.puts("[Bootsnap::CompileCache] warning: rejecting broken binary")
nil
else
raise
end
end
|