Bug 21814 - The name property of JSFunctions should not be put directly
Summary: The name property of JSFunctions should not be put directly
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Cameron Zwarich (cpst)
URL:
Keywords:
Depends on:
Blocks: 20813
  Show dependency treegraph
 
Reported: 2008-10-22 16:01 PDT by Cameron Zwarich (cpst)
Modified: 2011-10-03 13:52 PDT (History)
3 users (show)

See Also:


Attachments
Preallocated StructureIDs (8.48 KB, patch)
2008-10-22 16:39 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch in progress (14.09 KB, patch)
2008-10-28 22:19 PDT, Cameron Zwarich (cpst)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Zwarich (cpst) 2008-10-22 16:01:38 PDT
According to the opcode sampler, the creation of new function objects is 8% of total time on the V8 Earley-Boyer benchmark. One of the things that stands out here is that three properties are added to every new JSFunction using putDirect(). We should make the addition of these properties more efficient in a similar fashion to the way the creation of singleton objects uses fewer StructureIDs.
Comment 1 Sam Weinig 2008-10-22 16:39:10 PDT
Created attachment 24581 [details]
Preallocated StructureIDs
Comment 2 Cameron Zwarich (cpst) 2008-10-27 11:20:21 PDT
This patch is not so relevant after r37859, because the prototype property is now created lazily. The only property that is still put on a JSFunction is the name property, which could be stored on the FunctionBodyNode and not actually created. I'll rename this bug to reflect this change.
Comment 3 Cameron Zwarich (cpst) 2008-10-28 22:19:53 PDT
Created attachment 24739 [details]
Patch in progress

This is strangely a slowdown on the V8 benchmark suite, and I am not sure why. It still needs to make JSFunction::getOwnPropertySlot() work correctly for 'name'.
Comment 4 Alexey Proskuryakov 2010-06-11 11:27:31 PDT
Does this bug still track an actionable issue?
Comment 5 Gavin Barraclough 2011-10-03 13:52:20 PDT
We now have a solution for this in ToT, we cache a transitioned structure for functions that have assigned space for the name.