Created attachment 20785 [details]
Here is a patch that fixes the problem. It shows no difference on SunSpider.
Comment on attachment 20785 [details]
Committed in r32459.