[webkit-reviews] review granted: [Bug 224247] Remove className() and toStringName() from the method table : [Attachment 425548] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 8 15:43:55 PDT 2021


Darin Adler <darin at apple.com> has granted Alexey Shvayka
<shvaikalesh at gmail.com>'s request for review:
Bug 224247: Remove className() and toStringName() from the method table
https://bugs.webkit.org/show_bug.cgi?id=224247

Attachment 425548: Patch

https://bugs.webkit.org/attachment.cgi?id=425548&action=review




--- Comment #5 from Darin Adler <darin at apple.com> ---
Comment on attachment 425548
  --> https://bugs.webkit.org/attachment.cgi?id=425548
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=425548&action=review

> Source/JavaScriptCore/runtime/ObjectPrototype.cpp:329
> +inline const char* getBuiltinTag(JSGlobalObject* globalObject, JSObject*
object)

WebKit coding style discourages use of the word "get" in the name of a function
like this.

> Source/JavaScriptCore/runtime/ObjectPrototype.cpp:390
> +	   jsTag = jsNontrivialString(vm, String(tag));

I am slightly surprised that an explicit cast to String is needed here. Can we
try this without the function-style cast to String?

Seems slightly unfortunate that we always have to pay the price of allocating a
StringImpl every time this code is called, given that there is a small fixed
set of strings this can ever return. Probably OK that we copy the characters
into the StringImpl and don’t do the ASCIILiteral optimization.


More information about the webkit-reviews mailing list