Closed Bug 855145 Opened 11 years ago Closed 11 years ago

DeMACROize (some of) the JS tracing interface

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: terrence, Assigned: terrence)

References

Details

Attachments

(2 files)

Attached patch v0: js halfSplinter Review
This demacroizes all of the CALL_TRACER routines. It also uses the statically known type of the traced thing to call the right function immediately, rather than casting it away, looking it up in the arena, then switching to get the right function.

One noticeable exception is that ccParticipant marking still requires a generic void* for tracing. I'm not sure if it will be necessary (or possible) to fix this for GGC yet; I will look into it more later.
Attachment #729903 - Flags: review?(wmccloskey)
Attached patch v0: browser halfSplinter Review
And this is the browser half. It is almost completely mechanical.
Attachment #729904 - Flags: review?(continuation)
Comment on attachment 729904 [details] [diff] [review]
v0: browser half

Review of attachment 729904 [details] [diff] [review]:
-----------------------------------------------------------------

Please make sure you can do a cycle collector dump at least once without crashing with this patch in place.

https://wiki.mozilla.org/Performance:Leak_Tools#Cycle_collector_heap_dump
Attachment #729904 - Flags: review?(continuation) → review+
Comment on attachment 729903 [details] [diff] [review]
v0: js half

Review of attachment 729903 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsapi.cpp
@@ +2441,5 @@
>  JS_PUBLIC_API(void)
> +JS_CallValueTracer(JSTracer *trc, Value valueArg, const char *name)
> +{
> +    Value value = valueArg;
> +    MarkValueUnbarriered(trc, &value, name);

Can you add assertions in each one of these that the thing hasn't moved?

@@ +2479,5 @@
> +    void *gcthing = gcthingArg;
> +    Cell *cell = static_cast<gc::Cell *>(gcthing);
> +    JSGCTraceKind kind = gc::IsInsideNursery(cell->runtime(), gcthing)
> +                         ? JSTRACE_OBJECT
> +                         : gc::MapAllocToTraceKind(cell->tenuredGetAllocKind());

Just use GetGCThingTraceKind here.
Attachment #729903 - Flags: review?(wmccloskey) → review+
https://hg.mozilla.org/mozilla-central/rev/2cb5ad80203e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: