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
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 16 Oct 2014 23:16:39 -0400
changeset 210842 b83e5b5a80daa0cd8975475c2d2053644bc73cdb
parent 210841 83544b7dad714d493bb3a044a50a170e055185e0
child 210843 01d25edea2bc80f6d27d74704f9f9364c2eab63a
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersfitzgen
bugs1083229
milestone36.0a1
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
js/src/vm/SavedStacks.h
--- 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++)