Class: SyntaxTree::YARV::Compiler::Options
- Inherits:
-
Object
- Object
- SyntaxTree::YARV::Compiler::Options
- Defined in:
- lib/syntax_tree/yarv/compiler.rb
Overview
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.
Instance Method Summary collapse
- #frozen_string_literal! ⇒ Object
- #frozen_string_literal? ⇒ Boolean
-
#initialize(frozen_string_literal: false, inline_const_cache: true, operands_unification: true, peephole_optimization: true, specialized_instruction: true, tailcall_optimization: false) ⇒ Options
constructor
A new instance of Options.
- #inline_const_cache? ⇒ Boolean
- #operands_unification? ⇒ Boolean
- #peephole_optimization? ⇒ Boolean
- #specialized_instruction? ⇒ Boolean
- #tailcall_optimization? ⇒ Boolean
- #to_hash ⇒ Object
Constructor Details
#initialize(frozen_string_literal: false, inline_const_cache: true, operands_unification: true, peephole_optimization: true, specialized_instruction: true, tailcall_optimization: false) ⇒ Options
Returns a new instance of Options.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# 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 |
Instance Method Details
#frozen_string_literal! ⇒ Object
80 81 82 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 80 def frozen_string_literal! @frozen_string_literal = true end |
#frozen_string_literal? ⇒ Boolean
84 85 86 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 84 def frozen_string_literal? @frozen_string_literal end |
#inline_const_cache? ⇒ Boolean
88 89 90 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 88 def inline_const_cache? @inline_const_cache end |
#operands_unification? ⇒ Boolean
92 93 94 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 92 def operands_unification? @operands_unification end |
#peephole_optimization? ⇒ Boolean
96 97 98 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 96 def peephole_optimization? @peephole_optimization end |
#specialized_instruction? ⇒ Boolean
100 101 102 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 100 def specialized_instruction? @specialized_instruction end |
#tailcall_optimization? ⇒ Boolean
104 105 106 |
# File 'lib/syntax_tree/yarv/compiler.rb', line 104 def tailcall_optimization? @tailcall_optimization end |
#to_hash ⇒ Object
69 70 71 72 73 74 75 76 77 78 |
# 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 |