class Ven::Optimizer
- Ven::Optimizer
- Reference
- Object
Included Modules
Defined in:
ven/optimize.crConstructors
Class Method Summary
-
.optimize(chunks, passes = 1)
Returns the chunks optimized in several passes.
Instance Method Summary
-
#binary2n(operator : String, left : BigDecimal, right : BigDecimal)
Computes, if possible, an operator with left, right being known BigDecimals (in Ven, nums).
-
#binary2s(operator : String, left : String, right : String)
Computes, if possible, an operator with left, right being known Strings (in Ven, strs).
-
#optimize(chunk : Chunk)
Goes over chunk's snippets, performing exactly one optimization first for threes, and then for twos of instructions in each snippet.
-
#optimize(passes)
Optimizes the chunks of this Optimizer in several passes.
Constructor Detail
Class Method Detail
Instance Method Detail
Computes, if possible, an operator with left, right being known BigDecimals (in Ven, nums).
Computes, if possible, an operator with left, right being known Strings (in Ven, strs).
Goes over chunk's snippets, performing exactly one optimization first for threes, and then for twos of instructions in each snippet.
This method performs what's known as peephole optimization. It finds blobs of redundant or readily computable instructions, and eliminates them in various ways.