Bug 1249736 - Remove redundant StartType from MStart. r=jandem
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 25 Feb 2016 14:21:46 +0000
changeset 321913 97cf677ee66802809808a3e61a0ccb89542ca54e
parent 321912 426b1ede1e00a81078e491cd7544b200ace1f19f
child 321933 918df3a0bc1c4d07299e4f66274a7da923534577
child 321934 c815269c99c8e79455d0258ffb08fb7b480caba7
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1249736
milestone47.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 1249736 - Remove redundant StartType from MStart. r=jandem
js/src/jit/BaselineBailouts.cpp
js/src/jit/IonBuilder.cpp
js/src/jit/IonTypes.h
js/src/jit/LIR.h
js/src/jit/Lowering.cpp
js/src/jit/MIR.h
js/src/jit/MIRGraph.cpp
--- a/js/src/jit/BaselineBailouts.cpp
+++ b/js/src/jit/BaselineBailouts.cpp
@@ -1890,17 +1890,16 @@ jit::FinishBailoutToBaseline(BaselineBai
       case Bailout_NonBooleanInput:
       case Bailout_NonObjectInput:
       case Bailout_NonStringInput:
       case Bailout_NonSymbolInput:
       case Bailout_NonSimdBool32x4Input:
       case Bailout_NonSimdInt32x4Input:
       case Bailout_NonSimdFloat32x4Input:
       case Bailout_NonSharedTypedArrayInput:
-      case Bailout_InitialState:
       case Bailout_Debugger:
       case Bailout_UninitializedThis:
       case Bailout_BadDerivedConstructorReturn:
         // Do nothing.
         break;
 
       case Bailout_FirstExecution:
         // Do not return directly, as this was not frequent in the first place,
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -840,17 +840,17 @@ IonBuilder::build()
     // Initialize the arguments object slot to undefined if necessary.
     if (info().hasArguments()) {
         MInstruction* argsObj = MConstant::New(alloc(), UndefinedValue());
         current->add(argsObj);
         current->initSlot(info().argsObjSlot(), argsObj);
     }
 
     // Emit the start instruction, so we can begin real instructions.
-    current->add(MStart::New(alloc(), MStart::StartType_Default));
+    current->add(MStart::New(alloc()));
 
     // Guard against over-recursion. Do this before we start unboxing, since
     // this will create an OSI point that will read the incoming argument
     // values, which is nice to do before their last real use, to minimize
     // register/stack pressure.
     MCheckOverRecursed* check = MCheckOverRecursed::New(alloc());
     current->add(check);
     MResumePoint* entryRpCopy = MResumePoint::Copy(alloc(), current->entryResumePoint());
@@ -7579,17 +7579,17 @@ IonBuilder::newOsrPreheader(MBasicBlock*
         ptrdiff_t offset = BaselineFrame::reverseOffsetOfLocal(info().nlocals() + i);
 
         MOsrValue* osrv = MOsrValue::New(alloc(), entry, offset);
         osrBlock->add(osrv);
         osrBlock->initSlot(slot, osrv);
     }
 
     // Create an MStart to hold the first valid MResumePoint.
-    MStart* start = MStart::New(alloc(), MStart::StartType_Osr);
+    MStart* start = MStart::New(alloc());
     osrBlock->add(start);
 
     // MOsrValue instructions are infallible, so the first MResumePoint must
     // occur after they execute, at the point of the MStart.
     if (!resumeAt(start, loopEntry))
         return nullptr;
 
     // Link the same MResumePoint from the MStart to each MOsrValue.
--- a/js/src/jit/IonTypes.h
+++ b/js/src/jit/IonTypes.h
@@ -105,19 +105,16 @@ enum BailoutKind
     Bailout_NonSimdBool32x4Input,
     Bailout_NonSimdInt32x4Input,
     Bailout_NonSimdFloat32x4Input,
 
     // Atomic operations require shared memory, bail out if the typed array
     // maps unshared memory.
     Bailout_NonSharedTypedArrayInput,
 
-    // For the initial snapshot when entering a function.
-    Bailout_InitialState,
-
     // We hit a |debugger;| statement.
     Bailout_Debugger,
 
     // |this| used uninitialized in a derived constructor
     Bailout_UninitializedThis,
 
     // Derived constructors must return object or undefined
     Bailout_BadDerivedConstructorReturn,
@@ -217,18 +214,16 @@ BailoutKindString(BailoutKind kind)
       case Bailout_NonSimdBool32x4Input:
         return "Bailout_NonSimdBool32x4Input";
       case Bailout_NonSimdInt32x4Input:
         return "Bailout_NonSimdInt32x4Input";
       case Bailout_NonSimdFloat32x4Input:
         return "Bailout_NonSimdFloat32x4Input";
       case Bailout_NonSharedTypedArrayInput:
         return "Bailout_NonSharedTypedArrayInput";
-      case Bailout_InitialState:
-        return "Bailout_InitialState";
       case Bailout_Debugger:
         return "Bailout_Debugger";
       case Bailout_UninitializedThis:
         return "Bailout_UninitializedThis";
       case Bailout_BadDerivedConstructorReturn:
         return "Bailout_BadDerivedConstructorReturn";
       case Bailout_FirstExecution:
         return "Bailout_FirstExecution";
--- a/js/src/jit/LIR.h
+++ b/js/src/jit/LIR.h
@@ -1307,19 +1307,16 @@ class LSnapshot : public TempObject
     }
     void setBailoutId(BailoutId id) {
         MOZ_ASSERT(bailoutId_ == INVALID_BAILOUT_ID);
         bailoutId_ = id;
     }
     BailoutKind bailoutKind() const {
         return bailoutKind_;
     }
