Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (261503 => 261504)
--- trunk/Source/_javascript_Core/ChangeLog 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-05-11 23:30:03 UTC (rev 261504)
@@ -1,3 +1,21 @@
+2020-05-11 Keith Miller <keith_mil...@apple.com>
+
+ Remove unused BytecodeKills.h
+ https://bugs.webkit.org/show_bug.cgi?id=211753
+
+ Reviewed by Yusuke Suzuki.
+
+ No one uses this class anymore, we should get rid of it.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * bytecode/BytecodeKills.h: Removed.
+ * bytecode/BytecodeLivenessAnalysis.cpp:
+ (JSC::BytecodeLivenessAnalysis::computeKills): Deleted.
+ * bytecode/BytecodeLivenessAnalysis.h:
+ * dfg/DFGGraph.cpp:
+ (JSC::DFG::Graph::killsFor): Deleted.
+ * dfg/DFGGraph.h:
+
2020-05-10 Ross Kirsling <ross.kirsl...@sony.com>
[clang-tidy] Run modernize-use-nullptr over JSC
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (261503 => 261504)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2020-05-11 23:30:03 UTC (rev 261504)
@@ -269,8 +269,7 @@
0F2D4DEA19832DAC007D4B19 /* TypeLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2D4DE719832DAC007D4B19 /* TypeLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F2D4DEC19832DC4007D4B19 /* TypeProfilerLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2D4DE019832D91007D4B19 /* TypeProfilerLog.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F2D4DF019832DD6007D4B19 /* TypeSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2D4DE419832D91007D4B19 /* TypeSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0F2DD80B1AB3D85800BBB8E8 /* BytecodeKills.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2DD80A1AB3D85800BBB8E8 /* BytecodeKills.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0F2DD8121AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2DD80D1AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h */; };
+ 0F2DD8121AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2DD80D1AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h */; };
0F2DD8141AB3D8BE00BBB8E8 /* DFGArgumentsUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2DD80F1AB3D8BE00BBB8E8 /* DFGArgumentsUtilities.h */; };
0F2DD8151AB3D8BE00BBB8E8 /* DFGForAllKills.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2DD8101AB3D8BE00BBB8E8 /* DFGForAllKills.h */; };
0F2E892C16D028AD009E4FD2 /* UnusedPointer.h in Headers */ = {isa = PBXBuildFile; fileRef = 65987F2F16828A7E003C2F8D /* UnusedPointer.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2456,8 +2455,7 @@
0F2D4DE519832DAC007D4B19 /* ToThisStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ToThisStatus.cpp; sourceTree = "<group>"; };
0F2D4DE619832DAC007D4B19 /* ToThisStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ToThisStatus.h; sourceTree = "<group>"; };
0F2D4DE719832DAC007D4B19 /* TypeLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeLocation.h; sourceTree = "<group>"; };
- 0F2DD80A1AB3D85800BBB8E8 /* BytecodeKills.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BytecodeKills.h; sourceTree = "<group>"; };
- 0F2DD80C1AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArgumentsEliminationPhase.cpp; path = dfg/DFGArgumentsEliminationPhase.cpp; sourceTree = "<group>"; };
+ 0F2DD80C1AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArgumentsEliminationPhase.cpp; path = dfg/DFGArgumentsEliminationPhase.cpp; sourceTree = "<group>"; };
0F2DD80D1AB3D8BE00BBB8E8 /* DFGArgumentsEliminationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArgumentsEliminationPhase.h; path = dfg/DFGArgumentsEliminationPhase.h; sourceTree = "<group>"; };
0F2DD80E1AB3D8BE00BBB8E8 /* DFGArgumentsUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGArgumentsUtilities.cpp; path = dfg/DFGArgumentsUtilities.cpp; sourceTree = "<group>"; };
0F2DD80F1AB3D8BE00BBB8E8 /* DFGArgumentsUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGArgumentsUtilities.h; path = dfg/DFGArgumentsUtilities.h; sourceTree = "<group>"; };
@@ -8260,8 +8258,7 @@
53663FD923562F90005EA68C /* BytecodeIndex.h */,
7094C4DC1AE439530041A2EE /* BytecodeIntrinsicRegistry.cpp */,
7094C4DD1AE439530041A2EE /* BytecodeIntrinsicRegistry.h */,
- 0F2DD80A1AB3D85800BBB8E8 /* BytecodeKills.h */,
- 14BA7751211086A0008D0B05 /* BytecodeList.rb */,
+ 14BA7751211086A0008D0B05 /* BytecodeList.rb */,
C2FCAE0E17A9C24E0034C735 /* BytecodeLivenessAnalysis.cpp */,
C2FCAE0F17A9C24E0034C735 /* BytecodeLivenessAnalysis.h */,
0F666EBE183566F900D017F1 /* BytecodeLivenessAnalysisInlines.h */,
@@ -9175,8 +9172,7 @@
E328DAE91D38D005001A2529 /* BytecodeGraph.h in Headers */,
53663FDA23562F96005EA68C /* BytecodeIndex.h in Headers */,
7094C4DF1AE439530041A2EE /* BytecodeIntrinsicRegistry.h in Headers */,
- 0F2DD80B1AB3D85800BBB8E8 /* BytecodeKills.h in Headers */,
- C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */,
+ C2FCAE1317A9C24E0034C735 /* BytecodeLivenessAnalysis.h in Headers */,
0F666EC0183566F900D017F1 /* BytecodeLivenessAnalysisInlines.h in Headers */,
53D35499240D88BD008950DD /* BytecodeOperandsForCheckpoint.h in Headers */,
E328DAEB1D38D005001A2529 /* BytecodeRewriter.h in Headers */,
Deleted: trunk/Source/_javascript_Core/bytecode/BytecodeKills.h (261503 => 261504)
--- trunk/Source/_javascript_Core/bytecode/BytecodeKills.h 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeKills.h 2020-05-11 23:30:03 UTC (rev 261504)
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2015 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. AND ITS CONTRIBUTORS ``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 ITS 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 "CodeBlock.h"
-#include <wtf/UniqueArray.h>
-
-namespace JSC {
-
-class BytecodeLivenessAnalysis;
-
-class BytecodeKills {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- BytecodeKills()
- : m_codeBlock(nullptr)
- {
- }
-
-private:
- friend class BytecodeLivenessAnalysis;
-
- class KillSet {
- WTF_MAKE_FAST_ALLOCATED;
- public:
- KillSet()
- : m_word(0)
- {
- }
-
- ~KillSet()
- {
- if (hasVector())
- delete vector();
- }
-
- void add(unsigned local)
- {
- if (isEmpty()) {
- setOneItem(local);
- return;
- }
- if (hasOneItem()) {
- ASSERT(oneItem() != local);
- Vector<unsigned>* vector = new Vector<unsigned>();
- vector->append(oneItem());
- vector->append(local);
- setVector(vector);
- return;
- }
- ASSERT(!vector()->contains(local));
- vector()->append(local);
- }
-
- template<typename Functor>
- void forEachLocal(const Functor& functor)
- {
- if (isEmpty())
- return;
- if (hasOneItem()) {
- functor(oneItem());
- return;
- }
- for (unsigned local : *vector())
- functor(local);
- }
-
- bool contains(unsigned expectedLocal)
- {
- if (isEmpty())
- return false;
- if (hasOneItem())
- return oneItem() == expectedLocal;
- for (unsigned local : *vector()) {
- if (local == expectedLocal)
- return true;
- }
- return false;
- }
-
- private:
- bool isEmpty() const
- {
- return !m_word;
- }
-
- bool hasOneItem() const
- {
- return m_word & 1;
- }
-
- unsigned oneItem() const
- {
- return m_word >> 1;
- }
-
- void setOneItem(unsigned value)
- {
- m_word = (value << 1) | 1;
- }
-
- bool hasVector() const
- {
- return !isEmpty() && !hasOneItem();
- }
-
- Vector<unsigned>* vector()
- {
- return bitwise_cast<Vector<unsigned>*>(m_word);
- }
-
- void setVector(Vector<unsigned>* value)
- {
- m_word = bitwise_cast<uintptr_t>(value);
- }
-
- uintptr_t m_word;
- };
-
- CodeBlock* m_codeBlock;
- UniqueArray<KillSet> m_killSets;
-};
-
-} // namespace JSC
Modified: trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.cpp (261503 => 261504)
--- trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.cpp 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.cpp 2020-05-11 23:30:03 UTC (rev 261504)
@@ -26,7 +26,6 @@
#include "config.h"
#include "BytecodeLivenessAnalysis.h"
-#include "BytecodeKills.h"
#include "BytecodeLivenessAnalysisInlines.h"
#include "BytecodeUseDef.h"
#include "CodeBlock.h"
@@ -101,41 +100,6 @@
}
}
-void BytecodeLivenessAnalysis::computeKills(CodeBlock* codeBlock, BytecodeKills& result)
-{
- UNUSED_PARAM(result);
- FastBitVector out;
-
- result.m_codeBlock = codeBlock;
- result.m_killSets = makeUniqueArray<BytecodeKills::KillSet>(codeBlock->instructions().size());
-
- for (BytecodeBasicBlock& block : m_graph.basicBlocksInReverseOrder()) {
- if (block.isEntryBlock() || block.isExitBlock())
- continue;
-
- out = block.out();
-
- unsigned cursor = block.totalLength();
- for (unsigned i = block.delta().size(); i--;) {
- cursor -= block.delta()[i];
- BytecodeIndex bytecodeIndex = BytecodeIndex(block.leaderOffset() + cursor);
- stepOverInstruction(
- codeBlock, codeBlock->instructions(), m_graph, bytecodeIndex,
- [&] (unsigned index) {
- // This is for uses.
- if (out[index])
- return;
- result.m_killSets[bytecodeIndex.offset()].add(index);
- out[index] = true;
- },
- [&] (unsigned index) {
- // This is for defs.
- out[index] = false;
- });
- }
- }
-}
-
void BytecodeLivenessAnalysis::dumpResults(CodeBlock* codeBlock)
{
dataLog("\nDumping bytecode liveness for ", *codeBlock, ":\n");
Modified: trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.h (261503 => 261504)
--- trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.h 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeLivenessAnalysis.h 2020-05-11 23:30:03 UTC (rev 261504)
@@ -86,7 +86,6 @@
FastBitVector getLivenessInfoAtBytecodeIndex(CodeBlock*, BytecodeIndex);
void computeFullLiveness(CodeBlock*, FullBytecodeLiveness& result);
- void computeKills(CodeBlock*, BytecodeKills& result);
BytecodeGraph& graph() { return m_graph; }
Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (261503 => 261504)
--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2020-05-11 23:30:03 UTC (rev 261504)
@@ -28,7 +28,6 @@
#if ENABLE(DFG_JIT)
-#include "BytecodeKills.h"
#include "BytecodeLivenessAnalysisInlines.h"
#include "CodeBlock.h"
#include "CodeBlockWithJITType.h"
@@ -1126,24 +1125,6 @@
return livenessFor(baselineCodeBlockFor(inlineCallFrame));
}
-BytecodeKills& Graph::killsFor(CodeBlock* codeBlock)
-{
- HashMap<CodeBlock*, std::unique_ptr<BytecodeKills>>::iterator iter = m_bytecodeKills.find(codeBlock);
- if (iter != m_bytecodeKills.end())
- return *iter->value;
-
- std::unique_ptr<BytecodeKills> kills = makeUnique<BytecodeKills>();
- codeBlock->livenessAnalysis().computeKills(codeBlock, *kills);
- BytecodeKills& result = *kills;
- m_bytecodeKills.add(codeBlock, WTFMove(kills));
- return result;
-}
-
-BytecodeKills& Graph::killsFor(InlineCallFrame* inlineCallFrame)
-{
- return killsFor(baselineCodeBlockFor(inlineCallFrame));
-}
-
bool Graph::isLiveInBytecode(Operand operand, CodeOrigin codeOrigin)
{
static constexpr bool verbose = false;
Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.h (261503 => 261504)
--- trunk/Source/_javascript_Core/dfg/DFGGraph.h 2020-05-11 23:22:06 UTC (rev 261503)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.h 2020-05-11 23:30:03 UTC (rev 261504)
@@ -977,10 +977,7 @@
for (unsigned argument = block(0)->variablesAtHead.numberOfArguments(); argument--;)
functor(virtualRegisterForArgumentIncludingThis(argument));
}
-
- BytecodeKills& killsFor(CodeBlock*);
- BytecodeKills& killsFor(InlineCallFrame*);
-
+
static unsigned parameterSlotsForArgCount(unsigned);
unsigned frameRegisterCount();
@@ -1132,7 +1129,6 @@
Bag<BitVector> m_bitVectors;
Vector<InlineVariableData, 4> m_inlineVariableData;
HashMap<CodeBlock*, std::unique_ptr<FullBytecodeLiveness>> m_bytecodeLiveness;
- HashMap<CodeBlock*, std::unique_ptr<BytecodeKills>> m_bytecodeKills;
HashSet<std::pair<JSObject*, PropertyOffset>> m_safeToLoad;
Vector<Ref<Snippet>> m_domJITSnippets;
std::unique_ptr<CPSDominators> m_cpsDominators;