Unreviewed, rolling out r208117 and r208160.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 16:50:57 +0000 (16:50 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 16:50:57 +0000 (16:50 +0000)
Regressed Speedometer by >1.5%

Reverted changesets:

"We should have a way of profiling when a get_by_id is pure
and to emit a PureGetById in the DFG/FTL"
https://bugs.webkit.org/show_bug.cgi?id=163305
http://trac.webkit.org/changeset/208117

"Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing
out"
https://bugs.webkit.org/show_bug.cgi?id=164227
http://trac.webkit.org/changeset/208160

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208588 268f45cc-cd09-0410-ab3c-d52691b4dbfc

33 files changed:
JSTests/ChangeLog
JSTests/microbenchmarks/pure-get-by-id-cse-2.js [deleted file]
JSTests/microbenchmarks/pure-get-by-id-cse.js [deleted file]
JSTests/stress/pure-get-by-id-cse-correctness.js [deleted file]
JSTests/stress/pure-get-by-id-on-non-object.js [deleted file]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGArrayMode.cpp
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGClobberize.h
Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp
Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGNodeType.h
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
Source/JavaScriptCore/dfg/DFGSafeToExecute.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/ftl/FTLCapabilities.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/JITOperations.h
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
Source/JavaScriptCore/jit/Repatch.cpp
Source/JavaScriptCore/jit/Repatch.h
Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp
Source/JavaScriptCore/profiler/ProfilerJettisonReason.h

index f489af0..839f306 100644 (file)
@@ -1,3 +1,21 @@
+2016-11-11  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r208117 and r208160.
+
+        Regressed Speedometer by >1.5%
+
+        Reverted changesets:
+
+        "We should have a way of profiling when a get_by_id is pure
+        and to emit a PureGetById in the DFG/FTL"
+        https://bugs.webkit.org/show_bug.cgi?id=163305
+        http://trac.webkit.org/changeset/208117
+
+        "Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing
+        out"
+        https://bugs.webkit.org/show_bug.cgi?id=164227
+        http://trac.webkit.org/changeset/208160
+
 2016-11-11  Saam Barati  <sbarati@apple.com>
 
         We should have a more concise way of determining when we're varargs calling a function using rest parameters
diff --git a/JSTests/microbenchmarks/pure-get-by-id-cse-2.js b/JSTests/microbenchmarks/pure-get-by-id-cse-2.js
deleted file mode 100644 (file)
index 6a624a3..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-function foo(o, c) {
-    if (o.f) {
-        let sum = 0;
-        for (let i = 0; i < c; i++)
-            sum += o.f;
-        return sum;
-    }
-}
-noInline(foo);
-
-let start = Date.now();
-let objects = [];
-const objectCount = 20;
-for (let i = 0; i < objectCount; i++) {
-    let obj = {};
-    for (let j = 0; j < i * 2; j++) {
-        obj["j" + j] = j;
-    }
-    obj.f = 20;
-    objects.push(obj);
-}
-
-for (let i = 0; i < 10000; i++) {
-    let obj = objects[i % objects.length];
-    foo(obj, 25);
-}
-
-const verbose = false;
-if (verbose)
-    print(Date.now() - start);
diff --git a/JSTests/microbenchmarks/pure-get-by-id-cse.js b/JSTests/microbenchmarks/pure-get-by-id-cse.js
deleted file mode 100644 (file)
index f6f84d8..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-function foo(o) {
-    if (o.f)
-        return o.f + o.f + o.f + o.f; 
-}
-noInline(foo);
-
-let start = Date.now();
-let objects = [];
-const objectCount = 20;
-for (let i = 0; i < objectCount; i++) {
-    let obj = {};
-    for (let j = 0; j < i * 2; j++) {
-        obj["j" + j] = j;
-    }
-    obj.f = 20;
-    objects.push(obj);
-}
-
-for (let i = 0; i < 10000000; i++) {
-    let obj = objects[i % objects.length];
-    foo(obj);
-}
-
-const verbose = false;
-if (verbose)
-    print(Date.now() - start);
diff --git a/JSTests/stress/pure-get-by-id-cse-correctness.js b/JSTests/stress/pure-get-by-id-cse-correctness.js
deleted file mode 100644 (file)
index 1559ba3..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-function assert(b) {
-    if (!b)
-        throw new Error("Bad assertion")
-}
-noInline(assert);
-
-function foo(o1, o2) {
-    let a = o1.f1;
-    let b = o2.f2;
-    return a + o1.f1 + b;
-}
-noInline(foo);
-
-let objs = [];
-const count = 80;
-for (let i = 0; i < count; i++) {
-    let o = {};
-    for (let j = 0; j < i; ++j) {
-        o[j + "J"] = j;
-    }
-    o.f1 = 20;
-    o.f2 = 40;
-    objs.push(o);
-}
-
-for (let i = 0; i < 1000; i++) {
-    let o1 = objs[i % objs.length];
-    let o2 = objs[(i + 1) % objs.length];
-    assert(foo(o1, o2) === 80);
-}
-
-let o = objs[count - 1];
-let numCalls = 0;
-Object.defineProperty(o, "f1", {
-    get() { ++numCalls; return 25; }
-});
-
-assert(foo(o, objs[count - 2]) === 90);
-assert(numCalls === 2);
diff --git a/JSTests/stress/pure-get-by-id-on-non-object.js b/JSTests/stress/pure-get-by-id-on-non-object.js
deleted file mode 100644 (file)
index aa8dad3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-function assert(b) {
-    if (!b)
-        throw new Error("Bad assertion.")
-}
-
-function foo(o) {
-    assert(o.length === o.length);
-    return o.length;
-}
-noInline(foo);
-
-let items = [];
-const numItems = 30;
-for (let i = 0; i < numItems; i++) {
-    let o = {};
-    for (let j = 0; j < i; j++) {
-        o[j + "j"] = j;
-    }
-    o.length = 2;
-    items.push(o);
-} 
-
-items.push("st");
-
-for (let i = 0; i < 10000; i++)
-    assert(foo(items[i % items.length]) === 2);
-
-Number.prototype.length = 2;
-items.push(42);
-
-for (let i = 0; i < 100000; i++)
-    assert(foo(items[i % items.length]) === 2);
index ad16434..1230dad 100644 (file)
@@ -1,3 +1,21 @@
+2016-11-11  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r208117 and r208160.
+
+        Regressed Speedometer by >1.5%
+
+        Reverted changesets:
+
+        "We should have a way of profiling when a get_by_id is pure
+        and to emit a PureGetById in the DFG/FTL"
+        https://bugs.webkit.org/show_bug.cgi?id=163305
+        http://trac.webkit.org/changeset/208117
+
+        "Debug JSC test microbenchmarks/pure-get-by-id-cse-2.js timing
+        out"
+        https://bugs.webkit.org/show_bug.cgi?id=164227
+        http://trac.webkit.org/changeset/208160
+
 2016-11-11  Saam Barati  <sbarati@apple.com>
 
         We should have a more concise way of determining when we're varargs calling a function using rest parameters
index ba75947..38e5cef 100644 (file)
@@ -48,7 +48,6 @@ StructureStubInfo::StructureStubInfo(AccessType accessType)
     , resetByGC(false)
     , tookSlowPath(false)
     , everConsidered(false)
-    , didSideEffects(false)
 {
 }
 
@@ -217,10 +216,7 @@ void StructureStubInfo::reset(CodeBlock* codeBlock)
     }
 
     switch (accessType) {
-    case AccessType::TryGet:
-        resetGetByID(codeBlock, *this, GetByIDKind::Try);
-        break;
-    case AccessType::PureGet:
+    case AccessType::GetPure:
         resetGetByID(codeBlock, *this, GetByIDKind::Pure);
         break;
     case AccessType::Get:
index a117349..c225c05 100644 (file)
@@ -46,8 +46,7 @@ class PolymorphicAccess;
 
 enum class AccessType : int8_t {
     Get,
-    TryGet,
-    PureGet,
+    GetPure,
     Put,
     In
 };
@@ -206,7 +205,6 @@ public:
     bool resetByGC : 1;
     bool tookSlowPath : 1;
     bool everConsidered : 1;
-    bool didSideEffects : 1;
 };
 
 inline CodeOrigin getStructureStubInfoCodeOrigin(StructureStubInfo& structureStubInfo)
