The S&P 500 and the Nasdaq hit new highs as Nvidia's market cap surpasses Apple's