Closed Bug 1083229 Opened 5 years ago Closed 5 years ago

Make the FrameStateVector in SavedStacks::AutoFrameStateVector have a nonzero minimum size

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

That way we avoid reallocating and running FrameState ctors/dtors as we capture a stack.

What's a good minimum size here?

If we can get away with 100, that would be nice, since that's the default stack depth console captures....  The MaxReportedStackDepth that Error uses is clearly too much.  ;)
Blocks: 85333
Blocks: 885333
No longer blocks: 85333
So at first glance, FrameState is 5 words: principals, name, and 3 words for LocationValue (source, line, column).

So allocating an array of length N will use 20N bytes on 32-bit, and 40N bytes on 64-bit.

We probably shouldn't go higher than 20 or so for the auto length...
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8505958 [details] [diff] [review]
Give FrameStateVector a nonzero minimal length, so we don't end up doing a bunch of realloc/copy as we walk our stack

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

(Note that I'm not technically a SpiderMonkey peer, not sure that's a big deal in this specific case, though...)
Attachment #8505958 - Flags: review?(nfitzgerald) → review+
https://hg.mozilla.org/mozilla-central/rev/b83e5b5a80da
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.