Bug 849014 - Check type inference before optimizing regexp calls. r=sstangl a=lsblakk