Bug 1508280: Remove no longer used invalidity bits in ICs r=jandem
authorMatthew Gaudet <mgaudet@mozilla.com>
Mon, 19 Nov 2018 15:38:17 +0000
changeset 446986 6b61884fd13dc5ad46cf05461e7145f3e0337e43
parent 446985 f4c51b6f89cbf940b0f5f65fcbec258c42c1064e
child 446987 c08a99b4dd84516a9163f256e52e25cc9b8a273b
push id73274
push usermgaudet@mozilla.com
push dateMon, 19 Nov 2018 16:01:34 +0000
treeherderautoland@6b61884fd13d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1508280
milestone65.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 1508280: Remove no longer used invalidity bits in ICs r=jandem Differential Revision: https://phabricator.services.mozilla.com/D12300
js/src/jit/BaselineIC.cpp
js/src/jit/BaselineIC.h
js/src/jit/ICState.h
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -1126,20 +1126,16 @@ DoTypeMonitorFallback(JSContext* cx, Bas
         MOZ_ASSERT(pc == script->code());
         types = TypeScript::ThisTypes(script);
         TypeScript::SetThis(cx, script, value);
     } else {
         types = TypeScript::BytecodeTypes(script, pc);
         TypeScript::Monitor(cx, script, pc, types, value);
     }
 
-    if (MOZ_UNLIKELY(stub->invalid())) {
-        return true;
-    }
-
     return stub->addMonitorStubForValue(cx, frame, types, value);
 }
 
 typedef bool (*DoTypeMonitorFallbackFn)(JSContext*, BaselineFrame*, ICTypeMonitor_Fallback*,
                                         HandleValue, MutableHandleValue);
 static const VMFunction DoTypeMonitorFallbackInfo =
     FunctionInfo<DoTypeMonitorFallbackFn>(DoTypeMonitorFallback, "DoTypeMonitorFallback",
                                           TailCall);
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -673,24 +673,16 @@ class ICFallbackStub : public ICStub
     inline ICEntry* icEntry() const {
         return icEntry_;
     }
 
     inline size_t numOptimizedStubs() const {
         return state_.numOptimizedStubs();
     }
 
-    void setInvalid() {
-        state_.setInvalid();
-    }
-
-    bool invalid() const {
-        return state_.invalid();
-    }
-
     ICState& state() {
         return state_;
     }
 
     // The icEntry and lastStubPtrAddr_ fields can't be initialized when the stub is
     // created since the stub is created at compile time, and we won't know the IC entry
     // address until after compile when the JitScript is created.  This method
     // allows these fields to be fixed up at that point.
@@ -698,17 +690,16 @@ class ICFallbackStub : public ICStub
         MOZ_ASSERT(icEntry_ == nullptr);
         MOZ_ASSERT(lastStubPtrAddr_ == nullptr);
         icEntry_ = icEntry;
         lastStubPtrAddr_ = icEntry_->addressOfFirstStub();
     }
 
     // Add a new stub to the IC chain terminated by this fallback stub.
     void addNewStub(ICStub* stub) {
-        MOZ_ASSERT(!invalid());
         MOZ_ASSERT(*lastStubPtrAddr_ == this);
         MOZ_ASSERT(stub->next() == nullptr);
         stub->setNext(this);
         *lastStubPtrAddr_ = stub;
         lastStubPtrAddr_ = stub->addressOfNext();
         state_.trackAttached();
     }
 
@@ -1237,45 +1228,41 @@ class ICTypeMonitor_Fallback : public IC
     // Address of the last monitor stub's field pointing to this
     // fallback monitor stub.  This will get updated when new
     // monitor stubs are created and added.
     ICStub** lastMonitorStubPtrAddr_;
 
     // Count of optimized type monitor stubs in this chain.
     uint32_t numOptimizedMonitorStubs_ : 7;
 
