Title: [253263] trunk/Source/_javascript_Core
Revision
253263
Author
[email protected]
Date
2019-12-07 14:25:18 -0800 (Sat, 07 Dec 2019)

Log Message

Unreviewed. Roll out r253201. It was not a progression on any benchmarks, and was 8% slower on JetStream 2 ML.

* _javascript_Core.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.rb:
* bytecode/GetByValHistory.h: Added.
(JSC::GetByValHistory::observeNonUID):
(JSC::GetByValHistory::observe):
(JSC::GetByValHistory::count const):
(JSC::GetByValHistory::filter const):
(JSC::GetByValHistory::update):
* bytecode/PointerHistory.h: Removed.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseGetById):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGGraph.h:
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetById):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
* generator/DSL.rb:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/OptionsList.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (253262 => 253263)


--- trunk/Source/_javascript_Core/ChangeLog	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-12-07 22:25:18 UTC (rev 253263)
@@ -1,3 +1,41 @@
+2019-12-07  Saam Barati  <[email protected]>
+
+        Unreviewed. Roll out r253201. It was not a progression on any benchmarks, and was 8% slower on JetStream 2 ML.
+
+        * _javascript_Core.xcodeproj/project.pbxproj:
+        * bytecode/BytecodeList.rb:
+        * bytecode/GetByValHistory.h: Added.
+        (JSC::GetByValHistory::observeNonUID):
+        (JSC::GetByValHistory::observe):
+        (JSC::GetByValHistory::count const):
+        (JSC::GetByValHistory::filter const):
+        (JSC::GetByValHistory::update):
+        * bytecode/PointerHistory.h: Removed.
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseGetById):
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGGraph.h:
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::compileGetById):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetById):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
+        * generator/DSL.rb:
+        * jit/JITPropertyAccess.cpp:
+        (JSC::JIT::emit_op_try_get_by_id):
+        (JSC::JIT::emitSlow_op_try_get_by_id):
+        (JSC::JIT::emit_op_get_by_id_direct):
+        (JSC::JIT::emitSlow_op_get_by_id_direct):
+        (JSC::JIT::emit_op_get_by_id):
+        (JSC::JIT::emitSlow_op_get_by_id):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * runtime/OptionsList.h:
+
 2019-12-07  Mark Lam  <[email protected]>
 
         Remove invalid assertion in FTL's allocateJSArray().

Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (253262 => 253263)


--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2019-12-07 22:25:18 UTC (rev 253263)
@@ -889,6 +889,7 @@
 		451539B912DC994500EF7AC4 /* Yarr.h in Headers */ = {isa = PBXBuildFile; fileRef = 451539B812DC994500EF7AC4 /* Yarr.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		473DA4A4764C45FE871B0485 /* DefinePropertyAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 169948EDE68D4054B01EF797 /* DefinePropertyAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4BAA07CEB81F49A296E02203 /* WasmSignatureInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 30A5F403F11C4F599CD596D5 /* WasmSignatureInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 520D99F02388CC78000509A3 /* GetByValHistory.h */; };
 		521131F71F82BF14007CCEEE /* PolyProtoAccessChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 521131F61F82BF11007CCEEE /* PolyProtoAccessChain.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		521322461ECBCE8200F65615 /* WebAssemblyFunctionBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 521322441ECBCE8200F65615 /* WebAssemblyFunctionBase.h */; };
 		522927D5235FD0B9005CB169 /* GCMemoryOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 5272987B235FC8BA005C982C /* GCMemoryOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -901,7 +902,6 @@
 		526AC4B71E977C5D003500E1 /* WasmCodeBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 526AC4B51E977C5D003500E1 /* WasmCodeBlock.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		527CE35422555FE500C6F382 /* JSToWasmICCallee.h in Headers */ = {isa = PBXBuildFile; fileRef = 527CE35322555FDD00C6F382 /* JSToWasmICCallee.h */; };
 		52847ADC21FFB8690061A9DB /* WasmAirIRGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 52847ADA21FFB8630061A9DB /* WasmAirIRGenerator.h */; };
