Closed Bug 815931 Opened 12 years ago Closed 12 years ago

Split out parts of jsgc.cpp into separate files

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: billm, Assigned: billm)

Details

(Whiteboard: [js:t])

Attachments

(6 files, 3 obsolete files)

This first patch moves some of the root marking code into a separate file.
Attachment #685922 - Flags: review?(terrence)
This patch moves some of the auto classes used for tracing into headers. It also calls RecordNativeStackTop automatically from one of the auto classes. This isn't needed by all the tracers, but it's not very expensive and it simplifies things.
Attachment #685923 - Flags: review?(jcoppeard)
This patch moves a bunch of heap iteration code into its own file.
Attachment #685924 - Flags: review?(jcoppeard)
This just reuses AutoPrepareForTracing for the verifier.
Attachment #685925 - Flags: review?(terrence)
Attached patch move verifier (obsolete) — Splinter Review
This moves the verifier to its own file.
Attachment #685926 - Flags: review?(terrence)
Comment on attachment 685923 [details] [diff] [review] move some Auto classes to header Review of attachment 685923 [details] [diff] [review]: ----------------------------------------------------------------- Nice, looks good.
Attachment #685923 - Flags: review?(jcoppeard) → review+
Comment on attachment 685924 [details] [diff] [review] move iteration code Review of attachment 685924 [details] [diff] [review]: ----------------------------------------------------------------- Ditto.
Attachment #685924 - Flags: review?(jcoppeard) → review+
Comment on attachment 685922 [details] [diff] [review] move root marking Review of attachment 685922 [details] [diff] [review]: ----------------------------------------------------------------- Nice! ::: js/src/gc/RootMarking.cpp @@ +36,5 @@ > +typedef RootedValueMap::Entry RootEntry; > +typedef RootedValueMap::Enum RootEnum; > + > +static inline bool > +InFreeList(ArenaHeader *aheader, uintptr_t addr) Whoops! I should have added the new exact marking code /above/ this function. Could you move InFreeList down so that it is next to the conservative marking instead of the exact marking?
Attachment #685922 - Flags: review?(terrence) → review+
Comment on attachment 685925 [details] [diff] [review] use AutoPrepareForTracing in verifier routines Review of attachment 685925 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/gc/Iteration.cpp @@ -23,5 @@ > { > JS_ASSERT(!IS_GC_MARKING_TRACER(trc)); > > AutoPrepareForTracing prep(trc->runtime); > - RecordNativeStackTopForGC(trc->runtime); I assume this has moved somewhere else since I last poked around here? ::: js/src/jsgc.cpp @@ +4685,4 @@ > return; > + } > + > + AutoPrepareForTracing prep(rt); Ooooh, shiny! I really should have read your cleanup patch when it landed.
Attachment #685925 - Flags: review?(terrence) → review+
Comment on attachment 685926 [details] [diff] [review] move verifier Review of attachment 685926 [details] [diff] [review]: ----------------------------------------------------------------- I don't see Verifier.cpp in this patch. Could you hg add it and re-upload?
Attachment #685926 - Flags: review?(terrence)
Sorry, here it is with Verifier.cpp.
Attachment #685926 - Attachment is obsolete: true
Attachment #686266 - Flags: review?(terrence)
Whiteboard: [js:t]
Comment on attachment 686266 [details] [diff] [review] move verifier, v2 Review of attachment 686266 [details] [diff] [review]: ----------------------------------------------------------------- Unsurprisingly, there were no surprises :-). Probably should have just r+'ed it sight-unseen.
Attachment #686266 - Flags: review?(terrence) → review+
Comment on attachment 686266 [details] [diff] [review] move verifier, v2 Review of attachment 686266 [details] [diff] [review]: ----------------------------------------------------------------- Unsurprisingly, there were no surprises :-). Probably should have just r+'ed it sight-unseen.
I think this might have broken the --enable-valgrind stack-scan annotations. I now get a whole bunch of error reports when GC runs, which go away when I add the patch in the next comment.
Julian, thanks for the patch! I noticed those too, but didn't have time to investigate.
Attachment #689194 - Flags: review?(terrence)
Comment on attachment 689194 [details] [diff] [review] Fix up valgrind stack-scan annotations Review of attachment 689194 [details] [diff] [review]: ----------------------------------------------------------------- I talked this over with Bill just now and we are agreed that we want to just depend on MOZ_VALGRIND and remove JS_VALGRIND, since we're just aliasing them anyway. This should be as simple as changing the #ifdef JS_VALGRIND in jsgc.cpp, gc/Verifier.cpp, and gc/RootMarking.cpp to MOZ_VALGRIND and simplifying the #include protection accordingly. R+ with the above trivial changes and the nit below. ::: js/src/gc/RootMarking.cpp @@ +30,5 @@ > +#ifdef MOZ_VALGRIND > +# define JS_VALGRIND > +#endif > +#ifdef JS_VALGRIND > +# include <valgrind/memcheck.h> It looks like we also should have this include in gc/Verifier.cpp.
Attachment #689194 - Flags: review?(terrence) → review+
I wanted to test this so I went ahead an updated the nits. I'm not jseward, so please verify. :) BTW, I don't see any valgrind markup in jsgc.cpp. Does it still need the include?
Attachment #689194 - Attachment is obsolete: true
Attachment #689371 - Flags: review?(terrence)
Comment on attachment 689371 [details] [diff] [review] Fix up valgrind stack-scan annotations Review of attachment 689371 [details] [diff] [review]: ----------------------------------------------------------------- Awesome! \o/
Attachment #689371 - Flags: review?(terrence) → review+
(In reply to Ralph Giles (:rillian) from comment #19) > BTW, I don't see any valgrind markup in jsgc.cpp. Does it still need the > include? Good catch: probably not. You can go ahead and remove it.
Done, thanks. Carrying forward previous r+. Can someone please push the valgrind fix to incoming? I don't have level 2.
Attachment #689371 - Attachment is obsolete: true
Attachment #689802 - Flags: checkin?
Status: RESOLVED → REOPENED
Keywords: checkin-needed
Resolution: FIXED → ---
Attachment #689802 - Flags: checkin?
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: