class SyntaxTree::YARV::Compiler::Options

This represents a set of options that can be passed to the compiler to control how it compiles the code. It mirrors the options that can be passed to RubyVM::InstructionSequence.compile, except it only includes options that actually change the behavior.

Public Class Methods

new( frozen_string_literal: false, inline_const_cache: true, operands_unification: true, peephole_optimization: true, specialized_instruction: true, tailcall_optimization: false ) click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 53
def initialize(
  frozen_string_literal: false,
  inline_const_cache: true,
  operands_unification: true,
  peephole_optimization: true,
  specialized_instruction: true,
  tailcall_optimization: false
)
  @frozen_string_literal = frozen_string_literal
  @inline_const_cache = inline_const_cache
  @operands_unification = operands_unification
  @peephole_optimization = peephole_optimization
  @specialized_instruction = specialized_instruction
  @tailcall_optimization = tailcall_optimization
end

Public Instance Methods

frozen_string_literal!() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 80
def frozen_string_literal!
  @frozen_string_literal = true
end
frozen_string_literal?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 84
def frozen_string_literal?
  @frozen_string_literal
end
inline_const_cache?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 88
def inline_const_cache?
  @inline_const_cache
end
operands_unification?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 92
def operands_unification?
  @operands_unification
end
peephole_optimization?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 96
def peephole_optimization?
  @peephole_optimization
end
specialized_instruction?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 100
def specialized_instruction?
  @specialized_instruction
end
tailcall_optimization?() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 104
def tailcall_optimization?
  @tailcall_optimization
end
to_hash() click to toggle source
# File lib/syntax_tree/yarv/compiler.rb, line 69
def to_hash
  {
    frozen_string_literal: @frozen_string_literal,
    inline_const_cache: @inline_const_cache,
    operands_unification: @operands_unification,
    peephole_optimization: @peephole_optimization,
    specialized_instruction: @specialized_instruction,
    tailcall_optimization: @tailcall_optimization
  }
end