Ignore:
Timestamp:
Dec 14, 2017, 2:28:09 PM (8 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.