-    void setBailoutKind(BailoutKind kind) {
-        bailoutKind_ = kind;
-    }
     void rewriteRecoveredInput(LUse input);
 };
 
 struct SafepointSlotEntry {
     // Flag indicating whether this is a slot in the stack or argument space.
     uint32_t stack:1;
 
     // Byte offset of the slot, as in LStackSlot or LArgument.
@@ -1828,18 +1825,16 @@ class LIRGraph
     size_t numConstants() const {
         return constantPool_.length();
     }
     Value* constantPool() {
         return &constantPool_[0];
     }
     void setEntrySnapshot(LSnapshot* snapshot) {
         MOZ_ASSERT(!entrySnapshot_);
-        MOZ_ASSERT(snapshot->bailoutKind() == Bailout_InitialState);
-        snapshot->setBailoutKind(Bailout_ArgumentCheck);
         entrySnapshot_ = snapshot;
     }
     LSnapshot* entrySnapshot() const {
         MOZ_ASSERT(entrySnapshot_);
         return entrySnapshot_;
     }
     bool noteNeedsSafepoint(LInstruction* ins);
     size_t numNonCallSafepoints() const {
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -1742,22 +1742,23 @@ LIRGenerator::visitFromCharCode(MFromCha
     LFromCharCode* lir = new(alloc()) LFromCharCode(useRegister(code));
     define(lir, ins);
     assignSafepoint(lir, ins);
 }
 
 void
 LIRGenerator::visitStart(MStart* start)
 {
+    LStart* lir = new(alloc()) LStart;
+
     // Create a snapshot that captures the initial state of the function.
-    LStart* lir = new(alloc()) LStart;
-    assignSnapshot(lir, Bailout_InitialState);
-
-    if (start->startType() == MStart::StartType_Default && lir->snapshot())
+    assignSnapshot(lir, Bailout_ArgumentCheck);
+    if (start->block()->graph().entryBlock() == start->block())
         lirGraph_.setEntrySnapshot(lir->snapshot());
+
     add(lir);
 }
 
 void
 LIRGenerator::visitNop(MNop* nop)
 {
 }
 
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -1255,37 +1255,19 @@ class MVariadicT : public T
 };
 
 typedef MVariadicT<MInstruction> MVariadicInstruction;
 
 // Generates an LSnapshot without further effect.
 class MStart : public MNullaryInstruction
 {
   public:
-    enum StartType {
-        StartType_Default,
-        StartType_Osr
-    };
-
-  private:
-    StartType startType_;
-
-  private:
-    explicit MStart(StartType startType)
-      : startType_(startType)
-    { }
-
-  public:
     INSTRUCTION_HEADER(Start)
-    static MStart* New(TempAllocator& alloc, StartType startType) {
-        return new(alloc) MStart(startType);
-    }
-
-    StartType startType() {
-        return startType_;
+    static MStart* New(TempAllocator& alloc) {
+        return new(alloc) MStart();
     }
 };
 
 // Instruction marking on entrypoint for on-stack replacement.
 // OSR may occur at loop headers (at JSOP_TRACE).
 // There is at most one MOsrEntry per MIRGraph.
 class MOsrEntry : public MNullaryInstruction
 {
--- a/js/src/jit/MIRGraph.cpp
+++ b/js/src/jit/MIRGraph.cpp
@@ -598,18 +598,16 @@ MBasicBlock::shimmySlots(int discardDept
         slots_[stackPosition_ + i] = slots_[stackPosition_ + i + 1];
 
     --stackPosition_;
 }
 
 bool
 MBasicBlock::linkOsrValues(MStart* start)
 {
-    MOZ_ASSERT(start->startType() == MStart::StartType_Osr);
-
     MResumePoint* res = start->resumePoint();
 
     for (uint32_t i = 0; i < stackDepth(); i++) {
         MDefinition* def = slots_[i];
         MInstruction* cloneRp = nullptr;
         if (i == info().scopeChainSlot()) {
             if (def->isOsrScopeChain())
                 cloneRp = def->toOsrScopeChain();