Rewrite it for better performance.
Created attachment 226809 [details] Patch
Committed r165787: <http://trac.webkit.org/changeset/165787>