Bug 1083229. Give FrameStateVector a nonzero minimal length, so we don't end up doing a bunch of realloc/copy as we walk our stack. r=fitzgen
--- a/js/src/vm/SavedStacks.h
+++ b/js/src/vm/SavedStacks.h
@@ -240,17 +240,17 @@ class SavedStacks {
class MOZ_STACK_CLASS AutoFrameStateVector : public JS::CustomAutoRooter {
public:
explicit AutoFrameStateVector(JSContext *cx)
: JS::CustomAutoRooter(cx),
frames(cx)
{ }
- typedef Vector<FrameState> FrameStateVector;
+ typedef Vector<FrameState, 20> FrameStateVector;
inline FrameStateVector *operator->() { return &frames; }
inline FrameState &operator[](size_t i) { return frames[i]; }
private:
FrameStateVector frames;
virtual void trace(JSTracer *trc) {
for (size_t i = 0; i < frames.length(); i++)