Bug 20989 - Aguments constructor should put 'callee' and 'length' properties in a more efficient way
Summary: Aguments constructor should put 'callee' and 'length' properties in a more ef...
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Cameron Zwarich (cpst)
Depends on:
Blocks: 20813
  Show dependency treegraph
Reported: 2008-09-22 03:56 PDT by Cameron Zwarich (cpst)
Modified: 2008-09-23 04:02 PDT (History)
0 users

See Also:

Proposed patch (4.55 KB, patch)
2008-09-23 03:00 PDT, Cameron Zwarich (cpst)
oliver: review+
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-09-22 03:56:21 PDT
Currently the Arguments constructor uses putDirect() to put both of these properties. A Shark profile on my system says that this is 5.6% of total time in the V8 Raytrace benchmark, which suggests that we should find a better way to add these properties.
Comment 1 Cameron Zwarich (cpst) 2008-09-23 03:00:38 PDT
Created attachment 23699 [details]
Proposed patch
Comment 2 Oliver Hunt 2008-09-23 03:10:15 PDT
Comment on attachment 23699 [details]
Proposed patch


I wonder if overrodeLength/overrodeCallee being bitfields is "expensive" -- did you try without?

Also if you're trying to reduce size it might be worth seeing if you can drop one of the other fields to 30 bits and so merge the bitfields.
Comment 3 Cameron Zwarich (cpst) 2008-09-23 04:02:32 PDT
Landed in r36804.

Using bitfields rather than booleans doesn't seem to affect speed (in fact, using bitfields rather than nothing at all didn't seem to affect speed), and I didn't want to merge the bitfields with any integer arguments because they are used fairly often. I can still try it out later, though.