-    uint32_t invalid_ : 1;
-
     // Whether this has a fallback stub referring to the IC entry.
     bool hasFallbackStub_ : 1;
 
     // Index of 'this' or argument which is being monitored, or BYTECODE_INDEX
     // if this is monitoring the types of values pushed at some bytecode.
     uint32_t argumentIndex_ : 23;
 
     static const uint32_t BYTECODE_INDEX = (1 << 23) - 1;
 
     ICTypeMonitor_Fallback(JitCode* stubCode, ICMonitoredFallbackStub* mainFallbackStub,
                            uint32_t argumentIndex)
       : ICStub(ICStub::TypeMonitor_Fallback, stubCode),
         mainFallbackStub_(mainFallbackStub),
         firstMonitorStub_(thisFromCtor()),
         lastMonitorStubPtrAddr_(nullptr),
         numOptimizedMonitorStubs_(0),
-        invalid_(false),
         hasFallbackStub_(mainFallbackStub != nullptr),
         argumentIndex_(argumentIndex)
     { }
 
     ICTypeMonitor_Fallback* thisFromCtor() {
         return this;
     }
 
     void addOptimizedMonitorStub(ICStub* stub) {
-        MOZ_ASSERT(!invalid());
         stub->setNext(this);
 
         MOZ_ASSERT((lastMonitorStubPtrAddr_ != nullptr) ==
                    (numOptimizedMonitorStubs_ || !hasFallbackStub_));
 
         if (lastMonitorStubPtrAddr_) {
             *lastMonitorStubPtrAddr_ = stub;
         }
@@ -1321,24 +1308,16 @@ class ICTypeMonitor_Fallback : public IC
     static inline size_t offsetOfFirstMonitorStub() {
         return offsetof(ICTypeMonitor_Fallback, firstMonitorStub_);
     }
 
     inline uint32_t numOptimizedMonitorStubs() const {
         return numOptimizedMonitorStubs_;
     }
 
-    void setInvalid() {
-        invalid_ = 1;
-    }
-
-    bool invalid() const {
-        return invalid_;
-    }
-
     inline bool monitorsThis() const {
         return argumentIndex_ == 0;
     }
 
     inline bool monitorsArgument(uint32_t* pargument) const {
         if (argumentIndex_ > 0 && argumentIndex_ < BYTECODE_INDEX) {
             *pargument = argumentIndex_ - 1;
             return true;
--- a/js/src/jit/ICState.h
+++ b/js/src/jit/ICState.h
@@ -30,19 +30,16 @@ class ICState
     Mode mode_;
 
     // Number of optimized stubs currently attached to this IC.
     uint8_t numOptimizedStubs_;
 
     // Number of times we failed to attach a stub.
     uint8_t numFailures_;
 
-    // This is only used for shared Baseline ICs and stored here to save space.
-    bool invalid_ : 1;
-
     static const size_t MaxOptimizedStubs = 6;
 
     void transition(Mode mode) {
         MOZ_ASSERT(mode > mode_);
         mode_ = mode;
         numFailures_ = 0;
     }
 
@@ -52,17 +49,16 @@ class ICState
                       "numFailures_/maxFailures should fit in uint8_t");
         size_t res = 5 + size_t(40) * numOptimizedStubs_;
         MOZ_ASSERT(res <= UINT8_MAX, "numFailures_ should not overflow");
         return res;
     }
 
   public:
     ICState()
-      : invalid_(false)
     {
         reset();
     }
 
     Mode mode() const { return mode_; }
     size_t numOptimizedStubs() const { return numOptimizedStubs_; }
     bool hasFailures() const { return (numFailures_ != 0); }
 
@@ -71,19 +67,16 @@ class ICState
         // because old-style baseline ICs may attach more stubs than
         // MaxOptimizedStubs allows.
         if (mode_ == Mode::Generic || JitOptions.disableCacheIR) {
             return false;
         }
         return true;
     }
 
-    bool invalid() const { return invalid_; }
-    void setInvalid() { invalid_ = true; }
-
     // If this returns true, we transitioned to a new mode and the caller
     // should discard all stubs.
     MOZ_MUST_USE MOZ_ALWAYS_INLINE bool maybeTransition() {
         // Note: we cannot assert that numOptimizedStubs_ <= MaxOptimizedStubs
         // because old-style baseline ICs may attach more stubs than
         // MaxOptimizedStubs allows.
         if (mode_ == Mode::Generic) {
             return false;