I wondered about this for the past few weeks until I got the HM5 yesterday. I listened to them for quite a few hours and also did some A/B comparisons between HM5 and some of my other cans using music that I use for comparison/review purposes. Unfortunately I sold SRH840 a few days ago, so no A/B comparison between these two, but I do remember the srh840's performance quite well and my other phones serve as good reference points for me to compare HM5 and SRH840.
That said, I think HM5 is an upgrade to SRH840 for those who look for balanced, neutral, closed can. My major complaints with SRH840 is the sharp/edgy upper mids/highs, small soundstage, and mid-bass hump. HM5 solve these problems easily, very smooth highs with good extension, larger soundstage and tight, detailed and accurate bass. HM5's mids are much more refined and sweet than SRH840. HM5's might be a touch warmer than SRH840, but still very neutral, not colored in anyway. Both phones are very detailed, but without A/B comparison, I cannot tell is which one is more detailed. Since SRH840 are brighter, less warmer, they may make people think they are more revealing and detailed. Also, HM5 is more comfortable to wear despite the strong clamping force. SRH840 are too top heavy for me. The short cable of HM5 is also very nice.