-		52AD08232399A1FB00B4101A /* PointerHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = 52AD08222399A1F200B4101A /* PointerHistory.h */; };
 		52B310FB1974AE610080857C /* FunctionHasExecutedCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B310FA1974AE610080857C /* FunctionHasExecutedCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		52B311011975B4670080857C /* TypeLocationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B311001975B4670080857C /* TypeLocationCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		52C0611F1AA51E1C00B4ADBA /* RuntimeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 52C0611D1AA51E1B00B4ADBA /* RuntimeType.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3538,6 +3538,7 @@
 		4CE978E385A8498199052153 /* ModuleNamespaceAccessCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleNamespaceAccessCase.h; sourceTree = "<group>"; };
 		51F0EB6105C86C6B00E6DF1B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
 		51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
+		520D99F02388CC78000509A3 /* GetByValHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GetByValHistory.h; sourceTree = "<group>"; };
 		521131F51F82BF11007CCEEE /* PolyProtoAccessChain.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PolyProtoAccessChain.cpp; sourceTree = "<group>"; };
 		521131F61F82BF11007CCEEE /* PolyProtoAccessChain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PolyProtoAccessChain.h; sourceTree = "<group>"; };
 		521322431ECBCE8200F65615 /* WebAssemblyFunctionBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyFunctionBase.cpp; path = js/WebAssemblyFunctionBase.cpp; sourceTree = "<group>"; };
@@ -3560,7 +3561,6 @@
 		527CE35322555FDD00C6F382 /* JSToWasmICCallee.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSToWasmICCallee.h; path = js/JSToWasmICCallee.h; sourceTree = "<group>"; };
 		52847AD921FFB8630061A9DB /* WasmAirIRGenerator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WasmAirIRGenerator.cpp; sourceTree = "<group>"; };
 		52847ADA21FFB8630061A9DB /* WasmAirIRGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WasmAirIRGenerator.h; sourceTree = "<group>"; };
-		52AD08222399A1F200B4101A /* PointerHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PointerHistory.h; sourceTree = "<group>"; };
 		52B310FA1974AE610080857C /* FunctionHasExecutedCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionHasExecutedCache.h; sourceTree = "<group>"; };
 		52B310FC1974AE870080857C /* FunctionHasExecutedCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionHasExecutedCache.cpp; sourceTree = "<group>"; };
 		52B310FE1975B4240080857C /* TypeLocationCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TypeLocationCache.cpp; sourceTree = "<group>"; };
@@ -8241,6 +8241,7 @@
 				0F0332C218B01763005F979A /* GetByIdVariant.h */,
 				0F93329514CA7DC10085F3C6 /* GetByStatus.cpp */,
 				0F93329614CA7DC10085F3C6 /* GetByStatus.h */,
+				520D99F02388CC78000509A3 /* GetByValHistory.h */,
 				14AD91081DCA92940014F9FE /* GlobalCodeBlock.h */,
 				0F0B83A814BCF55E00885B4F /* HandlerInfo.h */,
 				0F44A7AB20BF685E0022B171 /* ICStatusMap.cpp */,
@@ -8296,7 +8297,6 @@
 				A70447E917A0BD4600F5898E /* OperandsInlines.h */,
 				E34E657420668E8E00FB81AC /* ParseHash.cpp */,
 				E34E657320668E8D00FB81AC /* ParseHash.h */,
-				52AD08222399A1F200B4101A /* PointerHistory.h */,
 				0FF9CE711B9CD6D0004EDCA6 /* PolymorphicAccess.cpp */,
 				0FF9CE721B9CD6D0004EDCA6 /* PolymorphicAccess.h */,
 				521131F51F82BF11007CCEEE /* PolyProtoAccessChain.cpp */,
@@ -9526,6 +9526,7 @@
 				1498CAD6214BF36D00710879 /* GetByIdMetadata.h in Headers */,
 				0F0332C418B01763005F979A /* GetByIdVariant.h in Headers */,
 				0F9332A014CA7DCD0085F3C6 /* GetByStatus.h in Headers */,
