Optimizing JavaScript compilation