In ES6, StringConstructor behavior becomes different from ToString abstract operations in the spec. (and JSValue::toString). ToString(symbol) throws a type error. String(symbol) produces SymbolDescriptiveString(value). So, in DFG and FTL phase, they should not inline String constructor to ToString. Now, in the template literals patch, ToString DFG operation is planned to be used for it. And current ToString behavior is aligned to the spec (and JSValue::toString). I think keeping it is better. So intead of changing ToString behavior, I think adding StringConstructor operation into DFG and FTL is nice.
Created attachment 250171 [details] Patch
*** Bug 143427 has been marked as a duplicate of this bug. ***
Comment on attachment 250171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250171&action=review > Source/JavaScriptCore/runtime/StringConstructor.cpp:112 > + return jsString(exec, asSymbol(argument)->descriptiveString()); Nit: This can be jsNontrivialString, which can be used for Strings guaranteed to be 2 or more characters long, and this is guaranteed to have "Symbol()".
Comment on attachment 250171 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250171&action=review >> Source/JavaScriptCore/runtime/StringConstructor.cpp:112 >> + return jsString(exec, asSymbol(argument)->descriptiveString()); > > Nit: This can be jsNontrivialString, which can be used for Strings guaranteed to be 2 or more characters long, and this is guaranteed to have "Symbol()". Thank you! I've changed it.
Created attachment 250182 [details] Patch
Comment on attachment 250182 [details] Patch r=me
Comment on attachment 250182 [details] Patch Thank you for your review :D
Comment on attachment 250182 [details] Patch Clearing flags on attachment: 250182 Committed r182433: <http://trac.webkit.org/changeset/182433>
All reviewed patches have been landed. Closing bug.