index 2a8c9ad..8c7e631 100644 (file)
@@ -2151,7 +2151,6 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
         forNode(node).makeHeapTop();
         break;
 
-    case PureGetById:
     case GetById:
     case GetByIdFlush: {
         if (!node->prediction()) {
@@ -2183,10 +2182,7 @@ bool AbstractInterpreter<AbstractStateType>::executeEffects(unsigned clobberLimi
             }
         }
 
-        if (node->op() == PureGetById)
-            clobberStructures(clobberLimit);
-        else
-            clobberWorld(node->origin.semantic, clobberLimit);
+        clobberWorld(node->origin.semantic, clobberLimit);
         forNode(node).makeHeapTop();
         break;
     }
index b79df2f..92c97f2 100644 (file)
@@ -152,11 +152,10 @@ ArrayMode ArrayMode::fromObserved(const ConcurrentJITLocker& locker, ArrayProfil
 
 static bool canBecomeGetArrayLength(Graph& graph, Node* node)
 {
-    if (node->op() == GetById || node->op() == PureGetById) {
-        auto uid = graph.identifiers()[node->identifierNumber()];
-        return uid == graph.m_vm.propertyNames->length.impl();
-    }
-    return false;
+    if (node->op() != GetById)
+        return false;
+    auto uid = graph.identifiers()[node->identifierNumber()];
+    return uid == graph.m_vm.propertyNames->length.impl();
 }
 
 ArrayMode ArrayMode::refine(
index 48918e3..39fc9a3 100644 (file)
@@ -3345,19 +3345,10 @@ void ByteCodeParser::handleGetById(
     }
     
     NodeType getById;
-    switch (type) {
-    case AccessType::Get:
+    if (type == AccessType::Get)
         getById = getByIdStatus.makesCalls() ? GetByIdFlush : GetById;
-        break;
-    case AccessType::TryGet:
+    else
         getById = TryGetById;
-        break;
-    case AccessType::PureGet:
-        getById = PureGetById;
-        break;
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
 
     // Special path for custom accessors since custom's offset does not have any meanings.
     // So, this is completely different from Simple one. But we have a chance to optimize it when we use DOMJIT.
@@ -4266,8 +4257,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
 
             Node* base = get(VirtualRegister(currentInstruction[2].u.operand));
             Node* property = get(VirtualRegister(currentInstruction[3].u.operand));
-            bool compileAsGetById = false;
-            bool compileAsPureGetById = false;
+            bool compiledAsGetById = false;
             GetByIdStatus getByIdStatus;
             unsigned identifierNumber = 0;
             {
@@ -4276,8 +4266,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
                 // FIXME: When the bytecode is not compiled in the baseline JIT, byValInfo becomes null.
                 // At that time, there is no information.
                 if (byValInfo && byValInfo->stubInfo && !byValInfo->tookSlowPath && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadIdent) && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCell)) {
-                    compileAsGetById = true;
-                    compileAsPureGetById = !byValInfo->stubInfo->didSideEffects;
+                    compiledAsGetById = true;
                     identifierNumber = m_graph.identifiers().ensure(byValInfo->cachedId.impl());
                     UniquedStringImpl* uid = m_graph.identifiers()[identifierNumber];
 
@@ -4295,10 +4284,9 @@ bool ByteCodeParser::parseBlock(unsigned limit)
                 }
             }
 
-            if (compileAsGetById) {
-                AccessType type = compileAsPureGetById ? AccessType::PureGet : AccessType::Get;
-                handleGetById(currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, type, OPCODE_LENGTH(op_get_by_val));
-            } else {
+            if (compiledAsGetById)
+                handleGetById(currentInstruction[1].u.operand, prediction, base, identifierNumber, getByIdStatus, AccessType::Get, OPCODE_LENGTH(op_get_by_val));
+            else {
                 ArrayMode arrayMode = getArrayMode(currentInstruction[4].u.arrayProfile, Array::Read);
                 Node* getByVal = addToGraph(GetByVal, OpInfo(arrayMode.asWord()), OpInfo(prediction), base, property);
                 m_exitOK = false; // GetByVal must be treated as if it clobbers exit state, since FixupPhase may make it generic.
@@ -4434,18 +4422,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
                 m_inlineStackTop->m_profiledBlock, m_dfgCodeBlock,
                 m_inlineStackTop->m_stubInfos, m_dfgStubInfos,
                 currentCodeOrigin(), uid);
-            AccessType type;
-            if (opcodeID == op_try_get_by_id) 
-                type = AccessType::TryGet;
-            else {
-                ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock);
-                unsigned bytecodeIndex = currentCodeOrigin().bytecodeIndex;
-                StructureStubInfo* info = m_inlineStackTop->m_stubInfos.get(CodeOrigin(bytecodeIndex));
-                if (info && info->everConsidered && !info->didSideEffects)
-                    type = AccessType::PureGet;
-                else
-                    type = AccessType::Get;
-            }
+            AccessType type = op_try_get_by_id == opcodeID ? AccessType::GetPure : AccessType::Get;
 
             unsigned opcodeLength = opcodeID == op_try_get_by_id ? OPCODE_LENGTH(op_try_get_by_id) : OPCODE_LENGTH(op_get_by_id);
 
index e3dd602..e12dfa8 100644 (file)
@@ -502,35 +502,6 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu
         def(HeapLocation(IsFunctionLoc, MiscFields, node->child1()), LazyNode(node));
         return;
         
-    case PureGetById: {
-        // We model what is allowed inside a getOwnPropertySlot(VMInquiry) here.
-        // Some getOwnPropertySlot implementations will lazily inject properties, which
-        // may change the object's structure.
-
-        read(JSCell_structureID);
-        read(JSCell_typeInfoFlags);
-        read(JSCell_typeInfoType);
-        read(JSCell_indexingType);
-        read(JSObject_butterfly);
-        read(MiscFields);
-
-        AbstractHeap propertyNameHeap(NamedProperties, node->identifierNumber());
-        read(propertyNameHeap);
-
-        write(JSCell_structureID);
-        write(JSCell_typeInfoFlags);
-
-        write(Watchpoint_fire);
-        write(MiscFields);
-
-        // This can happen if lazily adding fields to an object happens in getOwnPropertySlot
-        // and we need to allocate out of line storage.
-        write(JSObject_butterfly);
-
-        def(HeapLocation(NamedPropertyLoc, propertyNameHeap, node->child1()), LazyNode(node));
-        return;
-    }
-
     case GetById:
     case GetByIdFlush:
     case GetByIdWithThis:
index 321dcf9..0102d96 100644 (file)
@@ -449,7 +449,6 @@ private:
                 break;
             }
         
