Add tree-walker optimization.