Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (189137 => 189138)
--- trunk/Source/_javascript_Core/ChangeLog 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-08-29 02:04:36 UTC (rev 189138)
@@ -1,5 +1,22 @@
2015-08-28 Benjamin Poulain <bpoul...@apple.com>
+ [JSC] Get rid of DFG's MergeMode
+ https://bugs.webkit.org/show_bug.cgi?id=148245
+
+ Reviewed by Mark Lam.
+
+ That code has become useless, the merge mode is always MergeToSuccessors.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * dfg/DFGCFAPhase.cpp:
+ (JSC::DFG::CFAPhase::performBlockCFA):
+ * dfg/DFGInPlaceAbstractState.cpp:
+ (JSC::DFG::InPlaceAbstractState::endBasicBlock):
+ * dfg/DFGInPlaceAbstractState.h:
+ * dfg/DFGMergeMode.h: Removed.
+
+2015-08-28 Benjamin Poulain <bpoul...@apple.com>
+
[JSC][x86] Improve the compare functions when comparing with zero
https://bugs.webkit.org/show_bug.cgi?id=148536
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj (189137 => 189138)
--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj 2015-08-29 02:04:36 UTC (rev 189138)
@@ -1170,7 +1170,6 @@
<ClInclude Include="..\dfg\DFGLongLivedState.h" />
<ClInclude Include="..\dfg\DFGLoopPreHeaderCreationPhase.h" />
<ClInclude Include="..\dfg\DFGMayExit.h" />
- <ClInclude Include="..\dfg\DFGMergeMode.h" />
<ClInclude Include="..\dfg\DFGMinifiedGraph.h" />
<ClInclude Include="..\dfg\DFGMinifiedID.h" />
<ClInclude Include="..\dfg\DFGMinifiedNode.h" />
Modified: trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters (189137 => 189138)
--- trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/_javascript_Core.vcxproj/_javascript_Core.vcxproj.filters 2015-08-29 02:04:36 UTC (rev 189138)
@@ -3736,9 +3736,6 @@
<ClInclude Include="..\dfg\DFGLoopPreHeaderCreationPhase.h">
<Filter>dfg</Filter>
</ClInclude>
- <ClInclude Include="..\dfg\DFGMergeMode.h">
- <Filter>dfg</Filter>
- </ClInclude>
<ClInclude Include="..\dfg\DFGMinifiedGraph.h">
<Filter>dfg</Filter>
</ClInclude>
Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (189137 => 189138)
--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2015-08-29 02:04:36 UTC (rev 189138)
@@ -1377,7 +1377,6 @@
A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D8FF17A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
A704D90517A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */; };
A704D90617A0BAA8006BA554 /* DFGInPlaceAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = A704D90217A0BAA8006BA554 /* DFGMergeMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
A709F2F017A0AC0400512E98 /* SlowPathCall.h in Headers */ = {isa = PBXBuildFile; fileRef = A709F2EF17A0AC0400512E98 /* SlowPathCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
A709F2F217A0AC2A00512E98 /* CommonSlowPaths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A709F2F117A0AC2A00512E98 /* CommonSlowPaths.cpp */; };
A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; };
@@ -3233,7 +3232,6 @@
A704D8FF17A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractInterpreterInlines.h; path = dfg/DFGAbstractInterpreterInlines.h; sourceTree = "<group>"; };
A704D90017A0BAA8006BA554 /* DFGInPlaceAbstractState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGInPlaceAbstractState.cpp; path = dfg/DFGInPlaceAbstractState.cpp; sourceTree = "<group>"; };
A704D90117A0BAA8006BA554 /* DFGInPlaceAbstractState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInPlaceAbstractState.h; path = dfg/DFGInPlaceAbstractState.h; sourceTree = "<group>"; };
- A704D90217A0BAA8006BA554 /* DFGMergeMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGMergeMode.h; path = dfg/DFGMergeMode.h; sourceTree = "<group>"; };
A709F2EF17A0AC0400512E98 /* SlowPathCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SlowPathCall.h; sourceTree = "<group>"; };
A709F2F117A0AC2A00512E98 /* CommonSlowPaths.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommonSlowPaths.cpp; sourceTree = "<group>"; };
A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITOpcodes32_64.cpp; sourceTree = "<group>"; };
@@ -5247,7 +5245,6 @@
A767B5B417A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h */,
0F5874EB194FEB1200AAB2C1 /* DFGMayExit.cpp */,
0F5874EC194FEB1200AAB2C1 /* DFGMayExit.h */,
- A704D90217A0BAA8006BA554 /* DFGMergeMode.h */,
0F1725FE1B48719A00AC3A55 /* DFGMinifiedGraph.cpp */,
0F2BDC3D1522801700CD8910 /* DFGMinifiedGraph.h */,
0FB4B51016B3A964003F696B /* DFGMinifiedID.h */,
@@ -6143,7 +6140,6 @@
709FB8681AE335C60039D069 /* JSWeakSet.h in Headers */,
A767B5B617A0B9650063D940 /* DFGLoopPreHeaderCreationPhase.h in Headers */,
0F2B9CED19D0BA7D00B1D1B5 /* DFGPromotedHeapLocation.h in Headers */,
- A704D90717A0BAA8006BA554 /* DFGMergeMode.h in Headers */,
0FB17663196B8F9E0091052A /* DFGPureValue.h in Headers */,
FE68C6371B90DE040042BCB3 /* MacroAssemblerPrinter.h in Headers */,
0F2BDC451522801B00CD8910 /* DFGMinifiedGraph.h in Headers */,
Modified: trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp (189137 => 189138)
--- trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/dfg/DFGCFAPhase.cpp 2015-08-29 02:04:36 UTC (rev 189138)
@@ -173,7 +173,7 @@
m_interpreter.dump(WTF::dataFile());
dataLogF("\n");
}
- m_changed |= m_state.endBasicBlock(MergeToSuccessors);
+ m_changed |= m_state.endBasicBlock();
if (m_verbose) {
dataLog(" tail vars: ", block->valuesAtTail, "\n");
Modified: trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp (189137 => 189138)
--- trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.cpp 2015-08-29 02:04:36 UTC (rev 189138)
@@ -162,7 +162,7 @@
}
}
-bool InPlaceAbstractState::endBasicBlock(MergeMode mergeMode)
+bool InPlaceAbstractState::endBasicBlock()
{
ASSERT(m_block);
@@ -177,50 +177,41 @@
return false;
}
- bool changed = false;
+ bool changed = checkAndSet(block->cfaStructureClobberStateAtTail, m_structureClobberState);
- if ((mergeMode != DontMerge) || !ASSERT_DISABLED) {
- changed |= checkAndSet(block->cfaStructureClobberStateAtTail, m_structureClobberState);
-
- switch (m_graph.m_form) {
- case ThreadedCPS: {
- for (size_t argument = 0; argument < block->variablesAtTail.numberOfArguments(); ++argument) {
- AbstractValue& destination = block->valuesAtTail.argument(argument);
- changed |= mergeStateAtTail(destination, m_variables.argument(argument), block->variablesAtTail.argument(argument));
- }
-
- for (size_t local = 0; local < block->variablesAtTail.numberOfLocals(); ++local) {
- AbstractValue& destination = block->valuesAtTail.local(local);
- changed |= mergeStateAtTail(destination, m_variables.local(local), block->variablesAtTail.local(local));
- }
- break;
+ switch (m_graph.m_form) {
+ case ThreadedCPS: {
+ for (size_t argument = 0; argument < block->variablesAtTail.numberOfArguments(); ++argument) {
+ AbstractValue& destination = block->valuesAtTail.argument(argument);
+ changed |= mergeStateAtTail(destination, m_variables.argument(argument), block->variablesAtTail.argument(argument));
}
-
- case SSA: {
- for (size_t i = 0; i < block->valuesAtTail.size(); ++i)
- changed |= block->valuesAtTail[i].merge(m_variables[i]);
-
- HashSet<Node*>::iterator iter = block->ssa->liveAtTail.begin();
- HashSet<Node*>::iterator end = block->ssa->liveAtTail.end();
- for (; iter != end; ++iter) {
- Node* node = *iter;
- changed |= block->ssa->valuesAtTail.find(node)->value.merge(forNode(node));
- }
- break;
+
+ for (size_t local = 0; local < block->variablesAtTail.numberOfLocals(); ++local) {
+ AbstractValue& destination = block->valuesAtTail.local(local);
+ changed |= mergeStateAtTail(destination, m_variables.local(local), block->variablesAtTail.local(local));
}
-
- default:
- RELEASE_ASSERT_NOT_REACHED();
+ break;
+ }
+
+ case SSA: {
+ for (size_t i = 0; i < block->valuesAtTail.size(); ++i)
+ changed |= block->valuesAtTail[i].merge(m_variables[i]);
+
+ HashSet<Node*>::iterator iter = block->ssa->liveAtTail.begin();
+ HashSet<Node*>::iterator end = block->ssa->liveAtTail.end();
+ for (; iter != end; ++iter) {
+ Node* node = *iter;
+ changed |= block->ssa->valuesAtTail.find(node)->value.merge(forNode(node));
}
+ break;
}
-
- ASSERT(mergeMode != DontMerge || !changed);
-
+
+ default:
+ RELEASE_ASSERT_NOT_REACHED();
+ }
+
reset();
- if (mergeMode != MergeToSuccessors)
- return changed;
-
return mergeToSuccessors(block);
}
Modified: trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h (189137 => 189138)
--- trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/dfg/DFGInPlaceAbstractState.h 2015-08-29 02:04:36 UTC (rev 189138)
@@ -31,7 +31,6 @@
#include "DFGAbstractValue.h"
#include "DFGBranchDirection.h"
#include "DFGGraph.h"
-#include "DFGMergeMode.h"
#include "DFGNode.h"
namespace JSC { namespace DFG {
@@ -76,26 +75,14 @@
// Finish abstractly executing a basic block. If MergeToTail or
// MergeToSuccessors is passed, then this merges everything we have
// learned about how the state changes during this block's execution into
- // the block's data structures. There are three return modes, depending
- // on the value of mergeMode:
+ // the block's data structures.
//
- // DontMerge:
- // Always returns false.
- //
- // MergeToTail:
- // Returns true if the state of the block at the tail was changed.
- // This means that you must call mergeToSuccessors(), and if that
- // returns true, then you must revisit (at least) the successor
- // blocks. False will always be returned if the block is terminal
- // (i.e. ends in Throw or Return, or has a ForceOSRExit inside it).
- //
- // MergeToSuccessors:
- // Returns true if the state of the block at the tail was changed,
- // and, if the state at the heads of successors was changed.
- // A true return means that you must revisit (at least) the successor
- // blocks. This also sets cfaShouldRevisit to true for basic blocks
- // that must be visited next.
- bool endBasicBlock(MergeMode);
+ // Returns true if the state of the block at the tail was changed,
+ // and, if the state at the heads of successors was changed.
+ // A true return means that you must revisit (at least) the successor
+ // blocks. This also sets cfaShouldRevisit to true for basic blocks
+ // that must be visited next.
+ bool endBasicBlock();
// Reset the AbstractState. This throws away any results, and at this point
// you can safely call beginBasicBlock() on any basic block.
Deleted: trunk/Source/_javascript_Core/dfg/DFGMergeMode.h (189137 => 189138)
--- trunk/Source/_javascript_Core/dfg/DFGMergeMode.h 2015-08-29 01:58:05 UTC (rev 189137)
+++ trunk/Source/_javascript_Core/dfg/DFGMergeMode.h 2015-08-29 02:04:36 UTC (rev 189138)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2013 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.
- */
-
-#ifndef DFGMergeMode_h
-#define DFGMergeMode_h
-
-namespace JSC { namespace DFG {
-
-enum MergeMode {
- // Don't merge the state in AbstractState with basic blocks.
- DontMerge,
-
- // Merge the state in AbstractState with the tail of the basic
- // block being analyzed.
- MergeToTail,
-
- // Merge the state in AbstractState with the tail of the basic
- // block, and with the heads of successor blocks.
- MergeToSuccessors
-};
-
-} } // namespace JSC::DFG
-
-#endif // DFGMergeMode_h
-