-            case PureGetById:
             case GetById:
             case GetByIdFlush: {
                 Edge childEdge = node->child1();
@@ -461,9 +460,6 @@ private:
                 m_interpreter.execute(indexInBlock); // Push CFA over this node after we get the state before.
                 alreadyHandled = true; // Don't allow the default constant folder to do things to this.
 
-                if (!Options::useAccessInlining())
-                    break;
-
                 if (baseValue.m_structure.isTop() || baseValue.m_structure.isClobbered()
                     || (node->child1().useKind() == UntypedUse || (baseValue.m_type & ~SpecCell)))
                     break;
@@ -519,9 +515,6 @@ private:
                 m_interpreter.execute(indexInBlock); // Push CFA over this node after we get the state before.
                 alreadyHandled = true; // Don't allow the default constant folder to do things to this.
 
-                if (!Options::useAccessInlining())
-                    break;
-
                 if (baseValue.m_structure.isTop() || baseValue.m_structure.isClobbered())
                     break;
                 
index 6ebd485..9e853e3 100644 (file)
@@ -266,7 +266,6 @@ bool doesGC(Graph& graph, Node* node)
     case ResolveScope:
         return false;
 
-    case PureGetById: // We are modeling getOwnPropertySlot here, which may GC because it is allowed to allocate things.
     case CreateActivation:
     case CreateDirectArguments:
     case CreateScopedArguments:
index b5ee780..cbf7b0e 100644 (file)
@@ -1206,7 +1206,6 @@ private:
             break;
         }
 
-        case PureGetById:
         case GetById:
         case GetByIdFlush: {
             // FIXME: This should be done in the ByteCodeParser based on reading the
index 269f626..1b21de9 100644 (file)
@@ -534,7 +534,7 @@ public:
     
     void convertToGetByOffset(StorageAccessData& data, Edge storage, Edge base)
     {
-        ASSERT(m_op == GetById || m_op == GetByIdFlush || m_op == PureGetById || m_op == MultiGetByOffset);
+        ASSERT(m_op == GetById || m_op == GetByIdFlush || m_op == MultiGetByOffset);
         m_opInfo = &data;
         children.setChild1(storage);
         children.setChild2(base);
@@ -544,7 +544,7 @@ public:
     
     void convertToMultiGetByOffset(MultiGetByOffsetData* data)
     {
-        ASSERT(m_op == GetById || m_op == GetByIdFlush || m_op == PureGetById);
+        ASSERT(m_op == GetById || m_op == GetByIdFlush);
         m_opInfo = data;
         child1().setUseKind(CellUse);
         m_op = MultiGetByOffset;
@@ -922,7 +922,6 @@ public:
         switch (op()) {
         case TryGetById:
         case GetById:
-        case PureGetById:
         case GetByIdFlush:
         case GetByIdWithThis:
         case PutById:
@@ -1439,7 +1438,6 @@ public:
         case ArithCeil:
         case ArithTrunc:
         case GetDirectPname:
-        case PureGetById:
         case GetById:
         case GetByIdFlush:
         case GetByIdWithThis:
index 01fb219..005af66 100644 (file)
@@ -185,7 +185,6 @@ namespace JSC { namespace DFG {
     macro(PutByVal, NodeMustGenerate | NodeHasVarArgs) \
     macro(PutByValAlias, NodeMustGenerate | NodeHasVarArgs) \
     macro(TryGetById, NodeResultJS) \
-    macro(PureGetById, NodeResultJS | NodeMustGenerate) \
     macro(GetById, NodeResultJS | NodeMustGenerate) \
     macro(GetByIdFlush, NodeResultJS | NodeMustGenerate) \
     macro(GetByIdWithThis, NodeResultJS | NodeMustGenerate) \
index 3b1a045..0907b9f 100644 (file)
@@ -682,7 +682,6 @@ private:
         case RegExpTest:
         case StringReplace:
         case StringReplaceRegExp:
-        case PureGetById:
         case GetById:
         case GetByIdFlush:
         case GetByIdWithThis:
index 3084c16..065e665 100644 (file)
@@ -199,7 +199,6 @@ bool safeToExecute(AbstractStateType& state, Graph& graph, Node* node)
     case TryGetById:
     case DeleteById:
     case DeleteByVal:
-    case PureGetById:
     case GetById:
     case GetByIdWithThis:
     case GetByValWithThis:
index 2193ef7..d308b98 100644 (file)
@@ -1000,7 +1000,7 @@ void SpeculativeJIT::compileTryGetById(Node* node)
 
         base.use();
 
-        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), JITCompiler::Jump(), NeedToSpill, AccessType::TryGet);
+        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), JITCompiler::Jump(), NeedToSpill, AccessType::GetPure);
 
         jsValueResult(resultRegs, node, DataFormatJS, UseChildrenCalledExplicitly);
         break;
@@ -1017,7 +1017,7 @@ void SpeculativeJIT::compileTryGetById(Node* node)
 
         JITCompiler::Jump notCell = m_jit.branchIfNotCell(baseRegs);
 
-        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), notCell, NeedToSpill, AccessType::TryGet);
+        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), notCell, NeedToSpill, AccessType::GetPure);
 
         jsValueResult(resultRegs, node, DataFormatJS, UseChildrenCalledExplicitly);
         break;
