Bug 1479603 - [Part 5] Relocate Baseline fallback stubs to BaselineIC.h r=jandem
authorMatthew Gaudet <mgaudet@mozilla.com>
Sun, 19 Aug 2018 09:29:19 -0700
changeset 481413 68b7d42b931d9b0e7be37ad0098eb1b013e6cdca
parent 481412 92b4cab82784725d2a0b83157cab605e8d3db2ea
child 481414 4bdec5f4de8812ff5b5bb2df9473345744744a40
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersjandem
bugs1479603
milestone63.0a1
Bug 1479603 - [Part 5] Relocate Baseline fallback stubs to BaselineIC.h r=jandem
js/src/jit/BaselineIC.h
js/src/jit/SharedIC.h
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -493,16 +493,72 @@ class ICGetIntrinsic_Fallback : public I
         { }
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICGetIntrinsic_Fallback>(space, getStubCode());
         }
     };
 };
 
+// GetProp
+//     JSOP_GETPROP
+//     JSOP_GETPROP_SUPER
+
+class ICGetProp_Fallback : public ICMonitoredFallbackStub
+{
+    friend class ICStubSpace;
+
+    explicit ICGetProp_Fallback(JitCode* stubCode)
+      : ICMonitoredFallbackStub(ICStub::GetProp_Fallback, stubCode)
+    { }
+
+  public:
+    static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
+    static const size_t ACCESSED_GETTER_BIT = 1;
+
+    void noteUnoptimizableAccess() {
+        extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
+    }
+    bool hadUnoptimizableAccess() const {
+        return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
+    }
+
+    void noteAccessedGetter() {
+        extra_ |= (1u << ACCESSED_GETTER_BIT);
+    }
+    bool hasAccessedGetter() const {
+        return extra_ & (1u << ACCESSED_GETTER_BIT);
+    }
+
+    class Compiler : public ICStubCompiler {
+      protected:
+        CodeOffset bailoutReturnOffset_;
+        bool hasReceiver_;
+        MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
+        void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) override;
+
+        virtual int32_t getKey() const override {
+            return static_cast<int32_t>(engine_) |
+                  (static_cast<int32_t>(kind) << 1) |
+                  (static_cast<int32_t>(hasReceiver_) << 17);
+        }
+
+      public:
+        explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
+          : ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
+            hasReceiver_(hasReceiver)
+        { }
+
+        ICStub* getStub(ICStubSpace* space) override {
+            return newStub<ICGetProp_Fallback>(space, getStubCode());
+        }
+    };
+};
+
+
 // SetProp
 //     JSOP_SETPROP
 //     JSOP_SETNAME
 //     JSOP_SETGNAME
 //     JSOP_INITPROP
 
 class ICSetProp_Fallback : public ICFallbackStub
 {
@@ -1501,16 +1557,60 @@ class ICUnaryArith_Fallback : public ICF
         {}
 
         ICStub* getStub(ICStubSpace* space) override {
             return newStub<ICUnaryArith_Fallback>(space, getStubCode());
         }
     };
 };
 
+// Compare
+//      JSOP_LT
+//      JSOP_LE
+//      JSOP_GT
+//      JSOP_GE
+//      JSOP_EQ
+//      JSOP_NE
+//      JSOP_STRICTEQ
+//      JSOP_STRICTNE
+
+class ICCompare_Fallback : public ICFallbackStub
+{
+    friend class ICStubSpace;
+
+    explicit ICCompare_Fallback(JitCode* stubCode)
+      : ICFallbackStub(ICStub::Compare_Fallback, stubCode) {}
+
+  public:
+    static const uint32_t MAX_OPTIMIZED_STUBS = 8;
+
+    static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
+    void noteUnoptimizableAccess() {
+        extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
+    }
+    bool hadUnoptimizableAccess() const {
+        return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
+    }
+
+    // Compiler for this stub kind.
+    class Compiler : public ICStubCompiler {
+      protected:
+        MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
+
+      public:
+        explicit Compiler(JSContext* cx, Engine engine)
+          : ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
+
+        ICStub* getStub(ICStubSpace* space) override {
+            return newStub<ICCompare_Fallback>(space, getStubCode());
+        }
+    };
+};
+
+
 // BinaryArith
 //      JSOP_ADD, JSOP_SUB, JSOP_MUL, JOP_DIV, JSOP_MOD
 //      JSOP_BITAND, JSOP_BITXOR, JSOP_BITOR
 //      JSOP_LSH, JSOP_RSH, JSOP_URSH
 
 class ICBinaryArith_Fallback : public ICFallbackStub
 {
     friend class ICStubSpace;
--- a/js/src/jit/SharedIC.h
+++ b/js/src/jit/SharedIC.h
@@ -1558,107 +1558,12 @@ class ICTypeMonitor_AnyValue : public IC
         { }
 
         ICTypeMonitor_AnyValue* getStub(ICStubSpace* space) override {
             return newStub<ICTypeMonitor_AnyValue>(space, getStubCode());
         }
     };
 };
 
