Optimization Passes
Script optimization is performed via multiple passes. Each pass does a specific optimization.
The optimization is completed when no passes can simplify the AST
any further.
Built-in Optimization Passes
Pass | Description |
---|---|
Dead code elimination | Eliminates code that cannot be reached |
Constants propagation | Replaces constants with values |
Compound assignments rewrite | Rewrites assignments into compound assignments |
Eager operator evaluation | Eagerly calls operators with constant arguments |
Eager function evaluation | Eagerly calls functions with constant arguments |