Title: [208588] trunk
Revision
208588
Author
cdu...@apple.com
Date
2016-11-11 08:50:57 -0800 (Fri, 11 Nov 2016)

Log Message

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

Modified Paths

Removed Paths

Diff

Modified: trunk/JSTests/ChangeLog (208587 => 208588)


--- trunk/JSTests/ChangeLog	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/JSTests/ChangeLog	2016-11-11 16:50:57 UTC (rev 208588)
@@ -1,3 +1,21 @@
+2016-11-11  Chris Dumez  <cdu...@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  <sbar...@apple.com>
 
         We should have a more concise way of determining when we're varargs calling a function using rest parameters

Deleted: trunk/JSTests/microbenchmarks/pure-get-by-id-cse-2.js (208587 => 208588)


--- trunk/JSTests/microbenchmarks/pure-get-by-id-cse-2.js	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/JSTests/microbenchmarks/pure-get-by-id-cse-2.js	2016-11-11 16:50:57 UTC (rev 208588)
@@ -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);

Deleted: trunk/JSTests/microbenchmarks/pure-get-by-id-cse.js (208587 => 208588)


--- trunk/JSTests/microbenchmarks/pure-get-by-id-cse.js	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/JSTests/microbenchmarks/pure-get-by-id-cse.js	2016-11-11 16:50:57 UTC (rev 208588)
@@ -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);

Deleted: trunk/JSTests/stress/pure-get-by-id-cse-correctness.js (208587 => 208588)


--- trunk/JSTests/stress/pure-get-by-id-cse-correctness.js	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/JSTests/stress/pure-get-by-id-cse-correctness.js	2016-11-11 16:50:57 UTC (rev 208588)
@@ -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);

Deleted: trunk/JSTests/stress/pure-get-by-id-on-non-object.js (208587 => 208588)


--- trunk/JSTests/stress/pure-get-by-id-on-non-object.js	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/JSTests/stress/pure-get-by-id-on-non-object.js	2016-11-11 16:50:57 UTC (rev 208588)
@@ -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);

Modified: trunk/Source/_javascript_Core/ChangeLog (208587 => 208588)


--- trunk/Source/_javascript_Core/ChangeLog	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-11-11 16:50:57 UTC (rev 208588)
@@ -1,3 +1,21 @@
+2016-11-11  Chris Dumez  <cdu...@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  <sbar...@apple.com>
 
         We should have a more concise way of determining when we're varargs calling a function using rest parameters

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -48,7 +48,6 @@
     , resetByGC(false)
     , tookSlowPath(false)
     , everConsidered(false)
-    , didSideEffects(false)
 {
 }
 
@@ -217,10 +216,7 @@
     }
 
     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:

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h (208587 => 208588)


--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -46,8 +46,7 @@
 
 enum class AccessType : int8_t {
     Get,
-    TryGet,
-    PureGet,
+    GetPure,
     Put,
     In
 };
@@ -206,7 +205,6 @@
     bool resetByGC : 1;
     bool tookSlowPath : 1;
     bool everConsidered : 1;
-    bool didSideEffects : 1;
 };
 
 inline CodeOrigin getStructureStubInfoCodeOrigin(StructureStubInfo& structureStubInfo)

Modified: trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGAbstractInterpreterInlines.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -2151,7 +2151,6 @@
         forNode(node).makeHeapTop();
         break;
 
-    case PureGetById:
     case GetById:
     case GetByIdFlush: {
         if (!node->prediction()) {
@@ -2183,10 +2182,7 @@
             }
         }
 
-        if (node->op() == PureGetById)
-            clobberStructures(clobberLimit);
-        else
-            clobberWorld(node->origin.semantic, clobberLimit);
+        clobberWorld(node->origin.semantic, clobberLimit);
         forNode(node).makeHeapTop();
         break;
     }

Modified: trunk/Source/_javascript_Core/dfg/DFGArrayMode.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGArrayMode.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGArrayMode.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -152,11 +152,10 @@
 
 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(

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -3345,19 +3345,10 @@
     }
     
     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 @@
 
             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 @@
                 // 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 @@
                 }
             }
 
-            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 @@
                 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);
 

Modified: trunk/Source/_javascript_Core/dfg/DFGClobberize.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGClobberize.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -502,35 +502,6 @@
         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:

Modified: trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGConstantFoldingPhase.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -449,7 +449,6 @@
                 break;
             }
         
-            case PureGetById:
             case GetById:
             case GetByIdFlush: {
                 Edge childEdge = node->child1();
@@ -461,9 +460,6 @@
                 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 @@
                 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;
                 

Modified: trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGDoesGC.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -266,7 +266,6 @@
     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:

Modified: trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGFixupPhase.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -1206,7 +1206,6 @@
             break;
         }
 
-        case PureGetById:
         case GetById:
         case GetByIdFlush: {
             // FIXME: This should be done in the ByteCodeParser based on reading the

Modified: trunk/Source/_javascript_Core/dfg/DFGNode.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGNode.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -534,7 +534,7 @@
     
     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 @@
     
     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 @@
         switch (op()) {
         case TryGetById:
         case GetById:
-        case PureGetById:
         case GetByIdFlush:
         case GetByIdWithThis:
         case PutById:
@@ -1439,7 +1438,6 @@
         case ArithCeil:
         case ArithTrunc:
         case GetDirectPname:
-        case PureGetById:
         case GetById:
         case GetByIdFlush:
         case GetByIdWithThis:

Modified: trunk/Source/_javascript_Core/dfg/DFGNodeType.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGNodeType.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -185,7 +185,6 @@
     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) \

Modified: trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -682,7 +682,6 @@
         case RegExpTest:
         case StringReplace:
         case StringReplaceRegExp:
-        case PureGetById:
         case GetById:
         case GetByIdFlush:
         case GetByIdWithThis:

Modified: trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGSafeToExecute.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -199,7 +199,6 @@
     case TryGetById:
     case DeleteById:
     case DeleteByVal:
-    case PureGetById:
     case GetById:
     case GetByIdWithThis:
     case GetByValWithThis:

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -1000,7 +1000,7 @@
 
         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 @@
 
         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::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());

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -721,7 +721,6 @@
     void compileDeleteById(Node*);
     void compileDeleteByVal(Node*);
     void compileTryGetById(Node*);
