Closed Bug 817818 Opened 13 years ago Closed 12 years ago

Miscellaneous rooting fixes

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: sfink, Assigned: sfink)

References

Details

Attachments

(1 file)

A collection of fixes that I have accumulated while working on various things.
I should really mark this f? instead of r?, since you're going to r- it for the UnrootedScript/UnrootedFunction stuff. I really ought to add some more general header-setting to bzexport... Anyway, this r? is really a question about how to declare RawT and UnrootedT. I couldn't just use your existing ForwardDeclare(type) #define because: 1. The 'JS' removal in JSScript -> UnrootedScript 2. Namespaces. JSScript is in the global namespace. Unrooted<T> is inside js::gc::, I think. UnrootedScript probably ought to end up in JS or somewhere. 3. class vs struct -- currently, you forward-declare a class. JSScript is a struct. MSVC, at least, isn't going to be happy about that.
Attachment #687951 - Flags: review?(terrence)
Comment on attachment 687951 [details] [diff] [review] Miscellaneous rooting fixes Review of attachment 687951 [details] [diff] [review]: ----------------------------------------------------------------- I've currently got all of the changes you made to script pointers in a separate patch, so this saves me a bit of work. I'm going to go ahead and r+ this under the assumption that we will be able to hammer out a decision on what to do about the forward declarations today. Even if we don't, it's easy enough to fix later. What I have right now is this unbelievable ugly hack: # define ForwardDeclareJS(type) \ class JS##type; \ namespace js { \ typedef Unrooted<JS##type*> Unrooted##type; \ typedef JS##type * Raw##type; \ } \ class JS##type Also, thank you for the reminder abound |struct|! Maybe this would be a good time to make these |class JSFoo { public: }|?
Attachment #687951 - Flags: review?(terrence) → review+
Attachment #687951 - Flags: checkin+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Depends on: 823080
This landed with the struct/class mismatch problem that spews warnings on MSVC :-(
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: