Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Make the primordial Function and Object bootstrapping not use functionality itself depending on bootstrapping having partially occurred

RESOLVED FIXED in mozilla9



JavaScript Engine
6 years ago
6 years ago


(Reporter: Waldo, Assigned: Waldo)



Firefox Tracking Flags

(Not tracked)



(3 attachments)

Object and Function initialization are intricately intertwined.  To initialize Object, you need Function to be initialized for the function properties on Object.prototype and Object.  But to initialize Function, you need Object.prototype for Function.prototype's [[Prototype]]!  Since the two are so intricately interdependent, their bootstrapping should be one-off and not use functionality that thinks that these things have already been bootstrapped -- they should do it from scratch.
Created attachment 560385 [details] [diff] [review]
1 - Move js_InitObjectClass to GlobalObject code

All this stuff will live in vm/GlobalObject.cpp, so first I'm moving the sub-bits of this to there.
Attachment #560385 - Flags: review?(jorendorff)
Created attachment 560386 [details] [diff] [review]
2 - Move js_InitFunctionClass to GlobalObject code
Attachment #560386 - Flags: review?(jorendorff)
Created attachment 560387 [details] [diff] [review]
3 - Rewrite js_InitFunctionAndObjectClasses

The pièce de résistance!  The sine qua non!  The cliched concluding phrase!
Attachment #560387 - Flags: review?(jorendorff)

Comment 4

6 years ago
Or: "Object initialization shouldn't involve a fixed-point computation" :)
Attachment #560385 - Flags: review?(jorendorff) → review+
Attachment #560386 - Flags: review?(jorendorff) → review+
Comment on attachment 560387 [details] [diff] [review]
3 - Rewrite js_InitFunctionAndObjectClasses

Looks great. The new code is a little longer but the strange loops in the old code were far from obvious. I don't suppose we can rip out the protection around resolve hooks now, can we?
Attachment #560387 - Flags: review?(jorendorff) → review+
Filed bug 687113 for simplifying that stuff. Someone take it--it's a nice opportunity to improve behavior and delete code at the same time!
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
You need to log in before you can comment on or make changes to this bug.