-    void compilePureGetById(Node*);
     void compileIn(Node*);
     
     void nonSpeculativeNonPeepholeCompareNullOrUndefined(Edge operand);

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -210,8 +210,6 @@
     J_JITOperation_ESsiJI getByIdFunction;
     if (type == AccessType::Get)
         getByIdFunction = operationGetByIdOptimize;
-    else if (type == AccessType::PureGet)
-        getByIdFunction = operationPureGetByIdOptimize;
     else
         getByIdFunction = operationTryGetByIdOptimize;
 
@@ -4281,11 +4279,6 @@
         break;
     }
 
-    case PureGetById: {
-        compilePureGetById(node);
-        break;
-    }
-
     case GetByIdWithThis: {
         JSValueOperand base(this, node->child1());
         JSValueRegs baseRegs = base.jsValueRegs();

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -179,11 +179,8 @@
         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 @@
         break;
     }
 
-    case PureGetById: {
-        compilePureGetById(node);
-        break;
-    }
-
     case GetByIdFlush: {
         if (!node->prediction()) {
             terminateSpeculativeExecution(InadequateCoverage, JSValueRegs(), 0);

Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -179,7 +179,6 @@
     case NewArrayWithSize:
     case TryGetById:
     case GetById:
-    case PureGetById:
     case GetByIdFlush:
     case GetByIdWithThis:
     case ToThis:

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -623,11 +623,8 @@
             compilePutStructure();
             break;
         case TryGetById:
-            compileGetById(AccessType::TryGet);
+            compileGetById(AccessType::GetPure);
             break;
-        case PureGetById:
-            compileGetById(AccessType::PureGet);
-            break;
         case GetById:
         case GetByIdFlush:
             compileGetById(AccessType::Get);
@@ -2804,7 +2801,7 @@
     
     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 @@
             J_JITOperation_EJI getByIdFunction;
             if (type == AccessType::Get)
                 getByIdFunction = operationGetByIdGeneric;
-            else if (type == AccessType::PureGet)
-                getByIdFunction = operationPureGetByIdGeneric;
             else
                 getByIdFunction = operationTryGetByIdGeneric;
 
@@ -9094,8 +9089,6 @@
                         J_JITOperation_ESsiJI optimizationFunction;
                         if (type == AccessType::Get)
                             optimizationFunction = operationGetByIdOptimize;
-                        else if (type == AccessType::PureGet)
-                            optimizationFunction = operationPureGetByIdOptimize;
                         else
                             optimizationFunction = operationTryGetByIdOptimize;
 

Modified: trunk/Source/_javascript_Core/jit/JITOperations.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/JITOperations.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/JITOperations.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -75,35 +75,6 @@
 
 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 @@
     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 @@
     return JSValue::encode(slot.getPureResult());
 }
 
+
 EncodedJSValue JIT_OPERATION operationTryGetByIdGeneric(ExecState* exec, EncodedJSValue base, UniquedStringImpl* uid)
 {
     VM* vm = &exec->vm();
@@ -272,7 +212,7 @@
     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 @@
     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 @@
     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();

Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/JITOperations.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -332,9 +332,6 @@
 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;

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -579,7 +579,7 @@
 
     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);

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -594,7 +594,7 @@
 
     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);

Modified: trunk/Source/_javascript_Core/jit/Repatch.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/Repatch.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/Repatch.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -136,34 +136,16 @@
 
 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 @@
                 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

Modified: trunk/Source/_javascript_Core/jit/Repatch.h (208587 => 208588)


--- trunk/Source/_javascript_Core/jit/Repatch.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/jit/Repatch.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -36,7 +36,6 @@
 
 enum class GetByIDKind {
     Normal,
-    Try,
     Pure
 };
 

Modified: trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.cpp (208587 => 208588)


--- trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.cpp	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.cpp	2016-11-11 16:50:57 UTC (rev 208588)
@@ -56,9 +56,6 @@
     case JettisonDueToOSRExit:
         out.print("OSRExit");
         return;
-    case JettisonDueToPureGetByIdEffects:
-        out.print("PureGetByIdEffects");
-        return;
     case JettisonDueToProfiledWatchpoint:
         out.print("ProfiledWatchpoint");
         return;

Modified: trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.h (208587 => 208588)


--- trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.h	2016-11-11 13:09:33 UTC (rev 208587)
+++ trunk/Source/_javascript_Core/profiler/ProfilerJettisonReason.h	2016-11-11 16:50:57 UTC (rev 208588)
@@ -35,7 +35,6 @@
     JettisonDueToBaselineLoopReoptimizationTrigger,
     JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail,
     JettisonDueToOSRExit,
-    JettisonDueToPureGetByIdEffects,
     JettisonDueToProfiledWatchpoint,
     JettisonDueToUnprofiledWatchpoint,
     JettisonDueToOldAge
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to