Cherry-picked sourcemap-related changes from upstream master.