Bug 815652 - Remove accidental temporary rooting object (r=bhackett)
authorBill McCloskey <wmccloskey@mozilla.com>
Tue, 27 Nov 2012 13:59:13 -0800
changeset 114293 59281806d3a6505bcae91f58eeec9e46e5254589
parent 114292 37a54196d003ac95f9f90ea2eb4c91876a02542d
child 114294 ba730945bc6db5a3aba668aebcd53dd3d3525a49
push id23913
push useremorley@mozilla.com
push dateWed, 28 Nov 2012 17:11:31 +0000
treeherdermozilla-central@17c267a881cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs815652
milestone20.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 815652 - Remove accidental temporary rooting object (r=bhackett)
js/src/ion/CompilerRoot.h
js/src/ion/MIR.h
js/src/jit-test/tests/basic/bug815652.js
--- a/js/src/ion/CompilerRoot.h
+++ b/js/src/ion/CompilerRoot.h
@@ -16,20 +16,16 @@ namespace ion {
 
 // Roots a read-only GCThing for the lifetime of a single compilation.
 // Each root is maintained in a linked list that is walked over during tracing.
 // The CompilerRoot must be heap-allocated and may not go out of scope.
 template <typename T>
 class CompilerRoot : public CompilerRootNode
 {
   public:
-    CompilerRoot()
-      : CompilerRootNode(NULL)
-    { }
-
     CompilerRoot(T ptr)
       : CompilerRootNode(NULL)
     {
         if (ptr)
             setRoot(ptr);
     }
 
   public:
@@ -41,16 +37,21 @@ class CompilerRoot : public CompilerRoot
         ptr = root;
         next = rootList;
         rootList = this;
     }
 
   public:
     operator T () const { return static_cast<T>(ptr); }
     T operator ->() const { return static_cast<T>(ptr); }
+
+  private:
+    CompilerRoot() MOZ_DELETE;
+    CompilerRoot(const CompilerRoot<T> &) MOZ_DELETE;
+    CompilerRoot<T> &operator =(const CompilerRoot<T> &) MOZ_DELETE;
 };
 
 typedef CompilerRoot<JSObject*>   CompilerRootObject;
 typedef CompilerRoot<JSFunction*> CompilerRootFunction;
 typedef CompilerRoot<PropertyName*> CompilerRootPropertyName;
 typedef CompilerRoot<Value> CompilerRootValue;
 
 } // namespace ion
--- a/js/src/ion/MIR.h
+++ b/js/src/ion/MIR.h
@@ -5249,19 +5249,19 @@ class MInArray
 class MInstanceOf
   : public MUnaryInstruction,
     public InstanceOfPolicy
 {
     CompilerRootObject protoObj_;
 
   public:
     MInstanceOf(MDefinition *obj, RawObject proto)
-      : MUnaryInstruction(obj)
+      : MUnaryInstruction(obj),
+        protoObj_(proto)
     {
-        protoObj_ = proto;
         setResultType(MIRType_Boolean);
     }
 
     INSTRUCTION_HEADER(InstanceOf);
 
     TypePolicy *typePolicy() {
         return this;
     }
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug815652.js
@@ -0,0 +1,10 @@
+
+gczeal(9, 2)
+function testScatterConflict() {
+  var p = new ParallelArray([1,2,3,4,5]);
+  var r = p.scatter([0,1,0,3,(0)], 9, function (a,b) { return a+b; });
+  function assertEqParallelArray(a, b)
+    assertEq(a instanceof ParallelArray, true);
+  assertEqParallelArray(r, new ParallelArray([4,2,(false),4,5]));
+}
+testScatterConflict();