https://bugs.webkit.org/show_bug.cgi?id=119504
Source/JavaScriptCore:
Reviewed by Mark Hahnenberg and Oliver Hunt.
Don't do the optimization for strict mode.
* dfg/DFGArgumentsSimplificationPhase.cpp:
(JSC::DFG::ArgumentsSimplificationPhase::run):
(JSC::DFG::ArgumentsSimplificationPhase::pruneObviousArgumentCreations):
LayoutTests:
Reviewed by Mark Hahnenberg and Oliver Hunt.
* fast/js/dfg-arguments-strict-mode-expected.txt: Added.
* fast/js/dfg-arguments-strict-mode.html: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-arguments-strict-mode.js: Added.
(f):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154217
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-08-16 Filip Pizlo <fpizlo@apple.com>
+
+ DFG optimizes out strict mode arguments tear off
+ https://bugs.webkit.org/show_bug.cgi?id=119504
+
+ Reviewed by Mark Hahnenberg and Oliver Hunt.
+
+ * fast/js/dfg-arguments-strict-mode-expected.txt: Added.
+ * fast/js/dfg-arguments-strict-mode.html: Added.
+ * fast/js/jsc-test-list:
+ * fast/js/script-tests/dfg-arguments-strict-mode.js: Added.
+ (f):
+
2013-08-16 Ryosuke Niwa <rniwa@webkit.org>
<https://webkit.org/b/119915> REGRESSION(r154144): ASSERTION FAILED: m_history->provisionalItem() == m_requestedHistoryItem.get()
--- /dev/null
+Tests what happens when you use arguments in strict mode and present the DFG with a tempting optimization opportunity.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS f(1) is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="script-tests/dfg-arguments-strict-mode.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
fast/js/dfg-arguments-osr-exit-multiple-blocks
fast/js/dfg-arguments-osr-exit-multiple-blocks-before-exit
fast/js/dfg-arguments-out-of-bounds
+fast/js/dfg-arguments-strict-mode
fast/js/dfg-arguments-unexpected-escape
fast/js/dfg-arith-add-overflow-check-elimination-predicted-but-not-proven-int
fast/js/dfg-arith-add-overflow-check-elimination-tower-of-large-numbers
--- /dev/null
+description(
+"Tests what happens when you use arguments in strict mode and present the DFG with a tempting optimization opportunity."
+);
+
+function f(a) {
+ "use strict";
+ a = 5;
+ return arguments[0];
+}
+
+noInline(f);
+
+while (!dfgCompiled({f:f}))
+ f(1);
+
+shouldBe("f(1)", "1");
+
+2013-08-16 Filip Pizlo <fpizlo@apple.com>
+
+ DFG optimizes out strict mode arguments tear off
+ https://bugs.webkit.org/show_bug.cgi?id=119504
+
+ Reviewed by Mark Hahnenberg and Oliver Hunt.
+
+ Don't do the optimization for strict mode.
+
+ * dfg/DFGArgumentsSimplificationPhase.cpp:
+ (JSC::DFG::ArgumentsSimplificationPhase::run):
+ (JSC::DFG::ArgumentsSimplificationPhase::pruneObviousArgumentCreations):
+
2013-08-16 Benjamin Poulain <benjamin@webkit.org>
[JSC] x86: improve code generation for xxxTest32
bool changed = false;
// Record which arguments are known to escape no matter what.
- for (unsigned i = codeBlock()->inlineCallFrames().size(); i--;) {
- InlineCallFrame* inlineCallFrame = &codeBlock()->inlineCallFrames()[i];
- if (m_graph.m_executablesWhoseArgumentsEscaped.contains(
- m_graph.executableFor(inlineCallFrame)))
- m_createsArguments.add(inlineCallFrame);
- }
+ for (unsigned i = codeBlock()->inlineCallFrames().size(); i--;)
+ pruneObviousArgumentCreations(&codeBlock()->inlineCallFrames()[i]);
+ pruneObviousArgumentCreations(0); // the machine call frame.
// Create data for variable access datas that we will want to analyze.
for (unsigned i = m_graph.m_variableAccessData.size(); i--;) {
NullableHashTraits<VariableAccessData*> > m_argumentsAliasing;
HashSet<VariableAccessData*> m_isLive;
+ void pruneObviousArgumentCreations(InlineCallFrame* inlineCallFrame)
+ {
+ ScriptExecutable* executable = m_graph.executableFor(inlineCallFrame);
+ if (m_graph.m_executablesWhoseArgumentsEscaped.contains(executable)
+ || executable->isStrictMode())
+ m_createsArguments.add(inlineCallFrame);
+ }
+
void observeBadArgumentsUse(Node* node)
{
if (!node)