Closed Bug 807179 Opened 13 years ago Closed 13 years ago

Give JSPropertyDescriptor a constructor

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: mccr8, Assigned: bholley)

References

Details

(Keywords: sec-want)

Attachments

(1 file)

JSPropertyDescriptor is a struct, which means you have to remember to initialize it, which causes badness if you don't. Right now, I think we do this at the API boundary, but maybe we can avoid that. There's also code like in NativeToString in BindingUtils.cpp that would be a little neater if we had better ways to initialize these.
I don't know what is being generated, but I thought these JSPropertyDescriptor things were globally allocated. In that case, it would be bad for startup time if there were a lot of them and they all had constructor calls.
The ones I'm familiar with, from the browser side, are on the stack, but perhaps there are a bunch in the engine, too.
I guess you could add a constructor with printf and see how many happen before main() :)
Keywords: sec-want
This is a total footgun. Attaching a patch. Luke, are you sure you're not talking about JSPropertySpecs? I'm not aware of anywhere we statically allocate JSPropertyDescriptors...
Attachment #678566 - Flags: review?(luke)
Assignee: general → bobbyholley+bmo
Heh, yes, I am confusing JSPropertySpec with JSPropertyDescriptor. Carry on.
Attachment #678566 - Flags: review?(luke) → review+
Yay! Some of JSAutoPropertyRooter can probably also be torn out at some point.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: