From b653da9a88901fbc44114cac9232a6a332d2d0a7 Mon Sep 17 00:00:00 2001 From: Filip Pizlo Date: Tue, 7 Apr 2015 13:20:07 +0200 Subject: DFG optimizes out strict mode arguments tear off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154217 268f45cc-cd09-0410-ab3c-d52691b4dbfc Change-Id: I68037df21deaa964ff18c4f168f465c2600627f7 Reviewed-by: Julien Brianceau Reviewed-by: Michael BrĂ¼ning --- .../dfg/DFGArgumentsSimplificationPhase.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp index cbab4e8c8..ec7515eec 100644 --- a/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp +++ b/Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp @@ -123,12 +123,9 @@ public: 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--;) { @@ -700,6 +697,14 @@ private: NullableHashTraits > m_argumentsAliasing; HashSet m_isLive; + void pruneObviousArgumentCreations(InlineCallFrame* inlineCallFrame) + { + ScriptExecutable* executable = jsCast(m_graph.executableFor(inlineCallFrame)); + if (m_graph.m_executablesWhoseArgumentsEscaped.contains(executable) + || executable->isStrictMode()) + m_createsArguments.add(inlineCallFrame); + } + void observeBadArgumentsUse(Node* node) { if (!node) -- cgit v1.2.1