Carbon-rich nursery around massive exoplanets