Class: RBF::JIT::Code
- Inherits:
-
Object
- Object
- RBF::JIT::Code
- Defined in:
- lib/rbf/jit/code.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(tree, options = nil) ⇒ Code
constructor
A new instance of Code.
Constructor Details
#initialize(tree, options = nil) ⇒ Code
Returns a new instance of Code.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rbf/jit/code.rb', line 18 def initialize (tree, =nil) = @module = LLVM::Module.create('brainfuck') @module.functions.add('self', [], LLVM::Void) do |func| builder = LLVM::Builder.create end @module.verify end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/rbf/jit/code.rb', line 16 def end |
Instance Method Details
#execute ⇒ Object
29 30 31 |
# File 'lib/rbf/jit/code.rb', line 29 def execute LLVM::ExecutionEngine.create_jit_compiler(@module).run_function(@module.functions['self']) end |