This is the topic related to bug 78195. If we specify [ConstructorParameters=X], JSC caches X as the number of constructor arguments. However, currently [ConstructorParameters=X] is specified for only a small part of custom constructors. The possible approaches are as follows: (a) If the caching is important for performance, we should add [ConstructorParameters=X] to all custom constructors. (b) If the caching is not so important for performance, we can remove [ConstructorParameters=X] completely. Manually specifying the number of constructor arguments in IDL files is error-prone. People will be likely to forget to specify it or even forget to update X when they change the constructor signature. I am not sure which approach we should take (i.e. whether how much the caching is important for JSC's performance). Any advice?
I don't know much about this topic, but I suspect we should just remove them.
Darin, Sam: Do you have any idea?
As I understand it, this number is not just for caching. You can detect the number of arguments from JavaScript. Is that wrong? If the cache is a pure performance optimization, we can remove it if we show it has no effect on performance. We should not remove it just because of a guess that it has no effect.
(In reply to comment #3) > As I understand it, this number is not just for caching. You can detect the number of arguments from JavaScript. Is that wrong? Sorry for leaving this bug without any update. You are completely right. What we need to do is - Remove [ConstructorParameters] from IDL files that have non-custom constructors. (If the IDL file has [Constructor(...)], CodeGeneratorJS.pm automatically sets the length property based on the signature. bug 78195) - Add [ConstructorParameters] to IDL files that have custom constructors. - Support [ConstructorParameters] in V8. (bug 78657)
Created attachment 129013 [details] Patch
Comment on attachment 129013 [details] Patch Clearing flags on attachment: 129013 Committed r109035: <http://trac.webkit.org/changeset/109035>
All reviewed patches have been landed. Closing bug.