The song you're thinking of is almost certainly "Use Somebody" by Kings of Leon.
The whistling melody (performed by frontman Caleb Followill) serves as the song's intro, post-chorus hook, and outro. It's a simple, yearning pentatonic phrase that became instantly recognizable and was central to the track's crossover from alternative radio to global pop saturation.
Other whistle-heavy songs from that era (e.g., Flo Rida - "Whistle" 2012, Peter Bjorn and John - "Young Folks" 2006) don't match the "late 2008/2009 alternative smash" description as precisely.