I noticed that our toInteger function was not doing what the specification said it should. And that toInt32 wasn't optimizing enough. So I went and optimized both.
Created attachment 16873 [details] patch with detailed change log
Comment on attachment 16873 [details] patch with detailed change log r=me with one comment: please consider using trunc(d) instead of copysign(floor(fabs(d))). They should do the same thing.
Committed revision 27095.