Bug 1112632 - Flag object/array allocations as implictly used as we are removing uses. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Fri, 19 Dec 2014 14:23:04 +0100
changeset 220520 f4eba33e0d61602f0f1a406c7b4f434519067300
parent 220519 df379644b52fa9f4a7d619ee9085d098bc8983f4
child 220521 9cb1c9b8d65edb8a945ce0ac241398b88774f32b
push id53126
push usernpierron@mozilla.com
push dateFri, 19 Dec 2014 13:23:23 +0000
treeherdermozilla-inbound@f4eba33e0d61 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1112632
milestone37.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 1112632 - Flag object/array allocations as implictly used as we are removing uses. r=jandem
js/src/jit/ScalarReplacement.cpp
--- a/js/src/jit/ScalarReplacement.cpp
+++ b/js/src/jit/ScalarReplacement.cpp
@@ -247,16 +247,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())
 {
+    // Annoatte 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_;
 }
 
@@ -694,16 +697,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_;
 }