-// Compare
-//      JSOP_LT
-//      JSOP_LE
-//      JSOP_GT
-//      JSOP_GE
-//      JSOP_EQ
-//      JSOP_NE
-//      JSOP_STRICTEQ
-//      JSOP_STRICTNE
-
-class ICCompare_Fallback : public ICFallbackStub
-{
-    friend class ICStubSpace;
-
-    explicit ICCompare_Fallback(JitCode* stubCode)
-      : ICFallbackStub(ICStub::Compare_Fallback, stubCode) {}
-
-  public:
-    static const uint32_t MAX_OPTIMIZED_STUBS = 8;
-
-    static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
-    void noteUnoptimizableAccess() {
-        extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
-    }
-    bool hadUnoptimizableAccess() const {
-        return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
-    }
-
-    // Compiler for this stub kind.
-    class Compiler : public ICStubCompiler {
-      protected:
-        MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
-
-      public:
-        explicit Compiler(JSContext* cx, Engine engine)
-          : ICStubCompiler(cx, ICStub::Compare_Fallback, engine) {}
-
-        ICStub* getStub(ICStubSpace* space) override {
-            return newStub<ICCompare_Fallback>(space, getStubCode());
-        }
-    };
-};
-
-
-class ICGetProp_Fallback : public ICMonitoredFallbackStub
-{
-    friend class ICStubSpace;
-
-    explicit ICGetProp_Fallback(JitCode* stubCode)
-      : ICMonitoredFallbackStub(ICStub::GetProp_Fallback, stubCode)
-    { }
-
-  public:
-    static const size_t UNOPTIMIZABLE_ACCESS_BIT = 0;
-    static const size_t ACCESSED_GETTER_BIT = 1;
-
-    void noteUnoptimizableAccess() {
-        extra_ |= (1u << UNOPTIMIZABLE_ACCESS_BIT);
-    }
-    bool hadUnoptimizableAccess() const {
-        return extra_ & (1u << UNOPTIMIZABLE_ACCESS_BIT);
-    }
-
-    void noteAccessedGetter() {
-        extra_ |= (1u << ACCESSED_GETTER_BIT);
-    }
-    bool hasAccessedGetter() const {
-        return extra_ & (1u << ACCESSED_GETTER_BIT);
-    }
-
-    class Compiler : public ICStubCompiler {
-      protected:
-        CodeOffset bailoutReturnOffset_;
-        bool hasReceiver_;
-        MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm) override;
-        void postGenerateStubCode(MacroAssembler& masm, Handle<JitCode*> code) override;
-
-        virtual int32_t getKey() const override {
-            return static_cast<int32_t>(engine_) |
-                  (static_cast<int32_t>(kind) << 1) |
-                  (static_cast<int32_t>(hasReceiver_) << 17);
-        }
-
-      public:
-        explicit Compiler(JSContext* cx, Engine engine, bool hasReceiver = false)
-          : ICStubCompiler(cx, ICStub::GetProp_Fallback, engine),
-            hasReceiver_(hasReceiver)
-        { }
-
-        ICStub* getStub(ICStubSpace* space) override {
-            return newStub<ICGetProp_Fallback>(space, getStubCode());
-        }
-    };
-};
-
 } // namespace jit
 } // namespace js
 
 #endif /* jit_SharedIC_h */