On Mon, Oct 24, 2011 at 6:34 AM, Vyacheslav Egorov <[email protected]> wrote: > This patch degrades performance on Crockford's jslint benchmark > (http://javascript.crockford.com/performance.html) by 10%. > > I suspect we are speding too much time in opt/deopt cycles (input to > switch is not a symbol).
I tried to implement a similar optimization some time ago. IIRC it regressed on jslint because the switches there often get oddballs as inputs. One way to solve it was to check the input type early and jump to the default clause for unexpected types. In the end I was not sure the complexity was worth it. > I am putting this patch on hold until this is investigated. > > If hypothesis will be confirmed we will either need to introduce > "symbol-comparison" type feedback for comparisons or force "symbolize" > switch inputs for switches over string literals. > > -- > Vyacheslav Egorov > > > On Mon, Oct 24, 2011 at 2:27 PM, <[email protected]> wrote: >> additional comment. >> >> I'll fix it myself and also add tests before landing. >> >> >> http://codereview.chromium.org/8373029/diff/11001/src/hydrogen.cc >> File src/hydrogen.cc (right): >> >> http://codereview.chromium.org/8373029/diff/11001/src/hydrogen.cc#newcode2719 >> src/hydrogen.cc:2719: AddInstruction(new(zone()) >> HCheckNonSmi(tag_value)); >> Checking that tag_value is non-smi after is-symbol already segfaulted is >> not very helpful. >> >> Usually you want to check for something before you segfault. >> >> http://codereview.chromium.org/8373029/ >> > > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
