Ignore:
Timestamp:
Feb 2, 2015, 10:15:44 AM (10 years ago)
Author:
[email protected]
Message:

Converting Flushes and PhantomLocals to Phantoms requires an OSR availability analysis rather than just using the SetLocal's child
https://bugs.webkit.org/show_bug.cgi?id=141107

Reviewed by Michael Saboff.

See the bugzilla for a discussion of the problem. This addresses the problem by ensuring
that Flushes are always strength-reduced to PhantomLocals, and CPS rethreading does a mini
OSR availability analysis to determine the right MovHint value to use for the Phantom.

  • dfg/DFGCPSRethreadingPhase.cpp:

(JSC::DFG::CPSRethreadingPhase::CPSRethreadingPhase):
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::clearVariables):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::clearVariablesAtHeadAndTail): Deleted.

  • dfg/DFGNode.h:

(JSC::DFG::Node::convertPhantomToPhantomLocal):
(JSC::DFG::Node::convertFlushToPhantomLocal):
(JSC::DFG::Node::convertToPhantomLocal): Deleted.

  • dfg/DFGStrengthReductionPhase.cpp:

(JSC::DFG::StrengthReductionPhase::handleNode):

  • tests/stress/inline-call-that-doesnt-use-all-args.js: Added.

(foo):
(bar):
(baz):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp

    r176479 r179477  
    11/*
    2  * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    281281                break;
    282282           
    283             m_node->convertToPhantom();
    284             Node* dataNode = setLocal->child1().node();
    285             DFG_ASSERT(m_graph, m_node, dataNode->hasResult());
    286             m_node->child1() = dataNode->defaultEdge();
     283            // The Flush should become a PhantomLocal at this point. This means that we want the
     284            // local's value during OSR, but we don't care if the value is stored to the stack. CPS
     285            // rethreading can canonicalize PhantomLocals for us.
     286            m_node->convertFlushToPhantomLocal();
    287287            m_graph.dethread();
    288288            m_changed = true;
Note: See TracChangeset for help on using the changeset viewer.