From 375025f95c95c49e23df523ccee9e855d5de22a3 Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Thu, 26 Feb 2015 16:18:41 +0100 Subject: [PATCH] Bug 1129313 - Scalar Replacement: Remove PostWriteBarrier at the same time as the stores. r=h4writer --- js/src/jit/ScalarReplacement.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/js/src/jit/ScalarReplacement.cpp b/js/src/jit/ScalarReplacement.cpp index 6a82c13bc8a..6db4b160727 100644 --- a/js/src/jit/ScalarReplacement.cpp +++ b/js/src/jit/ScalarReplacement.cpp @@ -143,6 +143,9 @@ IsObjectEscaped(MInstruction *ins, JSObject *objDefault = nullptr) JitSpewDef(JitSpew_Escape, " is escaped by\n", def); return true; + case MDefinition::Op_PostWriteBarrier: + break; + case MDefinition::Op_Slots: { #ifdef DEBUG // Assert that MSlots are only used by MStoreSlot and MLoadSlot. @@ -245,6 +248,7 @@ class ObjectMemoryView : public MDefinitionVisitorDefaultNoop void visitObjectState(MObjectState *ins); void visitStoreFixedSlot(MStoreFixedSlot *ins); void visitLoadFixedSlot(MLoadFixedSlot *ins); + void visitPostWriteBarrier(MPostWriteBarrier *ins); void visitStoreSlot(MStoreSlot *ins); void visitLoadSlot(MLoadSlot *ins); void visitGuardShape(MGuardShape *ins); @@ -451,6 +455,17 @@ ObjectMemoryView::visitLoadFixedSlot(MLoadFixedSlot *ins) ins->block()->discard(ins); } +void +ObjectMemoryView::visitPostWriteBarrier(MPostWriteBarrier *ins) +{ + // Skip loads made on other objects. + if (ins->object() != obj_) + return; + + // Remove original instruction. + ins->block()->discard(ins); +} + void ObjectMemoryView::visitStoreSlot(MStoreSlot *ins) {