Closed Bug 513103 Opened 15 years ago Closed 13 years ago

TM: Capture the current call stack without falling of trace

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gal, Unassigned)

Details

This is useful for profiling, and also for security checks.

I was thinking about handing in a structure like this:

struct {
    JSScript* script;
    JSObject* callstack[max];
}

If max isn't enough, we return an error.
So the consumer could use a stack-allocated array and then on error fall back to a heap-allocated one?  Could the error return indicate the necessary array size?
So...we can reify JSStackFrames when we have to fall off trace, so can't we just incrementally partial-reify the parts of the stack that we need when we have a security check, check those, then switch back to the already-existing stack frames and check through those?  (I know I'm being just a /slight/ bit hand-wavy.)
We can. But the point is the consumer doesn't need all the info in a JSStackFrame and shouldn't pay for that. The consumer should ask a narrow questions (give me the call stack as a list of funobjs), and the engine will give a narrow answer.
Typical use-cases involve getting actual argument count and values, local variable values (eek!), etc. See the recent es-discuss list on this topic:

https://mail.mozilla.org/pipermail/es-discuss/2009-August/009714.html

/be
I think we both want the same thing based on your comment 3, just wasn't clear from comment 0 (to me at least) that that was what you meant.  :-)
Obsolete with the removal of tracejit.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.