@@ -1029,42 +1029,6 @@ void SpeculativeJIT::compileTryGetById(Node* node)
     } 
 }
 
-void SpeculativeJIT::compilePureGetById(Node* node)
-{
-    ASSERT(node->op() == PureGetById);
-
-    switch (node->child1().useKind()) {
-    case CellUse: {
-        SpeculateCellOperand base(this, node->child1());
-        JSValueRegsTemporary result(this, Reuse, base);
-
-        JSValueRegs baseRegs = JSValueRegs::payloadOnly(base.gpr());
-        JSValueRegs resultRegs = result.regs();
-
-        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), JITCompiler::Jump(), NeedToSpill, AccessType::PureGet);
-
-        jsValueResult(resultRegs, node);
-        break;
-    }
-    case UntypedUse: {
-        JSValueOperand base(this, node->child1());
-        JSValueRegsTemporary result(this, Reuse, base);
-
-        JSValueRegs baseRegs = base.jsValueRegs();
-        JSValueRegs resultRegs = result.regs();
-    
-        JITCompiler::Jump notCell = m_jit.branchIfNotCell(baseRegs);
-    
-        cachedGetById(node->origin.semantic, baseRegs, resultRegs, node->identifierNumber(), notCell, NeedToSpill, AccessType::PureGet);
-    
-        jsValueResult(resultRegs, node);
-        break;
-    }
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
-}
-
 void SpeculativeJIT::compileIn(Node* node)
 {
     SpeculateCellOperand base(this, node->child2());
index b589e4b..c8c9ef3 100644 (file)
@@ -721,7 +721,6 @@ public:
     void compileDeleteById(Node*);
     void compileDeleteByVal(Node*);
     void compileTryGetById(Node*);
-    void compilePureGetById(Node*);
     void compileIn(Node*);
     
     void nonSpeculativeNonPeepholeCompareNullOrUndefined(Edge operand);
index 2539f31..a4e7c10 100644 (file)
@@ -210,8 +210,6 @@ void SpeculativeJIT::cachedGetById(
     J_JITOperation_ESsiJI getByIdFunction;
     if (type == AccessType::Get)
         getByIdFunction = operationGetByIdOptimize;
-    else if (type == AccessType::PureGet)
-        getByIdFunction = operationPureGetByIdOptimize;
     else
         getByIdFunction = operationTryGetByIdOptimize;
 
@@ -4281,11 +4279,6 @@ void SpeculativeJIT::compile(Node* node)
         break;
     }
 
-    case PureGetById: {
-        compilePureGetById(node);
-        break;
-    }
-
     case GetByIdWithThis: {
         JSValueOperand base(this, node->child1());
         JSValueRegs baseRegs = base.jsValueRegs();
index 67b6fc0..c12143a 100644 (file)
@@ -179,11 +179,8 @@ void SpeculativeJIT::cachedGetById(CodeOrigin codeOrigin, GPRReg baseGPR, GPRReg
         slowCases.append(slowPathTarget);
     slowCases.append(gen.slowPathJump());
     
-    auto slowPathFunction = type == AccessType::Get ? operationGetByIdOptimize :
-        type == AccessType::PureGet ? operationPureGetByIdOptimize : operationTryGetByIdOptimize;
-
     auto slowPath = slowPathCall(
-        slowCases, this, slowPathFunction,
+        slowCases, this, type == AccessType::Get ? operationGetByIdOptimize : operationTryGetByIdOptimize,
         spillMode, ExceptionCheckRequirement::CheckNeeded,
         resultGPR, gen.stubInfo(), baseGPR, identifierUID(identifierNumber));
     
@@ -4248,11 +4245,6 @@ void SpeculativeJIT::compile(Node* node)
         break;
     }
 
-    case PureGetById: {
-        compilePureGetById(node);
-        break;
-    }
-
     case GetByIdFlush: {
         if (!node->prediction()) {
             terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), 0);
index 03ce816..bce38a6 100644 (file)
@@ -179,7 +179,6 @@ inline CapabilityLevel canCompile(Node* node)
     case NewArrayWithSize:
     case TryGetById:
     case GetById:
-    case PureGetById:
     case GetByIdFlush:
     case GetByIdWithThis:
     case ToThis:
index 4771c48..fd8a90b 100644 (file)
@@ -623,10 +623,7 @@ private:
             compilePutStructure();
             break;
         case TryGetById:
-            compileGetById(AccessType::TryGet);
-            break;
-        case PureGetById:
-            compileGetById(AccessType::PureGet);
+            compileGetById(AccessType::GetPure);
             break;
         case GetById:
         case GetByIdFlush:
@@ -2804,7 +2801,7 @@ private:
     
     void compileGetById(AccessType type)
     {
-        ASSERT(type == AccessType::Get || type == AccessType::TryGet || type == AccessType::PureGet);
+        ASSERT(type == AccessType::Get || type == AccessType::GetPure);
         switch (m_node->child1().useKind()) {
         case CellUse: {
             setJSValue(getById(lowCell(m_node->child1()), type));
@@ -2831,8 +2828,6 @@ private:
             J_JITOperation_EJI getByIdFunction;
             if (type == AccessType::Get)
                 getByIdFunction = operationGetByIdGeneric;
-            else if (type == AccessType::PureGet)
-                getByIdFunction = operationPureGetByIdGeneric;
             else
                 getByIdFunction = operationTryGetByIdGeneric;
 
@@ -9094,8 +9089,6 @@ private:
                         J_JITOperation_ESsiJI optimizationFunction;
                         if (type == AccessType::Get)
                             optimizationFunction = operationGetByIdOptimize;
-                        else if (type == AccessType::PureGet)
-                            optimizationFunction = operationPureGetByIdOptimize;
                         else
                             optimizationFunction = operationTryGetByIdOptimize;
 
index f207362..c74260c 100644 (file)
 
 namespace JSC {
 
-ALWAYS_INLINE static EncodedJSValue pureGetByIdCommon(VM& vm, ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid, const std::function<void (const PropertySlot&, const Identifier&)>& function = [] (const PropertySlot&, const Identifier&) { })
-{
-    Identifier ident = Identifier::fromUid(&vm, uid);
-    JSValue baseValue = JSValue::decode(base);
-
-    ASSERT(JITCode::isOptimizingJIT(exec->codeBlock()->jitType()));
-
-    PropertySlot slot(baseValue, PropertySlot::InternalMethodType::VMInquiry);
-    return JSValue::encode(baseValue.getPropertySlot(exec, ident, slot, [&] (bool, PropertySlot&) -> JSValue {
-        bool willDoSideEffects = !(slot.isValue() || slot.isUnset()) || slot.isTaintedByOpaqueObject();
-        if (UNLIKELY(willDoSideEffects)) {
-            {
-                CodeOrigin codeOrigin = exec->codeOrigin();
-                CodeBlock* currentBaseline = baselineCodeBlockForOriginAndBaselineCodeBlock(codeOrigin, exec->codeBlock()->alternative());
-                CodeOrigin originBytecodeIndex = CodeOrigin(codeOrigin.bytecodeIndex); // Since we're searching in the baseline, we just care about bytecode index.
-                ConcurrentJITLocker locker(currentBaseline->m_lock);
-                if (StructureStubInfo* stub = currentBaseline->findStubInfo(originBytecodeIndex))
-                    stub->didSideEffects = true;
-            }
-
-            exec->codeBlock()->jettison(Profiler::JettisonDueToPureGetByIdEffects);
-            return baseValue.get(exec, uid);
-        }
-
-        function(slot, ident);
-        return slot.isValue() ? slot.getValue(exec, ident) : jsUndefined();
-    }));
-}
-
 extern "C" {
 
 #if COMPILER(MSVC)
@@ -199,38 +170,6 @@ int32_t JIT_OPERATION operationConstructArityCheck(ExecState* exec)
     return missingArgCount;
 }
 
-EncodedJSValue JIT_OPERATION operationPureGetByIdGeneric(ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid)
-{
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
-
-    return pureGetByIdCommon(*vm, exec, base, uid);
-}
-
-EncodedJSValue JIT_OPERATION operationPureGetById(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
-{
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
-
-    stubInfo->tookSlowPath = true;
-
-    return pureGetByIdCommon(*vm, exec, base, uid);
-}
-
-EncodedJSValue JIT_OPERATION operationPureGetByIdOptimize(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
-{
-    VM* vm = &exec->vm();
-    NativeCallFrameTracer tracer(vm, exec);
-
-    return pureGetByIdCommon(*vm, exec, base, uid, 
-        [&] (const PropertySlot& slot, const Identifier& ident) {
-            ASSERT((slot.isValue() || slot.isUnset()) && !slot.isTaintedByOpaqueObject());
-            JSValue baseValue = JSValue::decode(base);
-            if (stubInfo->considerCaching(baseValue.structureOrNull()))
-                repatchGetByID(exec, baseValue, ident, slot, *stubInfo, GetByIDKind::Pure);
-        });
-}
-
 EncodedJSValue JIT_OPERATION operationTryGetById(ExecState* exec, StructureStubInfo* stubInfo, EncodedJSValue base, UniquedStringImpl* uid)
 {
     VM* vm = &exec->vm();
@@ -245,6 +184,7 @@ EncodedJSValue JIT_OPERATION operationTryGetById(ExecState* exec, StructureStubI
     return JSValue::encode(slot.getPureResult());
 }
 
+
 EncodedJSValue JIT_OPERATION operationTryGetByIdGeneric(ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid)
 {
     VM* vm = &exec->vm();
@@ -272,7 +212,7 @@ EncodedJSValue JIT_OPERATION operationTryGetByIdOptimize(ExecState* exec, Struct
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     if (stubInfo->considerCaching(baseValue.structureOrNull()) && !slot.isTaintedByOpaqueObject() && (slot.isCacheableValue() || slot.isCacheableGetter() || slot.isUnset()))
-        repatchGetByID(exec, baseValue, ident, slot, *stubInfo, GetByIDKind::Try);
+        repatchGetByID(exec, baseValue, ident, slot, *stubInfo, GetByIDKind::Pure);
 
     return JSValue::encode(slot.getPureResult());
 }
@@ -291,10 +231,7 @@ EncodedJSValue JIT_OPERATION operationGetById(ExecState* exec, StructureStubInfo
     Identifier ident = Identifier::fromUid(vm, uid);
     
     LOG_IC((ICEvent::OperationGetById, baseValue.classInfoOrNull(), ident));
-    JSValue result = baseValue.get(exec, ident, slot);
-    bool willDoSideEffects = !(slot.isValue() || slot.isUnset()) || slot.isTaintedByOpaqueObject();
-    stubInfo->didSideEffects |= willDoSideEffects;
-    return JSValue::encode(result);
+    return JSValue::encode(baseValue.get(exec, ident, slot));
 }
 
 EncodedJSValue JIT_OPERATION operationGetByIdGeneric(ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid)
@@ -323,9 +260,6 @@ EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState* exec, Structure
     LOG_IC((ICEvent::OperationGetByIdOptimize, baseValue.classInfoOrNull(), ident));
 
     return JSValue::encode(baseValue.getPropertySlot(exec, ident, [&] (bool found, PropertySlot& slot) -> JSValue {
-        bool willDoSideEffects = !(slot.isValue() || slot.isUnset()) || slot.isTaintedByOpaqueObject();
-        stubInfo->didSideEffects |= willDoSideEffects;
-
         if (stubInfo->considerCaching(baseValue.structureOrNull()))
             repatchGetByID(exec, baseValue, ident, slot, *stubInfo, GetByIDKind::Normal);
         return found ? slot.getValue(exec, ident) : jsUndefined();
index ebc07d9..590b3c5 100644 (file)
@@ -332,9 +332,6 @@ int32_t JIT_OPERATION operationConstructArityCheck(ExecState*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationTryGetById(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationTryGetByIdGeneric(ExecState*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationTryGetByIdOptimize(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationPureGetById(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationPureGetByIdGeneric(ExecState*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
-EncodedJSValue JIT_OPERATION operationPureGetByIdOptimize(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationGetById(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationGetByIdGeneric(ExecState*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
 EncodedJSValue JIT_OPERATION operationGetByIdOptimize(ExecState*, StructureStubInfo*, EncodedJSValue, UniquedStringImpl*) WTF_INTERNAL;
index e39d16c..d7424f1 100644 (file)
@@ -579,7 +579,7 @@ void JIT::emit_op_try_get_by_id(Instruction* currentInstruction)
 
     JITGetByIdGenerator gen(
         m_codeBlock, CodeOrigin(m_bytecodeOffset), CallSiteIndex(m_bytecodeOffset), RegisterSet::stubUnavailableRegisters(),
-        ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::TryGet);
+        ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::GetPure);
     gen.generateFastPath(*this);
     addSlowCase(gen.slowPathJump());
     m_getByIds.append(gen);
index bc34b30..5f14e90 100644 (file)
@@ -594,7 +594,7 @@ void JIT::emit_op_try_get_by_id(Instruction* currentInstruction)
 
     JITGetByIdGenerator gen(
         m_codeBlock, CodeOrigin(m_bytecodeOffset), CallSiteIndex(currentInstruction), RegisterSet::stubUnavailableRegisters(),
-        ident->impl(), JSValueRegs::payloadOnly(regT0), JSValueRegs(regT1, regT0), AccessType::TryGet);
+        ident->impl(), JSValueRegs::payloadOnly(regT0), JSValueRegs(regT1, regT0), AccessType::GetPure);
     gen.generateFastPath(*this);
     addSlowCase(gen.slowPathJump());
     m_getByIds.append(gen);
index 9a7efc9..baa5b7d 100644 (file)
@@ -136,34 +136,16 @@ static bool forceICFailure(ExecState*)
 
 inline J_JITOperation_ESsiJI appropriateOptimizingGetByIdFunction(GetByIDKind kind)
 {
-    switch (kind) {
-    case GetByIDKind::Normal:
+    if (kind == GetByIDKind::Normal)
         return operationGetByIdOptimize;
-    case GetByIDKind::Try:
-        return operationTryGetByIdOptimize;
-    case GetByIDKind::Pure:
-        return operationPureGetByIdOptimize;
-    default:
-        break;
-    }
-    ASSERT_NOT_REACHED();
-    return operationGetByIdOptimize;
+    return operationTryGetByIdOptimize;
 }
 
 inline J_JITOperation_ESsiJI appropriateGenericGetByIdFunction(GetByIDKind kind)
 {
-    switch (kind) {
-    case GetByIDKind::Normal:
+    if (kind == GetByIDKind::Normal)
         return operationGetById;
-    case GetByIDKind::Try:
-        return operationTryGetById;
-    case GetByIDKind::Pure:
-        return operationPureGetById;
-    default:
-        break;
-    }
-    ASSERT_NOT_REACHED();
-    return operationGetById;
+    return operationTryGetById;
 }
 
 static InlineCacheAction tryCacheGetByID(ExecState* exec, JSValue baseValue, const Identifier& propertyName, const PropertySlot& slot, StructureStubInfo& stubInfo, GetByIDKind kind)
@@ -291,16 +273,6 @@ static InlineCacheAction tryCacheGetByID(ExecState* exec, JSValue baseValue, con
                 type = AccessCase::Load;
             else if (slot.isUnset())
                 type = AccessCase::Miss;
-            else
-                RELEASE_ASSERT_NOT_REACHED();
-
-            newCase = AccessCase::tryGet(vm, codeBlock, type, offset, structure, conditionSet, loadTargetFromProxy, slot.watchpointSet());
-        } else if (kind == GetByIDKind::Try) {
-            AccessCase::AccessType type;
-            if (slot.isCacheableValue())
-                type = AccessCase::Load;
-            else if (slot.isUnset())
-                type = AccessCase::Miss;
             else if (slot.isCacheableGetter())
                 type = AccessCase::GetGetter;
             else
index e858744..e176768 100644 (file)
@@ -36,7 +36,6 @@ namespace JSC {
 
 enum class GetByIDKind {
     Normal,
-    Try,
     Pure
 };
 
index 5c93533..3751fed 100644 (file)
@@ -56,9 +56,6 @@ void printInternal(PrintStream& out, JettisonReason reason)
     case JettisonDueToOSRExit:
         out.print("OSRExit");
         return;
-    case JettisonDueToPureGetByIdEffects:
-        out.print("PureGetByIdEffects");
-        return;
     case JettisonDueToProfiledWatchpoint:
         out.print("ProfiledWatchpoint");
         return;
index 2fe9313..745964f 100644 (file)
@@ -35,7 +35,6 @@ enum JettisonReason {
     JettisonDueToBaselineLoopReoptimizationTrigger,
     JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail,
     JettisonDueToOSRExit,
-    JettisonDueToPureGetByIdEffects,
     JettisonDueToProfiledWatchpoint,
     JettisonDueToUnprofiledWatchpoint,
     JettisonDueToOldAge