Diff
Modified: trunk/Source/_javascript_Core/CMakeLists.txt (126688 => 126689)
--- trunk/Source/_javascript_Core/CMakeLists.txt 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/CMakeLists.txt 2012-08-25 22:34:43 UTC (rev 126689)
@@ -91,7 +91,6 @@
dfg/DFGOperations.cpp
dfg/DFGPhase.cpp
dfg/DFGPredictionPropagationPhase.cpp
- dfg/DFGRedundantPhiEliminationPhase.cpp
dfg/DFGRepatch.cpp
dfg/DFGSpeculativeJIT.cpp
dfg/DFGSpeculativeJIT32_64.cpp
Modified: trunk/Source/_javascript_Core/ChangeLog (126688 => 126689)
--- trunk/Source/_javascript_Core/ChangeLog 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-08-25 22:34:43 UTC (rev 126689)
@@ -1,3 +1,20 @@
+2012-08-25 Filip Pizlo <[email protected]>
+
+ The redundant phi elimination phase is not used and should be removed
+ https://bugs.webkit.org/show_bug.cgi?id=95006
+
+ Reviewed by Dan Bernstein.
+
+ Just removing dead code.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * dfg/DFGDriver.cpp:
+ * dfg/DFGRedundantPhiEliminationPhase.cpp: Removed.
+ * dfg/DFGRedundantPhiEliminationPhase.h: Removed.
+
2012-08-24 Benjamin Poulain <[email protected]>
Unify Number to StringImpl conversion
Modified: trunk/Source/_javascript_Core/GNUmakefile.list.am (126688 => 126689)
--- trunk/Source/_javascript_Core/GNUmakefile.list.am 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/GNUmakefile.list.am 2012-08-25 22:34:43 UTC (rev 126689)
@@ -217,8 +217,6 @@
Source/_javascript_Core/dfg/DFGPhase.h \
Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.cpp \
Source/_javascript_Core/dfg/DFGPredictionPropagationPhase.h \
- Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.cpp \
- Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.h \
Source/_javascript_Core/dfg/DFGRegisterBank.h \
Source/_javascript_Core/dfg/DFGRegisterSet.h \
Source/_javascript_Core/dfg/DFGRepatch.cpp \
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (126688 => 126689)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-08-25 22:34:43 UTC (rev 126689)
@@ -59,8 +59,6 @@
/* Begin PBXBuildFile section */
08DDA5C11264631700751732 /* UStringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 08DDA5BB12645F1D00751732 /* UStringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0A4337BB1506218800991C95 /* DFGRedundantPhiEliminationPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0A4337BA1506218800991C95 /* DFGRedundantPhiEliminationPhase.cpp */; };
- 0A4337BE1506219B00991C95 /* DFGRedundantPhiEliminationPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A4337BD1506219B00991C95 /* DFGRedundantPhiEliminationPhase.h */; };
0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0776BD14FF002800102332 /* JITCompilationEffort.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F0B839A14BCF45D00885B4F /* LLIntEntrypoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B839514BCF45A00885B4F /* LLIntEntrypoints.cpp */; };
0F0B839B14BCF46000885B4F /* LLIntEntrypoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B839614BCF45A00885B4F /* LLIntEntrypoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -816,8 +814,6 @@
/* Begin PBXFileReference section */
0896C29B1265AAF600B1CDD3 /* UStringConcatenate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringConcatenate.h; sourceTree = "<group>"; };
08DDA5BB12645F1D00751732 /* UStringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringBuilder.h; sourceTree = "<group>"; };
- 0A4337BA1506218800991C95 /* DFGRedundantPhiEliminationPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGRedundantPhiEliminationPhase.cpp; path = dfg/DFGRedundantPhiEliminationPhase.cpp; sourceTree = "<group>"; };
- 0A4337BD1506219B00991C95 /* DFGRedundantPhiEliminationPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGRedundantPhiEliminationPhase.h; path = dfg/DFGRedundantPhiEliminationPhase.h; sourceTree = "<group>"; };
0F0776BD14FF002800102332 /* JITCompilationEffort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCompilationEffort.h; sourceTree = "<group>"; };
0F0B839514BCF45A00885B4F /* LLIntEntrypoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntEntrypoints.cpp; path = llint/LLIntEntrypoints.cpp; sourceTree = "<group>"; };
0F0B839614BCF45A00885B4F /* LLIntEntrypoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntEntrypoints.h; path = llint/LLIntEntrypoints.h; sourceTree = "<group>"; };
@@ -2347,8 +2343,6 @@
0FFFC95014EF909500C72532 /* DFGPhase.h */,
0FFFC95114EF909500C72532 /* DFGPredictionPropagationPhase.cpp */,
0FFFC95214EF909500C72532 /* DFGPredictionPropagationPhase.h */,
- 0A4337BA1506218800991C95 /* DFGRedundantPhiEliminationPhase.cpp */,
- 0A4337BD1506219B00991C95 /* DFGRedundantPhiEliminationPhase.h */,
86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */,
0F766D4215B2A3BD008F363E /* DFGRegisterSet.h */,
86BB09BE138E381B0056702F /* DFGRepatch.cpp */,
@@ -2861,7 +2855,6 @@
0FB5467B14F5C7E1002C2989 /* MethodOfGettingAValueProfile.h in Headers */,
0F0776BF14FF002B00102332 /* JITCompilationEffort.h in Headers */,
0F56A1D315000F35002992B1 /* ExecutionCounter.h in Headers */,
- 0A4337BE1506219B00991C95 /* DFGRedundantPhiEliminationPhase.h in Headers */,
0FA581BB150E953000B9A2D9 /* DFGNodeFlags.h in Headers */,
0FA581BC150E953000B9A2D9 /* DFGNodeType.h in Headers */,
0F2BDC16151C5D4F00CD8910 /* DFGFixupPhase.h in Headers */,
@@ -3470,7 +3463,6 @@
0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
0FB5467D14F5CFD6002C2989 /* MethodOfGettingAValueProfile.cpp in Sources */,
0F56A1D515001CF4002992B1 /* ExecutionCounter.cpp in Sources */,
- 0A4337BB1506218800991C95 /* DFGRedundantPhiEliminationPhase.cpp in Sources */,
0FA581BA150E952C00B9A2D9 /* DFGNodeFlags.cpp in Sources */,
0F2BDC15151C5D4D00CD8910 /* DFGFixupPhase.cpp in Sources */,
8642C510151C06A90046D4EF /* RegExpCachedResult.cpp in Sources */,
Modified: trunk/Source/_javascript_Core/Target.pri (126688 => 126689)
--- trunk/Source/_javascript_Core/Target.pri 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/Target.pri 2012-08-25 22:34:43 UTC (rev 126689)
@@ -121,7 +121,6 @@
dfg/DFGOSRExitCompiler32_64.cpp \
dfg/DFGPhase.cpp \
dfg/DFGPredictionPropagationPhase.cpp \
- dfg/DFGRedundantPhiEliminationPhase.cpp \
dfg/DFGRepatch.cpp \
dfg/DFGSpeculativeJIT.cpp \
dfg/DFGSpeculativeJIT32_64.cpp \
Modified: trunk/Source/_javascript_Core/dfg/DFGDriver.cpp (126688 => 126689)
--- trunk/Source/_javascript_Core/dfg/DFGDriver.cpp 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/dfg/DFGDriver.cpp 2012-08-25 22:34:43 UTC (rev 126689)
@@ -41,7 +41,6 @@
#include "DFGFixupPhase.h"
#include "DFGJITCompiler.h"
#include "DFGPredictionPropagationPhase.h"
-#include "DFGRedundantPhiEliminationPhase.h"
#include "DFGStructureCheckHoistingPhase.h"
#include "DFGValidate.h"
#include "DFGVirtualRegisterAllocationPhase.h"
Deleted: trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.cpp (126688 => 126689)
--- trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.cpp 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.cpp 2012-08-25 22:34:43 UTC (rev 126689)
@@ -1,178 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. 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.
- */
-
-#include "config.h"
-#include "DFGRedundantPhiEliminationPhase.h"
-
-#if ENABLE(DFG_JIT)
-
-#include "DFGGraph.h"
-
-namespace JSC { namespace DFG {
-
-class RedundantPhiEliminationPhase : public Phase {
-public:
- RedundantPhiEliminationPhase(Graph& graph)
- : Phase(graph, "redundant phi elimination")
- {
- }
-
- bool run()
- {
- bool changed = false;
- do {
- changed = fixupPhis();
- } while (changed);
-
- updateBlockVariableInformation();
-
- // Update the Phi references from non-Phi nodes, e.g., the GetLocals.
- for (NodeIndex index = 0; index < m_graph.size(); ++index) {
- Node& node = m_graph[index];
-
- if (!node.shouldGenerate())
- continue;
-
- switch (node.op()) {
- case GetLocal:
- replacePhiChild(node, 0);
- break;
- default:
- break;
- }
- }
-
- return true;
- }
-
-private:
- NodeIndex getRedundantReplacement(NodeIndex phi)
- {
- NodeIndex child1 = m_graph[phi].child1().indexUnchecked();
- NodeIndex candidate = child1 == phi ? NoNode : child1;
-
- NodeIndex child2 = m_graph[phi].child2().indexUnchecked();
- if (candidate != NoNode) {
- if (child2 != NoNode && child2 != candidate && child2 != phi)
- return NoNode;
- } else if (child2 != phi)
- candidate = child2;
-
- NodeIndex child3 = m_graph[phi].child3().indexUnchecked();
- if (candidate != NoNode) {
- if (child3 != NoNode && child3 != candidate && child3 != phi)
- return NoNode;
- } else if (child3 != phi)
- candidate = child3;
-
- return candidate;
- }
-
- bool replacePhiChild(Node& node, unsigned childIndex)
- {
- ASSERT(childIndex < 3);
-
- bool replaced = false;
- NodeIndex child = node.children.child(childIndex).indexUnchecked();
- if (child != NoNode && m_graph[child].op() == Phi) {
- NodeIndex childReplacement = getRedundantReplacement(child);
- if (childReplacement != NoNode) {
- node.children.child(childIndex).setIndex(childReplacement);
- replaced = true;
- if (node.refCount()) {
- m_graph[childReplacement].ref();
- m_graph.deref(child);
- }
- }
- }
- return replaced;
- }
-
- bool fixupPhis()
- {
- bool changed = false;
-
- for (BlockIndex block = 0; block < m_graph.m_blocks.size(); ++block) {
- Vector<NodeIndex>& phis = m_graph.m_blocks[block]->phis;
-
- for (size_t i = 0; i < phis.size(); ++i) {
- NodeIndex phi = phis[i];
- Node& phiNode = m_graph[phi];
-
- changed |= (replacePhiChild(phiNode, 0) && phiNode.refCount());
- changed |= (replacePhiChild(phiNode, 1) && phiNode.refCount());
- changed |= (replacePhiChild(phiNode, 2) && phiNode.refCount());
- }
- }
-
- return changed;
- }
-
- void updateBlockVariableInformation()
- {
- // Redundant Phi nodes are eliminated, we need to update
- // the variable information if it references them.
- for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
- BasicBlock* basicBlock = m_graph.m_blocks[blockIndex].get();
-
- for (size_t arg = 0; arg < basicBlock->variablesAtHead.numberOfArguments(); ++arg) {
- NodeIndex nodeIndex = basicBlock->variablesAtHead.argument(arg);
- if (nodeIndex != NoNode && m_graph[nodeIndex].op() == Phi && !m_graph[nodeIndex].refCount()) {
- NodeIndex replacement = getRedundantReplacement(nodeIndex);
- if (replacement != NoNode) {
- // This argument must be unused in this block.
- ASSERT(basicBlock->variablesAtTail.argument(arg) == nodeIndex);
- basicBlock->variablesAtHead.argument(arg) = replacement;
- basicBlock->variablesAtTail.argument(arg) = replacement;
- }
- }
- }
-
- for (size_t local = 0; local < basicBlock->variablesAtHead.numberOfLocals(); ++local) {
- NodeIndex nodeIndex = basicBlock->variablesAtHead.local(local);
- if (nodeIndex != NoNode && m_graph[nodeIndex].op() == Phi && !m_graph[nodeIndex].refCount()) {
- NodeIndex replacement = getRedundantReplacement(nodeIndex);
- if (replacement != NoNode) {
- // This local variable must be unused in this block.
- ASSERT(basicBlock->variablesAtTail.local(local) == nodeIndex);
- basicBlock->variablesAtHead.local(local) = replacement;
- basicBlock->variablesAtTail.local(local) = replacement;
- }
- }
- }
- }
- }
-
-};
-
-bool performRedundantPhiElimination(Graph& graph)
-{
- SamplingRegion samplingRegion("DFG Redundant Phi Elimination Phase");
- return runPhase<RedundantPhiEliminationPhase>(graph);
-}
-
-} } // namespace JSC::DFG
-
-#endif // ENABLE(DFG_JIT)
Deleted: trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.h (126688 => 126689)
--- trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.h 2012-08-25 22:26:46 UTC (rev 126688)
+++ trunk/Source/_javascript_Core/dfg/DFGRedundantPhiEliminationPhase.h 2012-08-25 22:34:43 UTC (rev 126689)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. 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.
- */
-
-#ifndef DFGRedundantPhiEliminationPhase_h
-#define DFGRedundantPhiEliminationPhase_h
-
-#include <wtf/Platform.h>
-
-#if ENABLE(DFG_JIT)
-
-#include "DFGPhase.h"
-
-namespace JSC { namespace DFG {
-
-class Graph;
-
-// We inserted many can-be-redundant Phi nodes when building the graph.
-// This phase will just remove them.
-
-bool performRedundantPhiElimination(Graph&);
-
-} } // namespace JSC::DFG
-
-#endif // ENABLE(DFG_JIT)
-
-#endif // DFGRedundantPhiEliminationPhase_h
-