Changeset 267062 in webkit


Ignore:
Timestamp:
Sep 14, 2020 6:25:54 PM (4 years ago)
Author:
keith_miller@apple.com
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):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r267040 r267062  
     12020-09-14  Keith Miller  <keith_miller@apple.com>
     2
     3        BytecodeParser should GetLocal op_ret's value even if it's unused by the caller
     4        https://bugs.webkit.org/show_bug.cgi?id=216506
     5
     6        Reviewed by Mark Lam.
     7
     8        * stress/osr-availability-should-see-unused-return-as-available.js: Added.
     9        (foo):
     10        (set isFinite):
     11
    1122020-09-14  Alexey Shvayka  <shvaikalesh@gmail.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r267040 r267062  
     12020-09-14  Keith Miller  <keith_miller@apple.com>
     2
     3        BytecodeParser should GetLocal op_ret's value even if it's unused by the caller
     4        https://bugs.webkit.org/show_bug.cgi?id=216506
     5
     6        Reviewed by Mark Lam.
     7
     8        We have to unconditionally GetLocal operands each bytecode claims to use
     9        regardless of true liveness. This is important to keep OSRAvailability simple.
     10        However, op_ret would only GetLocal the return value if we knew the value
     11        was going to be used by an inline caller.
     12
     13        * dfg/DFGByteCodeParser.cpp:
     14        (JSC::DFG::ByteCodeParser::parseBlock):
     15
    1162020-09-14  Alexey Shvayka  <shvaikalesh@gmail.com>
    217
  • 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.