Bug 1112632 - Flag object/array allocations as implictly used as we are removing uses. r=jandem a=sylvestre
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 08 Jan 2015 16:12:27 +0100
changeset 234655 5200b09176a2ee7c95bd1e60b4c2c62685189662
parent 234654 5a2808b6675bf3d24646a72172e1e0801a70a8ca
child 234656 521f1e9a8b6813cb270cc68512f38d0910d7fdcd
push id7450
push usernpierron@mozilla.com
push dateThu, 08 Jan 2015 15:12:52 +0000
treeherdermozilla-aurora@5200b09176a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, sylvestre
bugs1112632
milestone36.0a2
Bug 1112632 - Flag object/array allocations as implictly used as we are removing uses. r=jandem a=sylvestre
js/src/jit/ScalarReplacement.cpp
--- a/js/src/jit/ScalarReplacement.cpp
+++ b/js/src/jit/ScalarReplacement.cpp
@@ -249,16 +249,19 @@ class ObjectMemoryView : public MDefinit
 
 const char *ObjectMemoryView::phaseName = "Scalar Replacement of Object";
 
 ObjectMemoryView::ObjectMemoryView(TempAllocator &alloc, MInstruction *obj)
   : alloc_(alloc),
     obj_(obj),
     startBlock_(obj->block())
 {
+    // Annotate the instruction such that we do not replace it by a
+    // Magic(JS_OPTIMIZED_OUT) in case of removed uses.
+    obj_->setImplicitlyUsedUnchecked();
 }
 
 MBasicBlock *
 ObjectMemoryView::startingBlock()
 {
     return startBlock_;
 }
 
@@ -702,16 +705,19 @@ const char *ArrayMemoryView::phaseName =
 ArrayMemoryView::ArrayMemoryView(TempAllocator &alloc, MInstruction *arr)
   : alloc_(alloc),
     undefinedVal_(nullptr),
     length_(nullptr),
     arr_(arr),
     startBlock_(arr->block()),
     state_(nullptr)
 {
+    // Annotate the instruction such that we do not replace it by a
+    // Magic(JS_OPTIMIZED_OUT) in case of removed uses.
+    arr_->setImplicitlyUsedUnchecked();
 }
 
 MBasicBlock *
 ArrayMemoryView::startingBlock()
 {
     return startBlock_;
 }