+				520D99F12388CC81000509A3 /* GetByValHistory.h in Headers */,
 				7964656A1B952FF0003059EE /* GetPutInfo.h in Headers */,
 				534E03581E53BF2F00213F64 /* GetterSetterAccessCase.h in Headers */,
 				FE1D6D6F236258FE007A5C26 /* GetVM.h in Headers */,
@@ -10302,7 +10303,6 @@
 				FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
 				0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */,
 				142E313C134FF0A600AFADB5 /* Weak.h in Headers */,
-				52AD08232399A1FB00B4101A /* PointerHistory.h in Headers */,
 				14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */,
 				14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */,
 				AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */,

Modified: trunk/Source/_javascript_Core/bytecode/BytecodeList.rb (253262 => 253263)


--- trunk/Source/_javascript_Core/bytecode/BytecodeList.rb	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeList.rb	2019-12-07 22:25:18 UTC (rev 253263)
@@ -30,7 +30,7 @@
     :ErrorType,
     :GetByIdMode,
     :GetByIdModeMetadata,
-    :PointerHistory,
+    :GetByValHistory,
     :GetPutInfo,
     :IndexingType,
     :JSCell,
@@ -451,7 +451,6 @@
     metadata: {
         modeMetadata: GetByIdModeMetadata,
         profile: ValueProfile,
-        seenStructures: PointerHistory,
     }
 
 op :get_by_id_with_this,
@@ -463,7 +462,6 @@
     },
     metadata: {
         profile: ValueProfile,
-        seenStructures: PointerHistory,
     }
 
 op :get_by_val_with_this,
@@ -487,7 +485,6 @@
         profile: ValueProfile, # not used in llint
         structureID: StructureID,
         offset: unsigned,
-        seenStructures: PointerHistory,
     }
 
 op :try_get_by_id,
@@ -498,7 +495,6 @@
     },
     metadata: {
         profile: ValueProfile,
-        seenStructures: PointerHistory,
     }
 
 op :put_by_id,
@@ -539,7 +535,7 @@
     metadata: {
         profile: ValueProfile,
         arrayProfile: ArrayProfile,
-        seenIdentifiers: PointerHistory,
+        seenIdentifiers: GetByValHistory,
     }
 
 op :put_by_val,

Added: trunk/Source/_javascript_Core/bytecode/GetByValHistory.h (0 => 253263)


--- trunk/Source/_javascript_Core/bytecode/GetByValHistory.h	                        (rev 0)
+++ trunk/Source/_javascript_Core/bytecode/GetByValHistory.h	2019-12-07 22:25:18 UTC (rev 253263)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "TinyBloomFilter.h"
+#include <wtf/text/UniquedStringImpl.h>
+
+namespace JSC {
+
+struct GetByValHistory {
+    void observeNonUID()
+    {
+        uintptr_t count = Options::getByValICMaxNumberOfIdentifiers() + 1;
+        update(count, filter());
+    }
+
+    void observe(const UniquedStringImpl* impl)
+    {
+        if (!impl) {
+            observeNonUID();
+            return;
+        }
+
+        uintptr_t count = this->count();
+        uintptr_t filter = this->filter();
+
+        TinyBloomFilter bloomFilter(filter);
+        uintptr_t implBits = bitwise_cast<uintptr_t>(impl);
+        ASSERT(((static_cast<uint64_t>(implBits) << 8) >> 8) == static_cast<uint64_t>(implBits));
+        if (bloomFilter.ruleOut(implBits)) {
+            bloomFilter.add(implBits);
+            ++count;
+            update(count, bloomFilter.bits());
+        }
+    }
+
+    uintptr_t count() const { return static_cast<uintptr_t>(m_payload >> 56); }
+
+private:
+    uintptr_t filter() const { return static_cast<uintptr_t>((m_payload << 8) >> 8); }
+
+    void update(uint64_t count, uint64_t filter)
+    {
+        ASSERT(((filter << 8) >> 8) == filter);
+        m_payload = (count << 56) | filter;
+    }
+
+    uint64_t m_payload { 0 };
+};
+
+} // namespace JSC

Deleted: trunk/Source/_javascript_Core/bytecode/PointerHistory.h (253262 => 253263)


--- trunk/Source/_javascript_Core/bytecode/PointerHistory.h	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/bytecode/PointerHistory.h	2019-12-07 22:25:18 UTC (rev 253263)
@@ -1,73 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "TinyBloomFilter.h"
-#include <wtf/text/UniquedStringImpl.h>
-
-namespace JSC {
-
-struct PointerHistory {
-    void observe(const void* pointer)
-    {
-        if (!pointer) {
-            observeNull();
-            return;
-        }
-
-        uintptr_t count = this->count();
-        uintptr_t filter = this->filter();
-
-        TinyBloomFilter bloomFilter(filter);
-        uintptr_t pointerBits = bitwise_cast<uintptr_t>(pointer);
-        ASSERT(((static_cast<uint64_t>(pointerBits) << 8) >> 8) == static_cast<uint64_t>(pointerBits));
-        if (bloomFilter.ruleOut(pointerBits)) {
-            bloomFilter.add(pointerBits);
-            ++count;
-            update(count, bloomFilter.bits());
-        }
-    }
-
-    uintptr_t count() const { return static_cast<uintptr_t>(m_payload >> 56); }
-
-private:
-    void observeNull()
-    {
-        update(count() + 1, filter());
-    }
-
-    uintptr_t filter() const { return static_cast<uintptr_t>((m_payload << 8) >> 8); }
-
-    void update(uint64_t count, uint64_t filter)
-    {
-        ASSERT(((filter << 8) >> 8) == filter);
-        m_payload = (count << 56) | filter;
-    }
-
-    uint64_t m_payload { 0 };
-};
-
-} // namespace JSC

Modified: trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/dfg/DFGByteCodeParser.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -4712,7 +4712,7 @@
     
     Node* base = get(bytecode.m_base);
     unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[bytecode.m_property];
-
+    
     AccessType type = AccessType::GetById;
     unsigned opcodeLength = currentInstruction->size();
     if (Op::opcodeID == op_try_get_by_id)
@@ -4720,21 +4720,6 @@
     else if (Op::opcodeID == op_get_by_id_direct)
         type = AccessType::GetByIdDirect;
     
-    if (bytecode.metadata(m_inlineStackTop->m_codeBlock).m_seenStructures.count() > Options::getByIdICMaxNumberOfStructures()) {
-        NodeType getById;
-        if (type == AccessType::GetById)
-            getById = GetById;
-        else if (type == AccessType::TryGetById)
-            getById = TryGetById;
-        else
-            getById = GetByIdDirect;
-
-        Node* node = addToGraph(getById, OpInfo(identifierNumber), OpInfo(prediction), base);
-        set(bytecode.m_dst, node);
-        m_graph.m_shouldSkipIC.add(node);
-        return;
-    }
-
     GetByStatus::IdentifierKeepAlive keepAlive = [&] (Box<Identifier> identifier) {
         m_graph.m_plan.keepAliveIdentifier(WTFMove(identifier));
     };
@@ -5677,7 +5662,7 @@
                 m_exitOK = false; // GetByVal must be treated as if it clobbers exit state, since FixupPhase may make it generic.
                 set(bytecode.m_dst, getByVal);
                 if (getByStatus.observedStructureStubInfoSlowPath() || bytecode.metadata(codeBlock).m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers())
-                    m_graph.m_shouldSkipIC.add(getByVal);
+                    m_graph.m_slowGetByVal.add(getByVal);
             }
 
             NEXT_OPCODE(op_get_by_val);

Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.h (253262 => 253263)


--- trunk/Source/_javascript_Core/dfg/DFGGraph.h	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.h	2019-12-07 22:25:18 UTC (rev 253263)
@@ -1153,7 +1153,7 @@
     RegisteredStructure stringStructure;
     RegisteredStructure symbolStructure;
 
