Changeset 246910 in webkit


Ignore:
Timestamp:
Jun 27, 2019 5:26:35 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

FTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
https://bugs.webkit.org/show_bug.cgi?id=199291

Reviewed by Yusuke Suzuki and Filip Pizlo.

The sole purpose of keepAlive() is to communicate to B3 that an LValue
needs to be kept alive past the last opportunity for a GC. The only way
we can get a GC is via a function call. Hence, what keepAlive() really
needs to communicate is that the LValue needs to be kept alive past the
last function call. Function calls read and write HeapRange::top().
Currently, B3 does not shuffle writes. Hence, simply inserting the
keepAlive() after the calls that can GC is sufficient.

But to be strictly correct, keepAlive() should also declare that it reads
HeapRange::top(). This will guarantee that the keepAlive patchpoint won't
ever be moved before the function call should B3 gain the ability to shuffle
writes in the future.

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::keepAlive):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r246892 r246910  
     12019-06-27  Mark Lam  <mark.lam@apple.com>
     2
     3        FTL keepAlive()'s patchpoint should also declare that it reads HeapRange::top().
     4        https://bugs.webkit.org/show_bug.cgi?id=199291
     5
     6        Reviewed by Yusuke Suzuki and Filip Pizlo.
     7
     8        The sole purpose of keepAlive() is to communicate to B3 that an LValue
     9        needs to be kept alive past the last opportunity for a GC.  The only way
     10        we can get a GC is via a function call.  Hence, what keepAlive() really
     11        needs to communicate is that the LValue needs to be kept alive past the
     12        last function call.  Function calls read and write HeapRange::top().
     13        Currently, B3 does not shuffle writes.  Hence, simply inserting the
     14        keepAlive() after the calls that can GC is sufficient.
     15
     16        But to be strictly correct, keepAlive() should also declare that it reads
     17        HeapRange::top().  This will guarantee that the keepAlive patchpoint won't
     18        ever be moved before the function call should B3 gain the ability to shuffle
     19        writes in the future.
     20
     21        * ftl/FTLLowerDFGToB3.cpp:
     22        (JSC::FTL::DFG::LowerDFGToB3::keepAlive):
     23
    1242019-06-27  Beth Dakin  <bdakin@apple.com>
    225
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r246740 r246910  
    1728517285        patchpoint->effects = Effects::none();
    1728617286        patchpoint->effects.writesLocalState = true;
     17287        patchpoint->effects.reads = HeapRange::top();
    1728717288        patchpoint->append(value, ValueRep::ColdAny);
    1728817289        patchpoint->setGenerator([=] (CCallHelpers&, const StackmapGenerationParams&) { });
Note: See TracChangeset for help on using the changeset viewer.