Class: RLTK::CG::JITCompiler

Inherits:
ExecutionEngine show all
Defined in:
lib/rltk/cg/execution_engine.rb

Overview

An execution engine that compiles the given code when needed.

Instance Attribute Summary

Attributes inherited from ExecutionEngine

#module

Attributes included from BindingClass

#ptr

Instance Method Summary collapse

Methods inherited from ExecutionEngine

#dispose, #pointer_to_global, #run_function, #run_function_as_main, #target_data

Methods included from BindingClass

#==

Methods included from AbstractClass

included

Constructor Details

#initialize(mod, opt_level = 3) ⇒ JITCompiler

Create a new just-in-time compiler.

Parameters:

  • mod (Module)

    Module to be executed.

  • opt_level (1, 2, 3) (defaults to: 3)

    Optimization level; determines how much optimization is done during execution.



165
166
167
168
169
# File 'lib/rltk/cg/execution_engine.rb', line 165

def initialize(mod, opt_level = 3)
	super(mod) do |ptr, error|
		Bindings.create_jit_compiler_for_module(ptr, mod, opt_level, error)
	end
end