-    HashSet<Node*> m_shouldSkipIC;
+    HashSet<Node*> m_slowGetByVal;
 
 private:
     bool isStringPrototypeMethodSane(JSGlobalObject*, UniquedStringImpl*);

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -986,20 +986,6 @@
 {
     ASSERT(accessType == AccessType::GetById || accessType == AccessType::GetByIdDirect || accessType == AccessType::TryGetById);
 
-    if (m_graph.m_shouldSkipIC.contains(node)) {
-        JSValueOperand base(this, node->child1(), ManualOperandSpeculation);
-        speculate(node, node->child1());
-        JSValueRegs baseRegs = base.jsValueRegs();
-
-        flushRegisters();
-        JSValueRegsFlushedCallResult result(this);
-        JSValueRegs resultRegs = result.regs();
-        callOperation(appropriateGenericGetByIdFunction(accessType), resultRegs, TrustedImmPtr::weakPointer(m_graph, m_graph.globalObjectFor(node->origin.semantic)), baseRegs, TrustedImmPtr(identifierUID(node->identifierNumber())));
-        m_jit.exceptionCheck();
-        jsValueResult(resultRegs, node, DataFormatJS);
-        return;
-    }
-
     switch (node->child1().useKind()) {
     case CellUse: {
         SpeculateCellOperand base(this, node->child1());

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -2259,7 +2259,7 @@
             break;
         }
         case Array::Generic: {
-            if (m_graph.m_shouldSkipIC.contains(node)) {
+            if (m_graph.m_slowGetByVal.contains(node)) {
                 if (m_graph.varArgChild(node, 0).useKind() == ObjectUse) {
                     if (m_graph.varArgChild(node, 1).useKind() == StringUse) {
                         compileGetByValForObjectWithString(node);

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -2408,7 +2408,7 @@
             break;
         }
         case Array::Generic: {
-            if (m_graph.m_shouldSkipIC.contains(node)) {
+            if (m_graph.m_slowGetByVal.contains(node)) {
                 if (m_graph.varArgChild(node, 0).useKind() == ObjectUse) {
                     if (m_graph.varArgChild(node, 1).useKind() == StringUse) {
                         compileGetByValForObjectWithString(node);

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -3546,16 +3546,6 @@
     {
         ASSERT(type == AccessType::GetById || type == AccessType::TryGetById || type == AccessType::GetByIdDirect);
         JSGlobalObject* globalObject = m_graph.globalObjectFor(m_node->origin.semantic);
-
-        if (m_graph.m_shouldSkipIC.contains(m_node)) {
-            speculate(m_node->child1());
-            LValue base = lowJSValue(m_node->child1(), ManualOperandSpeculation);
-
-            setJSValue(vmCall(Int64, appropriateGenericGetByIdFunction(type),
-                weakPointer(globalObject), base, m_out.constIntPtr(m_graph.identifiers()[m_node->identifierNumber()])));
-            return;
-        }
-
         switch (m_node->child1().useKind()) {
         case CellUse: {
             setJSValue(getById(lowCell(m_node->child1()), type));
@@ -4463,7 +4453,7 @@
         }
             
         case Array::Generic: {
-            if (m_graph.m_shouldSkipIC.contains(m_node)) {
+            if (m_graph.m_slowGetByVal.contains(m_node)) {
                 if (m_graph.varArgChild(m_node, 0).useKind() == ObjectUse) {
                     if (m_graph.varArgChild(m_node, 1).useKind() == StringUse) {
                         setJSValue(vmCall(

Modified: trunk/Source/_javascript_Core/generator/DSL.rb (253262 => 253263)


--- trunk/Source/_javascript_Core/generator/DSL.rb	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/generator/DSL.rb	2019-12-07 22:25:18 UTC (rev 253263)
@@ -136,7 +136,7 @@
 #include "BytecodeDumper.h"
 #include "Fits.h"
 #include "GetByIdMetadata.h"
-#include "PointerHistory.h"
+#include "GetByValHistory.h"
 #include "Instruction.h"
 #include "Opcode.h"
 #include "PutByIdStatus.h"

Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -409,44 +409,37 @@
     int resultVReg = bytecode.m_dst.offset();
     int baseVReg = bytecode.m_base.offset();
     const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
-    auto& metadata = bytecode.metadata(m_codeBlock);
 
     emitGetVirtualRegister(baseVReg, regT0);
 
-    if (metadata.m_seenStructures.count() > Options::getByIdICMaxNumberOfStructures())
-        callOperationWithProfile(bytecode.metadata(m_codeBlock), operationTryGetByIdGeneric, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), regT0, TrustedImmPtr(ident->impl()));
-    else {
-        emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
+    emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
 
-        JITGetByIdGenerator gen(
-            m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
-            ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::TryGetById);
-        gen.generateFastPath(*this);
-        addSlowCase(gen.slowPathJump());
-        m_getByIds.append(gen);
-        
-        emitValueProfilingSite(bytecode.metadata(m_codeBlock));
-        emitPutVirtualRegister(resultVReg);
-    }
+    JITGetByIdGenerator gen(
+        m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
+        ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::TryGetById);
+    gen.generateFastPath(*this);
+    addSlowCase(gen.slowPathJump());
+    m_getByIds.append(gen);
+    
+    emitValueProfilingSite(bytecode.metadata(m_codeBlock));
+    emitPutVirtualRegister(resultVReg);
 }
 
 void JIT::emitSlow_op_try_get_by_id(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
 {
-    if (hasAnySlowCases(iter)) {
-        linkAllSlowCases(iter);
+    linkAllSlowCases(iter);
 
-        auto bytecode = currentInstruction->as<OpTryGetById>();
-        int resultVReg = bytecode.m_dst.offset();
-        const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
+    auto bytecode = currentInstruction->as<OpTryGetById>();
+    int resultVReg = bytecode.m_dst.offset();
+    const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
 
-        JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
+    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
 
-        Label coldPathBegin = label();
+    Label coldPathBegin = label();
 
-        Call call = callOperation(operationTryGetByIdOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
-        
-        gen.reportSlowPathCall(coldPathBegin, call);
-    }
+    Call call = callOperation(operationTryGetByIdOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
+    
+    gen.reportSlowPathCall(coldPathBegin, call);
 }
 
 void JIT::emit_op_get_by_id_direct(const Instruction* currentInstruction)
@@ -455,44 +448,37 @@
     int resultVReg = bytecode.m_dst.offset();
     int baseVReg = bytecode.m_base.offset();
     const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
-    auto& metadata = bytecode.metadata(m_codeBlock);
 
     emitGetVirtualRegister(baseVReg, regT0);
 
-    if (metadata.m_seenStructures.count() > Options::getByIdICMaxNumberOfStructures())
-        callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdDirectGeneric, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), regT0, TrustedImmPtr(ident->impl()));
-    else {
-        emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
+    emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
 
-        JITGetByIdGenerator gen(
-            m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
-            ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::GetByIdDirect);
-        gen.generateFastPath(*this);
-        addSlowCase(gen.slowPathJump());
-        m_getByIds.append(gen);
+    JITGetByIdGenerator gen(
+        m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
+        ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::GetByIdDirect);
+    gen.generateFastPath(*this);
+    addSlowCase(gen.slowPathJump());
+    m_getByIds.append(gen);
 
-        emitValueProfilingSite(bytecode.metadata(m_codeBlock));
-        emitPutVirtualRegister(resultVReg);
-    }
+    emitValueProfilingSite(bytecode.metadata(m_codeBlock));
+    emitPutVirtualRegister(resultVReg);
 }
 
 void JIT::emitSlow_op_get_by_id_direct(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
 {
-    if (hasAnySlowCases(iter)) {
-        linkAllSlowCases(iter);
+    linkAllSlowCases(iter);
 
-        auto bytecode = currentInstruction->as<OpGetByIdDirect>();
-        int resultVReg = bytecode.m_dst.offset();
-        const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
+    auto bytecode = currentInstruction->as<OpGetByIdDirect>();
+    int resultVReg = bytecode.m_dst.offset();
+    const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
 
-        JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
+    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
 
-        Label coldPathBegin = label();
+    Label coldPathBegin = label();
 
-        Call call = callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdDirectOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
+    Call call = callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdDirectOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
 
-        gen.reportSlowPathCall(coldPathBegin, call);
-    }
+    gen.reportSlowPathCall(coldPathBegin, call);
 }
 
 void JIT::emit_op_get_by_id(const Instruction* currentInstruction)
@@ -504,54 +490,24 @@
     const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
 
     emitGetVirtualRegister(baseVReg, regT0);
-
-    if (metadata.m_seenStructures.count() > Options::getByIdICMaxNumberOfStructures()) {
-        if (*ident == m_vm->propertyNames->length && shouldEmitProfiling()) {
-            auto notCell = branchIfNotCell(regT0);
-            Jump notArrayLengthMode = branch8(NotEqual, AbsoluteAddress(&metadata.m_modeMetadata.mode), TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)));
-            emitArrayProfilingSiteWithCell(regT0, regT1, &metadata.m_modeMetadata.arrayLengthMode.arrayProfile);
-            notArrayLengthMode.link(this);
-            notCell.link(this);
-        }
-        callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdGeneric, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), regT0, TrustedImmPtr(ident->impl()));
-    } else {
-        emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
-        
-        if (*ident == m_vm->propertyNames->length && shouldEmitProfiling()) {
-            Jump notArrayLengthMode = branch8(NotEqual, AbsoluteAddress(&metadata.m_modeMetadata.mode), TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)));
-            emitArrayProfilingSiteWithCell(regT0, regT1, &metadata.m_modeMetadata.arrayLengthMode.arrayProfile);
-            notArrayLengthMode.link(this);
-        }
-
-        JITGetByIdGenerator gen(
-            m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
-            ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::GetById);
-        gen.generateFastPath(*this);
-        addSlowCase(gen.slowPathJump());
-        m_getByIds.append(gen);
-
-        emitValueProfilingSite(bytecode.metadata(m_codeBlock));
-        emitPutVirtualRegister(resultVReg);
+    
+    emitJumpSlowCaseIfNotJSCell(regT0, baseVReg);
+    
+    if (*ident == m_vm->propertyNames->length && shouldEmitProfiling()) {
+        Jump notArrayLengthMode = branch8(NotEqual, AbsoluteAddress(&metadata.m_modeMetadata.mode), TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)));
+        emitArrayProfilingSiteWithCell(regT0, regT1, &metadata.m_modeMetadata.arrayLengthMode.arrayProfile);
+        notArrayLengthMode.link(this);
     }
-}
 
-void JIT::emitSlow_op_get_by_id(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
-{
-    if (hasAnySlowCases(iter)) {
-        linkAllSlowCases(iter);
+    JITGetByIdGenerator gen(
+        m_codeBlock, CodeOrigin(m_bytecodeIndex), CallSiteIndex(m_bytecodeIndex), RegisterSet::stubUnavailableRegisters(),
+        ident->impl(), JSValueRegs(regT0), JSValueRegs(regT0), AccessType::GetById);
+    gen.generateFastPath(*this);
+    addSlowCase(gen.slowPathJump());
+    m_getByIds.append(gen);
 
-        auto bytecode = currentInstruction->as<OpGetById>();
-        int resultVReg = bytecode.m_dst.offset();
-        const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
-
-        JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
-        
-        Label coldPathBegin = label();
-
-        Call call = callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
-
-        gen.reportSlowPathCall(coldPathBegin, call);
-    }
+    emitValueProfilingSite(bytecode.metadata(m_codeBlock));
+    emitPutVirtualRegister(resultVReg);
 }
 
 void JIT::emit_op_get_by_id_with_this(const Instruction* currentInstruction)
@@ -578,6 +534,23 @@
     emitPutVirtualRegister(resultVReg);
 }
 
+void JIT::emitSlow_op_get_by_id(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
+{
+    linkAllSlowCases(iter);
+
+    auto bytecode = currentInstruction->as<OpGetById>();
+    int resultVReg = bytecode.m_dst.offset();
+    const Identifier* ident = &(m_codeBlock->identifier(bytecode.m_property));
+
+    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
+    
+    Label coldPathBegin = label();
+
+    Call call = callOperationWithProfile(bytecode.metadata(m_codeBlock), operationGetByIdOptimize, resultVReg, TrustedImmPtr(m_codeBlock->globalObject()), gen.stubInfo(), regT0, ident->impl());
+
+    gen.reportSlowPathCall(coldPathBegin, call);
+}
+
 void JIT::emitSlow_op_get_by_id_with_this(const Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
 {
     linkAllSlowCases(iter);

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (253262 => 253263)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2019-12-07 22:25:18 UTC (rev 253263)
@@ -640,12 +640,8 @@
 {
     LLINT_BEGIN();
     auto bytecode = pc->as<OpTryGetById>();
-    auto& metadata = bytecode.metadata(codeBlock);
-
     const Identifier& ident = codeBlock->identifier(bytecode.m_property);
     JSValue baseValue = getOperand(callFrame, bytecode.m_base);
-    if (metadata.m_seenStructures.count() <= Options::getByIdICMaxNumberOfStructures())
-        metadata.m_seenStructures.observe(baseValue.structureOrNull());
     PropertySlot slot(baseValue, PropertySlot::PropertySlot::InternalMethodType::VMInquiry);
 
     baseValue.getPropertySlot(globalObject, ident, slot);
@@ -658,11 +654,8 @@
 {
     LLINT_BEGIN();
     auto bytecode = pc->as<OpGetByIdDirect>();
-    auto& metadata = bytecode.metadata(codeBlock);
     const Identifier& ident = codeBlock->identifier(bytecode.m_property);
     JSValue baseValue = getOperand(callFrame, bytecode.m_base);
-    if (metadata.m_seenStructures.count() <= Options::getByIdICMaxNumberOfStructures())
-        metadata.m_seenStructures.observe(baseValue.structureOrNull());
     PropertySlot slot(baseValue, PropertySlot::PropertySlot::InternalMethodType::GetOwnProperty);
 
     bool found = baseValue.getOwnPropertySlot(globalObject, ident, slot);
@@ -671,6 +664,7 @@
     LLINT_CHECK_EXCEPTION();
 
     if (!LLINT_ALWAYS_ACCESS_SLOW && slot.isCacheable() && !slot.isUnset()) {
+        auto& metadata = bytecode.metadata(codeBlock);
         {
             StructureID oldStructureID = metadata.m_structureID;
             if (oldStructureID) {
@@ -771,10 +765,6 @@
     auto& metadata = bytecode.metadata(codeBlock);
     const Identifier& ident = codeBlock->identifier(bytecode.m_property);
     JSValue baseValue = getOperand(callFrame, bytecode.m_base);
-
-    if (metadata.m_seenStructures.count() <= Options::getByIdICMaxNumberOfStructures())
-        metadata.m_seenStructures.observe(baseValue.structureOrNull());
-
     PropertySlot slot(baseValue, PropertySlot::PropertySlot::InternalMethodType::Get);
 
     JSValue result = baseValue.get(globalObject, ident, slot);

Modified: trunk/Source/_javascript_Core/runtime/OptionsList.h (253262 => 253263)


--- trunk/Source/_javascript_Core/runtime/OptionsList.h	2019-12-07 22:20:13 UTC (rev 253262)
+++ trunk/Source/_javascript_Core/runtime/OptionsList.h	2019-12-07 22:25:18 UTC (rev 253263)
@@ -494,7 +494,6 @@
     v(Bool, useUnlinkedCodeBlockJettisoning, false, Normal, "If true, UnlinkedCodeBlock can be jettisoned.") \
     v(Bool, forceOSRExitToLLInt, false, Normal, "If true, we always exit to the LLInt. If false, we exit to whatever is most convenient.") \
     v(Unsigned, getByValICMaxNumberOfIdentifiers, 4, Normal, "Number of identifiers we see in the LLInt that could cause us to bail on generating an IC for get_by_val.") \
-    v(Unsigned, getByIdICMaxNumberOfStructures, 5, Normal, "Number of structures we see in the LLInt that could cause us to bail on generating an IC for various get_by_id ICs.") \
 
 enum OptionEquivalence {
     SameOption,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to