Ignore:
Timestamp:
Sep 14, 2020, 6:25:54 PM (5 years ago)
Author:
[email protected]
Message:

BytecodeParser should GetLocal op_ret's value even if it's unused by the caller
https://bugs.webkit.org/show_bug.cgi?id=216506

Reviewed by Mark Lam.

JSTests:

  • stress/osr-availability-should-see-unused-return-as-available.js: Added.

(foo):
(set isFinite):

Source/JavaScriptCore:

We have to unconditionally GetLocal operands each bytecode claims to use
regardless of true liveness. This is important to keep OSRAvailability simple.
However, op_ret would only GetLocal the return value if we knew the value
was going to be used by an inline caller.

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

File:
1 edited

Legend:

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

    r266242 r267062  
    65216521            auto bytecode = currentInstruction->as<OpRet>();
    65226522            ASSERT(!m_currentBlock->terminal());
     6523            // We have to get the return here even if we know the caller won't use it because the GetLocal may
     6524            // be the only thing keeping m_value alive for OSR.
     6525            auto returnValue = get(bytecode.m_value);
     6526
    65236527            if (!inlineCallFrame()) {
    65246528                // Simple case: we are just producing a return
    6525                 addToGraph(Return, get(bytecode.m_value));
     6529                addToGraph(Return, returnValue);
    65266530                flushForReturn();
    65276531                LAST_OPCODE(op_ret);
     
    65306534            flushForReturn();
    65316535            if (m_inlineStackTop->m_returnValue.isValid())
    6532                 setDirect(m_inlineStackTop->m_returnValue, get(bytecode.m_value), ImmediateSetWithFlush);
     6536                setDirect(m_inlineStackTop->m_returnValue, returnValue, ImmediateSetWithFlush);
    65336537
    65346538            if (!m_inlineStackTop->m_continuationBlock && m_currentIndex.offset() + currentInstruction->size() != m_inlineStackTop->m_codeBlock->instructions().size()) {
Note: See TracChangeset for help on using the changeset viewer.