Summary: | Function names on Object.prototype should be common identifiers | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
Component: | New Bugs | Assignee: | Ryosuke Niwa <rniwa> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | ||||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Ryosuke Niwa
2013-06-13 16:11:54 PDT
Created attachment 204649 [details]
Fixes the bug
Comment on attachment 204649 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=204649&action=review > Source/JavaScriptCore/runtime/JSObject.h:1472 > +#define JSC_NATIVE_INTRINSIC_FUNCTION_IDENT(jsName, cppName, attributes, length, intrinsic) \ We can do this without a second macro. We just need this inline function: inline Identifier makeIdentifier(ExecState* exec, const char* name) { return Identifier(exec, name); } inline Identifier makeIdentifier(ExecState*, const Identifier& identifier) { return identifier; } Then change the existing macro to use this function instead of calling the Identifier constructor directly. I’d love to not add a new macro. I also have no idea why this is a macro instead of an inline function in the first place. Comment on attachment 204649 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=204649&action=review >> Source/JavaScriptCore/runtime/JSObject.h:1472 >> +#define JSC_NATIVE_INTRINSIC_FUNCTION_IDENT(jsName, cppName, attributes, length, intrinsic) \ > > We can do this without a second macro. We just need this inline function: > > inline Identifier makeIdentifier(ExecState* exec, const char* name) > { > return Identifier(exec, name); > } > > inline Identifier makeIdentifier(ExecState*, const Identifier& identifier) > { > return identifier; > } > > Then change the existing macro to use this function instead of calling the Identifier constructor directly. I’d love to not add a new macro. I also have no idea why this is a macro instead of an inline function in the first place. Done. Committed r151605: <http://trac.webkit.org/changeset/151605> This was 3-6% improvement on various Dromaeo CSS query tests: https://perf.webkit.org/#mode=charts&chartList=%5B%5B%22mac-mountainlion%22%2C%22Dromaeo%2Fcssquery-dojo%3ARuns%22%5D%2C%5B%22mac-mountainlion%22%2C%22Dromaeo%2Fcssquery-jquery%3ARuns%22%5D%2C%5B%22mac-mountainlion%22%2C%22Dromaeo%2Fcssquery-prototype%3ARuns%22%5D%2C%5B%22mac-lion%22%2C%22Dromaeo%2Fcssquery-prototype%3ARuns%22%5D%5D&days=209&zoom=%5B1370938426131.5286%2C1371950721246.015%5D |