Closed Bug 686900 Opened 8 years ago Closed 8 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(3 files)

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.
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)
Attachment #560386 - Flags: review?(jorendorff)
The pièce de résistance!  The sine qua non!  The cliched concluding phrase!
Attachment #560387 - Flags: review?(jorendorff)
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!
You need to log in before you can comment on or make changes to this bug.