Bug 820124 - Follow-up fix: handle prebarrier on raw pointer, fixing a CLOSED TREE.
authorSean Stangl <sstangl@mozilla.com>
Mon, 14 Jan 2013 17:44:45 -0800
changeset 128724 861fb57b93d83f8ce5916ad16a61ebc37e6669d9
parent 128723 485daaddbbb2c0b6ed7770b05c7c8394ea46f398
child 128725 439f89ca87577cca1af6b89aeee38d3c19d3b0d3
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs820124
milestone21.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 820124 - Follow-up fix: handle prebarrier on raw pointer, fixing a CLOSED TREE.
js/src/vm/RegExpObject.h
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -151,16 +151,19 @@ class RegExpShared
   public:
     RegExpShared(JSRuntime *rt, JSAtom *source, RegExpFlag flags);
     ~RegExpShared();
 
     /* Explicit trace function for use by the RegExpStatics and JITs. */
     void trace(JSTracer *trc) {
         MarkStringUnbarriered(trc, &source, "regexpshared source");
     }
+    void writeBarrierPre() {
+        JSString::writeBarrierPre(source);
+    }
 
     /* Static functions to expose some Yarr logic. */
     static inline bool isJITRuntimeEnabled(JSContext *cx);
     static void reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode error);
     static bool checkSyntax(JSContext *cx, TokenStream *tokenStream, JSLinearString *source);
 
     /* Called when a RegExpShared is installed into a RegExpObject. */
     inline void prepareForUse(JSContext *cx);
@@ -267,16 +270,17 @@ class RegExpHeapGuard
   public:
     void init(RegExpShared &re) {
         JS_ASSERT(!initialized());
         re_ = &re;
         re_->incRef();
     }
     void release() {
         if (re_) {
+            re_->writeBarrierPre();
             re_->decRef();
             re_ = NULL;
         }
     }
 
     void trace(JSTracer *trc) {
         if (initialized())
             re_->trace(trc);