When parseDateFromNullTerminatedCharacters() is unable to parse the passed string, it still calculates the timezone and DST offset to apply to the result. This causes an unnecessary IPC in chromium. The attached patch changes the code to only calculate the offsets if parsing was successful.
Created attachment 43071 [details] Only calculate time offsets for valid dates.
Comment on attachment 43071 [details] Only calculate time offsets for valid dates. Thanks for fixing this. > Index: JavaScriptCore/ChangeLog > +2009-11-11 Steve VanDeBogart <vandebo@chromium.org> > + > + Reviewed by NOBODY (OOPS!). > + > + Calculate the time offset only if we were able to parse > + the date string. This saves an IPC in Chromium for > + invalid date strings. Please add a bug link. > Index: JavaScriptCore/wtf/DateMath.cpp > @@ -825,7 +825,7 @@ double parseDateFromNullTerminatedCharac > int offset; > double ms = parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset); > // fall back to local timezone Just do if (isnan(ms)) return NaN; > - if (!haveTZ) { > + if (!haveTZ && ms != NaN) { Also there is another instance to fix in "double parseDateFromNullTerminatedCharacters(ExecState* exec, const char* dateString)"
Created attachment 43079 [details] Other case and early exit
Comment on attachment 43079 [details] Other case and early exit spacing
Created attachment 43081 [details] Fix spacing
Comment on attachment 43081 [details] Fix spacing Thanks!
Comment on attachment 43081 [details] Fix spacing Clearing flags on attachment: 43081 Committed r50927: <http://trac.webkit.org/changeset/50927>
All reviewed patches have been landed. Closing bug.