Global stock benchmarks have surged to multiyear or record highs this year, boosted by a rally in shares of technology companies, a synchronized pickup in growth around the world and unexpectedly benign inflation readings that have kept central bank policy ultraloose.