Nasdaq ends sharply higher as Tesla soars on AI optimism