Backed out changeset d3f86880276d (bug 1341261) to complete backout for frequently failing spidermonkey cgc's js/src/jit-test/tests/asm.js/testBug1117235.js on Linux x64 debug. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sun, 09 Jul 2017 10:25:15 +0200
changeset 606107 9623b08f4af3b12fb8fd14318cf89c13a45b54aa
parent 606106 9b47420e3a0a1243f48a8bbcb121c33e49ab809c
child 606108 77c6beaa9053ee6ec2d3e8ecf6eca305d251e2ca
push id67608
push userkgupta@mozilla.com
push dateMon, 10 Jul 2017 11:23:08 +0000
reviewersbackout
bugs1341261, 1117235
milestone56.0a1
backs outd3f86880276d8fcfc27136137f73ae4e8a8a3894
Backed out changeset d3f86880276d (bug 1341261) to complete backout for frequently failing spidermonkey cgc's js/src/jit-test/tests/asm.js/testBug1117235.js on Linux x64 debug. r=backout
js/src/jit/BaselineCacheIRCompiler.cpp
js/src/jit/CacheIR.cpp
js/src/jit/CacheIR.h
js/src/jit/CodeGenerator.cpp
js/src/jit/IonCacheIRCompiler.cpp
js/src/jit/IonIC.cpp
js/src/jit/SharedIC.cpp
--- a/js/src/jit/BaselineCacheIRCompiler.cpp
+++ b/js/src/jit/BaselineCacheIRCompiler.cpp
@@ -1911,17 +1911,16 @@ BaselineCacheIRCompiler::init(CacheKind 
     AllocatableGeneralRegisterSet available(ICStubCompiler::availableGeneralRegs(numInputsInRegs));
 
     switch (kind) {
       case CacheKind::GetProp:
       case CacheKind::TypeOf:
         MOZ_ASSERT(numInputs == 1);
         allocator.initInputLocation(0, R0);
         break;
-      case CacheKind::Compare:
       case CacheKind::GetElem:
       case CacheKind::GetPropSuper:
       case CacheKind::SetProp:
       case CacheKind::In:
       case CacheKind::HasOwn:
         MOZ_ASSERT(numInputs == 2);
         allocator.initInputLocation(0, R0);
         allocator.initInputLocation(1, R1);
@@ -1982,17 +1981,16 @@ jit::AttachBaselineCacheIRStub(JSContext
     // unlimited number of stubs.
     MOZ_ASSERT(stub->numOptimizedStubs() < MaxOptimizedCacheIRStubs);
 
     enum class CacheIRStubKind { Regular, Monitored, Updated };
 
     uint32_t stubDataOffset;
     CacheIRStubKind stubKind;
     switch (kind) {
-      case CacheKind::Compare:
       case CacheKind::In:
       case CacheKind::HasOwn:
       case CacheKind::BindName:
       case CacheKind::TypeOf:
         stubDataOffset = sizeof(ICCacheIR_Regular);
         stubKind = CacheIRStubKind::Regular;
         break;
       case CacheKind::GetProp:
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -3691,31 +3691,8 @@ CallIRGenerator::tryAttachStub()
 
     if (strategy == OptStrategy::StringSplit) {
         return tryAttachStringSplit();
     }
 
     MOZ_ASSERT(strategy == OptStrategy::None);
     return false;
 }
-
-CompareIRGenerator::CompareIRGenerator(JSContext* cx, HandleScript script, jsbytecode* pc,
-                                       ICState::Mode mode, JSOp op,
-                                       HandleValue lhsVal, HandleValue rhsVal)
-  : IRGenerator(cx, script, pc, CacheKind::Compare, mode),
-    op_(op), lhsVal_(lhsVal), rhsVal_(rhsVal)
-{ }
-
-bool
-CompareIRGenerator::tryAttachStub()
-{
-    MOZ_ASSERT(cacheKind_ == CacheKind::Compare);
-    MOZ_ASSERT(IsEqualityOp(op_) ||
-               op_ == JSOP_LE || op_ == JSOP_LT ||
-               op_ == JSOP_GE || op_ == JSOP_GT);
-
-    AutoAssertNoPendingException aanpe(cx_);
-
-    ValOperandId lhsId(writer.setInputOperandId(0));
-    ValOperandId rhsId(writer.setInputOperandId(1));
-
-    return false;
-}
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -140,17 +140,16 @@ class TypedOperandId : public OperandId
     _(GetPropSuper)         \
     _(GetElemSuper)         \
     _(SetProp)              \
     _(SetElem)              \
     _(BindName)             \
     _(In)                   \
     _(HasOwn)               \
     _(TypeOf)               \
-    _(Compare)              \
     _(Call)
 
 enum class CacheKind : uint8_t
 {
 #define DEFINE_KIND(kind) kind,
     CACHE_IR_KINDS(DEFINE_KIND)
 #undef DEFINE_KIND
 };
@@ -1410,25 +1409,12 @@ class MOZ_RAII CallIRGenerator : public 
     CallIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode,
                     uint32_t argc, HandleValue callee, HandleValue thisval,
                     HandleValueArray args);
 
     OptStrategy getOptStrategy(bool* optimizeAfterCall = nullptr);
     bool tryAttachStub();
 };
 
-class MOZ_RAII CompareIRGenerator : public IRGenerator
-{
-    JSOp op_;
-    HandleValue lhsVal_;
-    HandleValue rhsVal_;
-
-  public:
-    CompareIRGenerator(JSContext* cx, HandleScript, jsbytecode* pc, ICState::Mode mode,
-                       JSOp op, HandleValue lhsVal, HandleValue rhsVal);
-
-    bool tryAttachStub();
-};
-
 } // namespace jit
 } // namespace js
 
 #endif /* jit_CacheIR_h */
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -281,17 +281,16 @@ CodeGenerator::visitOutOfLineICFallback(
 
         StoreRegisterTo(hasOwnIC->output()).generate(this);
         restoreLiveIgnore(lir, StoreRegisterTo(hasOwnIC->output()).clobbered());
 
         masm.jump(ool->rejoin());
         return;
       }
       case CacheKind::Call:
