Closed
Bug 810715
Opened 12 years ago
Closed 12 years ago
De-lazify a JSFunction's script before querying its ndefaults value
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: till, Unassigned)
References
Details
(Whiteboard: [js:t])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
luke
:
review+
|
Details | Diff | Splinter Review |
To support default parameters in functions with lazily created bytecode, the ndefaults field has to move to JSFunction. This is because fooFunction.length can be called before fooFunction is invoked the first time and thus de-lazified.
From a quick look at all the sites that set ndefaults, it looks like they all have access to the containing JSFunction and could set the field on that just as well.
Updated•12 years ago
|
Whiteboard: [js:t]
Comment 1•12 years ago
|
||
Try run for b38b02bc6579 is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=b38b02bc6579
Results (out of 1 total builds):
failure: 1
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/tschneidereit@gmail.com-b38b02bc6579
Reporter | ||
Comment 2•12 years ago
|
||
This adds an ndefaults field to JSFunction and keeps it in sync with the one on JSScript. Removing ndefaults from the script isn't feasible since, as opposed to what I said in comment 0, we don't always have a JSFunction available when setting ndefaults, after all.
Attachment #707107 -
Flags: review?(luke)
Comment 3•12 years ago
|
||
Could you remind me why foo.length couldn't first clone the script?
Reporter | ||
Comment 4•12 years ago
|
||
That'd certainly be an option, too. You think that the case of foo.length being queried without foo being called will be too rare to bother about the needless clone?
Comment 5•12 years ago
|
||
Yeah, I wouldn't worry about trying to delay the clone; it stands to reason that if they are querying the length they are about to (or just did) call the function.
Reporter | ||
Comment 6•12 years ago
|
||
You're right, of course: Going to any lengths at all to prevent cloning here is just plain silly.
This makes the new patch rather boring. To spice it up a little, I fixed an unrelated call to getOrCreateScript where the result wasn't checked. Hope that's ok.
Attachment #707524 -
Flags: review?(luke)
Reporter | ||
Updated•12 years ago
|
Attachment #707107 -
Attachment is obsolete: true
Attachment #707107 -
Flags: review?(luke)
Comment 7•12 years ago
|
||
Comment on attachment 707524 [details] [diff] [review]
De-lazify a JSFunction's script before querying its ndefaults value. r=?
Review of attachment 707524 [details] [diff] [review]:
-----------------------------------------------------------------
Great!
Attachment #707524 -
Flags: review?(luke) → review+
Reporter | ||
Comment 8•12 years ago
|
||
Summary: Move JSScript::ndefaults to JSFunction → De-lazify a JSFunction's script before querying its ndefaults value
Comment 9•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•