Bug 1153498 - Use RelocatablePtr in RegExpShared since these can be destroyed outside of the GC r=terrence
☠☠ backed out by 6e139783c7cf ☠ ☠
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 14 Apr 2015 11:31:12 +0100
changeset 270350 607cfbb06eb83175f7546ff585e191359511b52d
parent 270349 c2c326d0ba80043d17aa86acd3c6f5d21f5fa79a
child 270351 bc2abe766ccd3ca7da5e4b70f103fc5ce6a6d1a1
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1153498
milestone40.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 1153498 - Use RelocatablePtr in RegExpShared since these can be destroyed outside of the GC r=terrence
js/src/jit-test/tests/gc/bug-1153498.js
js/src/vm/RegExpObject.h
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1153498.js
@@ -0,0 +1,10 @@
+// |jit-test| allow-oom; allow-unhandlable-oom
+if (!("oomAfterAllocations" in this && "gczeal" in this))
+    quit();
+gczeal(0);
+"".search(function() {});
+r = /x/;
+x = [/y/];
+oomAfterAllocations(5);
+x.v = function() {};
+a = /z/;
--- a/js/src/vm/RegExpObject.h
+++ b/js/src/vm/RegExpObject.h
@@ -114,29 +114,29 @@ class RegExpShared
   private:
     friend class RegExpCompartment;
     friend class RegExpStatics;
 
     typedef frontend::TokenStream TokenStream;
 
     struct RegExpCompilation
     {
-        HeapPtrJitCode jitCode;
+        RelocatablePtrJitCode jitCode;
         uint8_t* byteCode;
 
         RegExpCompilation() : byteCode(nullptr) {}
         ~RegExpCompilation() { js_free(byteCode); }
 
         bool compiled(ForceByteCodeEnum force = DontForceByteCode) const {
             return byteCode || (force == DontForceByteCode && jitCode);
         }
     };
 
     /* Source to the RegExp, for lazy compilation. */
-    HeapPtrAtom        source;
+    RelocatablePtrAtom source;
 
     RegExpFlag         flags;
     size_t             parenCount;
     bool               canStringMatch;
     bool               marked_;
 
     RegExpCompilation  compilationArray[4];