Bug 783540 - add missing STRINGVECTOR case in AutoGCRooter::trace (r=bhackett)
authorLuke Wagner <luke@mozilla.com>
Fri, 17 Aug 2012 11:21:57 -0700
changeset 102812 1baaa5534998
parent 102811 49123250304f
child 102813 75ed4a4cc102
push id23312
push useremorley@mozilla.com
push dateTue, 21 Aug 2012 13:23:13 +0000
treeherdermozilla-central@f9a8fdb08193 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs783540
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 783540 - add missing STRINGVECTOR case in AutoGCRooter::trace (r=bhackett)
js/src/jit-test/tests/basic/testBug783540.js
js/src/jsgc.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/testBug783540.js
@@ -0,0 +1,5 @@
+gczeal(2, 2)
+var stringA = "abcdef";
+var stringB = "ghijk";
+var stringC = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";
+(stringA + stringB + stringC).replace('abc', 'AA')
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2336,16 +2336,22 @@ AutoGCRooter::trace(JSTracer *trc)
       }
 
       case OBJVECTOR: {
         AutoObjectVector::VectorImpl &vector = static_cast<AutoObjectVector *>(this)->vector;
         MarkObjectRootRange(trc, vector.length(), vector.begin(), "js::AutoObjectVector.vector");
         return;
       }
 
+      case STRINGVECTOR: {
+        AutoStringVector::VectorImpl &vector = static_cast<AutoStringVector *>(this)->vector;
+        MarkStringRootRange(trc, vector.length(), vector.begin(), "js::AutoStringVector.vector");
+        return;
+      }
+
       case NAMEVECTOR: {
         AutoNameVector::VectorImpl &vector = static_cast<AutoNameVector *>(this)->vector;
         MarkStringRootRange(trc, vector.length(), vector.begin(), "js::AutoNameVector.vector");
         return;
       }
 
       case VALARRAY: {
         AutoValueArray *array = static_cast<AutoValueArray *>(this);