Diff
Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (152944 => 152945)
--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-20 17:58:57 UTC (rev 152944)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog 2013-07-20 18:39:32 UTC (rev 152945)
@@ -1,5 +1,28 @@
2013-07-19 Filip Pizlo <[email protected]>
+ fourthTier: StringObjectUse uses structures, and CSE should know that
+ https://bugs.webkit.org/show_bug.cgi?id=118940
+
+ Reviewed by Geoffrey Garen.
+
+ This is asymptomatic right now, but we should fix it.
+
+ * _javascript_Core.xcodeproj/project.pbxproj:
+ * dfg/DFGCSEPhase.cpp:
+ (JSC::DFG::CSEPhase::putStructureStoreElimination):
+ * dfg/DFGEdgeUsesStructure.h: Added.
+ (DFG):
+ (EdgeUsesStructure):
+ (JSC::DFG::EdgeUsesStructure::EdgeUsesStructure):
+ (JSC::DFG::EdgeUsesStructure::operator()):
+ (JSC::DFG::EdgeUsesStructure::result):
+ (JSC::DFG::edgesUseStructure):
+ * dfg/DFGUseKind.h:
+ (DFG):
+ (JSC::DFG::usesStructure):
+
+2013-07-19 Filip Pizlo <[email protected]>
+
fourthTier: String GetByVal out-of-bounds handling is so wrong
https://bugs.webkit.org/show_bug.cgi?id=118935
Modified: branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (152944 => 152945)
--- branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-07-20 17:58:57 UTC (rev 152944)
+++ branches/dfgFourthTier/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2013-07-20 18:39:32 UTC (rev 152945)
@@ -373,6 +373,7 @@
0FE5058C1798ABF500B35F8C /* DFGInPlaceAbstractState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE505881798ABF500B35F8C /* DFGInPlaceAbstractState.cpp */; };
0FE5058D1798ABF500B35F8C /* DFGInPlaceAbstractState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE505891798ABF500B35F8C /* DFGInPlaceAbstractState.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE5058F1798AE7100B35F8C /* DFGMergeMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0FE50593179A604500B35F8C /* DFGEdgeUsesStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50592179A604500B35F8C /* DFGEdgeUsesStructure.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE50591179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
0FE8534B1723CDA500B618F5 /* DFGDesiredWatchpoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */; };
0FE8534C1723CDA500B618F5 /* DFGDesiredWatchpoints.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1425,6 +1426,7 @@
0FE505881798ABF500B35F8C /* DFGInPlaceAbstractState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGInPlaceAbstractState.cpp; path = dfg/DFGInPlaceAbstractState.cpp; sourceTree = "<group>"; };
0FE505891798ABF500B35F8C /* DFGInPlaceAbstractState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGInPlaceAbstractState.h; path = dfg/DFGInPlaceAbstractState.h; sourceTree = "<group>"; };
0FE5058E1798AE6F00B35F8C /* DFGMergeMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGMergeMode.h; path = dfg/DFGMergeMode.h; sourceTree = "<group>"; };
+ 0FE50592179A604500B35F8C /* DFGEdgeUsesStructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGEdgeUsesStructure.h; path = dfg/DFGEdgeUsesStructure.h; sourceTree = "<group>"; };
0FE50590179A492400B35F8C /* DFGSaneStringGetByValSlowPathGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGSaneStringGetByValSlowPathGenerator.h; path = dfg/DFGSaneStringGetByValSlowPathGenerator.h; sourceTree = "<group>"; };
0FE853491723CDA500B618F5 /* DFGDesiredWatchpoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDesiredWatchpoints.cpp; path = dfg/DFGDesiredWatchpoints.cpp; sourceTree = "<group>"; };
0FE8534A1723CDA500B618F5 /* DFGDesiredWatchpoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDesiredWatchpoints.h; path = dfg/DFGDesiredWatchpoints.h; sourceTree = "<group>"; };
@@ -3051,6 +3053,7 @@
0FD3C82214115D0E00FD81CB /* DFGDriver.h */,
0FB4B51B16B62772003F696B /* DFGEdge.cpp */,
0F66E16914DF3F1300B7B2E4 /* DFGEdge.h */,
+ 0FE50592179A604500B35F8C /* DFGEdgeUsesStructure.h */,
0FDB2CD11742D804007B3C1B /* DFGFailedFinalizer.cpp */,
0FDB2CD21742D804007B3C1B /* DFGFailedFinalizer.h */,
0F23BA96175FB70500C48CFE /* DFGFiltrationResult.h */,
@@ -3878,6 +3881,7 @@
86704B8812DBA33700A9FE7B /* YarrParser.h in Headers */,
86704B8A12DBA33700A9FE7B /* YarrPattern.h in Headers */,
86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */,
+ 0FE50593179A604500B35F8C /* DFGEdgeUsesStructure.h in Headers */,
0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
0FBE0F7316C1DB050082C5E8 /* DFGCPSRethreadingPhase.h in Headers */,
0FBE0F7516C1DB0B0082C5E8 /* DFGPredictionInjectionPhase.h in Headers */,
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp (152944 => 152945)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp 2013-07-20 17:58:57 UTC (rev 152944)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGCSEPhase.cpp 2013-07-20 18:39:32 UTC (rev 152945)
@@ -28,6 +28,7 @@
#if ENABLE(DFG_JIT)
+#include "DFGEdgeUsesStructure.h"
#include "DFGGraph.h"
#include "DFGPhase.h"
#include "JSCellInlines.h"
@@ -609,6 +610,8 @@
}
if (m_graph.clobbersWorld(node) || node->canExit())
return 0;
+ if (edgesUseStructure(m_graph, node))
+ return 0;
}
return 0;
}
Added: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGEdgeUsesStructure.h (0 => 152945)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGEdgeUsesStructure.h (rev 0)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGEdgeUsesStructure.h 2013-07-20 18:39:32 UTC (rev 152945)
@@ -0,0 +1,67 @@
+/*
+ * 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 DFGEdgeUsesStructure_h
+#define DFGEdgeUsesStructure_h
+
+#include <wtf/Platform.h>
+
+#if ENABLE(DFG_JIT)
+
+#include "DFGGraph.h"
+
+namespace JSC { namespace DFG {
+
+class EdgeUsesStructure {
+public:
+ EdgeUsesStructure()
+ : m_result(false)
+ {
+ }
+
+ void operator()(Node*, Edge edge)
+ {
+ m_result |= usesStructure(edge.useKind());
+ }
+
+ bool result() const { return m_result; }
+
+private:
+ bool m_result;
+};
+
+inline bool edgesUseStructure(Graph& graph, Node* node)
+{
+ EdgeUsesStructure edgeUsesStructure;
+ DFG_NODE_DO_TO_CHILDREN(graph, node, edgeUsesStructure);
+ return edgeUsesStructure.result();
+}
+
+} } // namespace JSC::DFG
+
+#endif // ENABLE(DFG_JIT)
+
+#endif // DFGEdgeUsesStructure_h
+
Modified: branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGUseKind.h (152944 => 152945)
--- branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGUseKind.h 2013-07-20 17:58:57 UTC (rev 152944)
+++ branches/dfgFourthTier/Source/_javascript_Core/dfg/DFGUseKind.h 2013-07-20 18:39:32 UTC (rev 152945)
@@ -159,6 +159,19 @@
}
}
+// Returns true if it uses structure in a way that could be clobbered by
+// things that change the structure.
+ALWAYS_INLINE bool usesStructure(UseKind kind)
+{
+ switch (kind) {
+ case StringObjectUse:
+ case StringOrStringObjectUse:
+ return true;
+ default:
+ return false;
+ }
+}
+
} } // namespace JSC::DFG
namespace WTF {