-      case CacheKind::Compare:
       case CacheKind::TypeOf:
       case CacheKind::GetPropSuper:
       case CacheKind::GetElemSuper:
         MOZ_CRASH("Unsupported IC");
     }
     MOZ_CRASH();
 }
 
--- a/js/src/jit/IonCacheIRCompiler.cpp
+++ b/js/src/jit/IonCacheIRCompiler.cpp
@@ -465,17 +465,16 @@ IonCacheIRCompiler::init()
         outputUnchecked_.emplace(TypedOrValueRegister(MIRType::Boolean, AnyRegister(output)));
 
         MOZ_ASSERT(numInputs == 2);
         allocator.initInputLocation(0, ic->id());
         allocator.initInputLocation(1, ic->value());
         break;
       }
       case CacheKind::Call:
-      case CacheKind::Compare:
       case CacheKind::TypeOf:
       case CacheKind::GetPropSuper:
       case CacheKind::GetElemSuper:
         MOZ_CRASH("Unsupported IC");
     }
 
     if (liveRegs_)
         liveFloatRegs_ = LiveFloatRegisterSet(liveRegs_->fpus());
--- a/js/src/jit/IonIC.cpp
+++ b/js/src/jit/IonIC.cpp
@@ -48,17 +48,16 @@ IonIC::scratchRegisterForEntryJump()
         return asGetNameIC()->temp();
       case CacheKind::BindName:
         return asBindNameIC()->temp();
       case CacheKind::In:
         return asInIC()->temp();
       case CacheKind::HasOwn:
         return asHasOwnIC()->output();
       case CacheKind::Call:
-      case CacheKind::Compare:
       case CacheKind::TypeOf:
       case CacheKind::GetPropSuper:
       case CacheKind::GetElemSuper:
         MOZ_CRASH("Unsupported IC");
     }
 
     MOZ_CRASH("Invalid kind");
 }
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -1400,17 +1400,17 @@ DoCompareFallback(JSContext* cx, void* p
 
     // Don't pass lhs/rhs directly, we need the original values when
     // generating stubs.
     RootedValue lhsCopy(cx, lhs);
     RootedValue rhsCopy(cx, rhs);
 
     // Perform the compare operation.
     bool out;
-    switch (op) {
+    switch(op) {
       case JSOP_LT:
         if (!LessThan(cx, &lhsCopy, &rhsCopy, &out))
             return false;
         break;
       case JSOP_LE:
         if (!LessThanOrEqual(cx, &lhsCopy, &rhsCopy, &out))
             return false;
         break;
@@ -1451,29 +1451,16 @@ DoCompareFallback(JSContext* cx, void* p
 
     // Check to see if a new stub should be generated.
     if (stub->numOptimizedStubs() >= ICCompare_Fallback::MAX_OPTIMIZED_STUBS) {
         // TODO: Discard all stubs in this IC and replace with inert megamorphic stub.
         // But for now we just bail.
         return true;
     }
 
-    if (engine ==  ICStubEngine::Baseline) {
-        RootedScript script(cx, info.outerScript(cx));
-        CompareIRGenerator gen(cx, script, pc, stub->state().mode(), op, lhs, rhs);
-        bool attached = false;
-        if (gen.tryAttachStub()) {
-            ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), gen.cacheKind(),
-                                                        engine, script, stub, &attached);
-            if (newStub)
-                 JitSpew(JitSpew_BaselineIC, "  Attached CacheIR stub");
-            return true;
-        }
-    }
-
     // Try to generate new stubs.
     if (lhs.isInt32() && rhs.isInt32()) {
         JitSpew(JitSpew_BaselineIC, "  Generating %s(Int32, Int32) stub", CodeName[op]);
         ICCompare_Int32::Compiler compiler(cx, op, engine);
         ICStub* int32Stub = compiler.getStub(compiler.getStubSpace(info.outerScript(cx)));
         if (!int32Stub)
             return false;