Jim Blandy wrote:
Second optimization: recognizing stack prefixes we've already unwound

When unwinding the stack for profiling, the frames at the older end of the stack are going to get walked over and over. It would be helpful if we could have a bit available on stack frames that is initially clear, but which we can set to indicate that we have cached the rest of the stack somewhere. js::StackFrame already has a flags field whose upper bits are zeroed. In IonFrames, a bit in the descriptor would work for this, if one is available; pushing descriptors with an extra zero bit next to the constructing bit should have no runtime cost.

This reminds me of a technique I saw in Owen Taylor's memprof long ago, which dbaron and I used in the nsTraceMalloc callsite tree:

http://dxr.mozilla.org/mozilla-central/source/tools/trace-malloc/lib/nsTraceMalloc.c?from=nsTraceMalloc.c#473

I had an #ifdef DEBUG copy in jsutils.{h,cpp} but it went long ago.

/be
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to