Changeset 225933 in webkit


Ignore:
Timestamp:
Dec 14, 2017, 2:28:09 PM (7 years ago)
Author:
keith_miller@apple.com
Message:

Fix assertion in JSObject's structure setting methods
https://bugs.webkit.org/show_bug.cgi?id=180840

Reviewed by Mark Lam.

I forgot that when Typed Arrays have non-indexed properties
added to them, they call the generic code. The generic code
in turn calls the regular structure setting methods. Thus,
these assertions were invalid and we should just avoid setting
the indexing mask if we have a Typed Array.

  • runtime/JSObject.h:

(JSC::JSObject::setButterfly):
(JSC::JSObject::nukeStructureAndSetButterfly):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r225930 r225933  
     12017-12-14  Keith Miller  <keith_miller@apple.com>
     2
     3        Fix assertion in JSObject's structure setting methods
     4        https://bugs.webkit.org/show_bug.cgi?id=180840
     5
     6        Reviewed by Mark Lam.
     7
     8        I forgot that when Typed Arrays have non-indexed properties
     9        added to them, they call the generic code. The generic code
     10        in turn calls the regular structure setting methods. Thus,
     11        these assertions were invalid and we should just avoid setting
     12        the indexing mask if we have a Typed Array.
     13
     14        * runtime/JSObject.h:
     15        (JSC::JSObject::setButterfly):
     16        (JSC::JSObject::nukeStructureAndSetButterfly):
     17
    1182017-12-14  Michael Saboff  <msaboff@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r225913 r225933  
    12661266inline void JSObject::setButterfly(VM& vm, Butterfly* butterfly)
    12671267{
    1268     ASSERT(!structure()->hijacksIndexingHeader());
    1269     m_butterflyIndexingMask = butterfly->computeIndexingMask();
     1268    if (LIKELY(!structure(vm)->hijacksIndexingHeader()))
     1269        m_butterflyIndexingMask = butterfly->computeIndexingMask();
    12701270    ASSERT(m_butterflyIndexingMask >= butterfly->vectorLength());
    12711271    if (isX86() || vm.heap.mutatorShouldBeFenced()) {
     
    12811281inline void JSObject::nukeStructureAndSetButterfly(VM& vm, StructureID oldStructureID, Butterfly* butterfly)
    12821282{
    1283     ASSERT(!vm.getStructure(oldStructureID)->hijacksIndexingHeader());
    1284     m_butterflyIndexingMask = butterfly->computeIndexingMask();
     1283    if (LIKELY(!vm.getStructure(oldStructureID)->hijacksIndexingHeader()))
     1284        m_butterflyIndexingMask = butterfly->computeIndexingMask();
    12851285    ASSERT(m_butterflyIndexingMask >= butterfly->vectorLength());
    12861286    if (isX86() || vm.heap.mutatorShouldBeFenced()) {
Note: See TracChangeset for help on using the changeset viewer.