js optimization pass
1st optimization pass