Bug 165679

Summary: Inline JSCell::toObject()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: JavaScriptCoreAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, keith_miller, mark.lam, msaboff, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Chris Dumez
Reported 2016-12-09 13:36:13 PST
Inline JSCell::toObject() as it shows on some Speedometer profiles.
Attachments
Patch (4.61 KB, patch)
2016-12-09 13:37 PST, Chris Dumez
no flags
Patch (3.50 KB, patch)
2016-12-09 14:46 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-12-09 13:37:48 PST
Geoffrey Garen
Comment 2 2016-12-09 13:41:06 PST
Comment on attachment 296687 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296687&action=review r=me > Source/JavaScriptCore/runtime/JSCellInlines.h:347 > +inline JSObject* JSCell::toObject(ExecState* exec, JSGlobalObject* globalObject) const > +{ > + if (isString()) > + return static_cast<const JSString*>(this)->toObject(exec, globalObject); > + if (isSymbol()) > + return static_cast<const Symbol*>(this)->toObject(exec, globalObject); > + ASSERT(isObject()); > + return jsCast<JSObject*>(const_cast<JSCell*>(this)); > +} I think you might get an even better outcome if you made a toObjectSlowCase that covered string and symbol. That way, the inline path is just one branch on isObject, and then it produces an object.
Chris Dumez
Comment 3 2016-12-09 13:52:54 PST
Comment on attachment 296687 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=296687&action=review >> Source/JavaScriptCore/runtime/JSCellInlines.h:347 >> +} > > I think you might get an even better outcome if you made a toObjectSlowCase that covered string and symbol. That way, the inline path is just one branch on isObject, and then it produces an object. Good point, let me do this instead.
Chris Dumez
Comment 4 2016-12-09 14:46:45 PST
Geoffrey Garen
Comment 5 2016-12-09 14:59:14 PST
Comment on attachment 296704 [details] Patch r=me
WebKit Commit Bot
Comment 6 2016-12-09 15:37:30 PST
Comment on attachment 296704 [details] Patch Clearing flags on attachment: 296704 Committed r209636: <http://trac.webkit.org/changeset/209636>
WebKit Commit Bot
Comment 7 2016-12-09 15:37:35 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.