⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 202955 in webkit


Ignore:
Timestamp:
Jul 7, 2016, 8:47:59 PM (10 years ago)
Author:
msaboff@apple.com
Message:

REGRESSION(184445): Need to insert a StoreBarrier when we don't know child's epoch
https://bugs.webkit.org/show_bug.cgi?id=159537

Reviewed by Benjamin Poulain.

We weren't checking the case of a child node with a null epoch. The problem surfaces
when the base node of a PutByVal variant has a non-null epoch, because it represents an
allocation in the current function, while the child of the same node has an unknown epoch.
Added a check that the child node is not null before comparing the epochs of the base and
child nodes.

The added test creates the problem circumstance by doing a full GC to place an array in
remembered space, allocating a new object followed by an eden GC. The new object is
only referenced by the array and therefore won't be visited Without the store barrier.
The test may crash or more likely get the wrong answer with the bug.

  • dfg/DFGStoreBarrierInsertionPhase.cpp:
  • tests/stress/regress-159537.js: Added test.

(MyNumber):
(MyNumber.prototype.plusOne):
(bar):
(foo):
(test):

Location:
trunk/Source/JavaScriptCore
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r202954 r202955  
     12016-07-07  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION(184445): Need to insert a StoreBarrier when we don't know child's epoch
     4        https://bugs.webkit.org/show_bug.cgi?id=159537
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        We weren't checking the case of a child node with a null epoch.  The problem surfaces
     9        when the base node of a PutByVal variant has a non-null epoch, because it represents an
     10        allocation in the current function, while the child of the same node has an unknown epoch.
     11        Added a check that the child node is not null before comparing the epochs of the base and
     12        child nodes.
     13
     14        The added test creates the problem circumstance by doing a full GC to place an array in
     15        remembered space, allocating a new object followed by an eden GC.  The new object is
     16        only referenced by the array and therefore won't be visited Without the store barrier.
     17        The test may crash or more likely get the wrong answer with the bug.
     18
     19        * dfg/DFGStoreBarrierInsertionPhase.cpp:
     20        * tests/stress/regress-159537.js: Added test.
     21        (MyNumber):
     22        (MyNumber.prototype.plusOne):
     23        (bar):
     24        (foo):
     25        (test):
     26
    1272016-07-07  Joseph Pecoraro  <pecoraro@apple.com>
    228
  • trunk/Source/JavaScriptCore/dfg/DFGStoreBarrierInsertionPhase.cpp

    r199300 r202955  
    460460        // allocated before we did any epoch tracking. Two objects being in the null epoch
    461461        // means that we don't know their epoch relationship.
    462         if (!!base->epoch() && base->epoch() >= child->epoch()) {
     462        if (!!base->epoch() && !!child->epoch() && base->epoch() >= child->epoch()) {
    463463            if (verbose)
    464464                dataLog("            Rejecting because of epoch ordering.\n");
    465465            return;
    466466        }
    467        
     467
    468468        considerBarrier(base);
    469469    }
Note: See TracChangeset for help on using the changeset viewer.