Changeset 255416 in webkit


Ignore:
Timestamp:
Jan 29, 2020 9:51:43 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

Fix bad assertion in InternalFunctionAllocationProfile::createAllocationStructureFromBase().
https://bugs.webkit.org/show_bug.cgi?id=206981
<rdar://problem/58985736>

Reviewed by Keith Miller.

JSTests:

  • stress/InternalFunctionAllocationProfile-createAllocationStructureFromBase-should-allow-for-same-classInfo-from-different-globals.js: Added.

Source/JavaScriptCore:

InternalFunctionAllocationProfile::createAllocationStructureFromBase() is only
called from FunctionRareData::createInternalFunctionAllocationStructureFromBase(),
which in turn is only called from InternalFunction::createSubclassStructureSlow().

InternalFunction::createSubclassStructureSlow() only allows a call to
FunctionRareData::createInternalFunctionAllocationStructureFromBase() under
certain conditions. One of these conditions is that the baseGlobalObject is
different than the newTarget's globalObject.

InternalFunctionAllocationProfile::createAllocationStructureFromBase() has an
ASSERT on the same set of conditions, with one ommission: the one above. This
patch fixes the ASSERT by adding the missing condition to match the check in
InternalFunction::createSubclassStructureSlow().

  • bytecode/InternalFunctionAllocationProfile.h:

(JSC::InternalFunctionAllocationProfile::createAllocationStructureFromBase):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r255390 r255416  
     12020-01-29  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix bad assertion in InternalFunctionAllocationProfile::createAllocationStructureFromBase().
     4        https://bugs.webkit.org/show_bug.cgi?id=206981
     5        <rdar://problem/58985736>
     6
     7        Reviewed by Keith Miller.
     8
     9        * stress/InternalFunctionAllocationProfile-createAllocationStructureFromBase-should-allow-for-same-classInfo-from-different-globals.js: Added.
     10
    1112020-01-29  Yusuke Suzuki  <ysuzuki@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r255406 r255416  
     12020-01-29  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix bad assertion in InternalFunctionAllocationProfile::createAllocationStructureFromBase().
     4        https://bugs.webkit.org/show_bug.cgi?id=206981
     5        <rdar://problem/58985736>
     6
     7        Reviewed by Keith Miller.
     8
     9        InternalFunctionAllocationProfile::createAllocationStructureFromBase() is only
     10        called from FunctionRareData::createInternalFunctionAllocationStructureFromBase(),
     11        which in turn is only called from InternalFunction::createSubclassStructureSlow().
     12
     13        InternalFunction::createSubclassStructureSlow() only allows a call to
     14        FunctionRareData::createInternalFunctionAllocationStructureFromBase() under
     15        certain conditions.  One of these conditions is that the baseGlobalObject is
     16        different than the newTarget's globalObject.
     17
     18        InternalFunctionAllocationProfile::createAllocationStructureFromBase() has an
     19        ASSERT on the same set of conditions, with one ommission: the one above.  This
     20        patch fixes the ASSERT by adding the missing condition to match the check in
     21        InternalFunction::createSubclassStructureSlow().
     22
     23        * bytecode/InternalFunctionAllocationProfile.h:
     24        (JSC::InternalFunctionAllocationProfile::createAllocationStructureFromBase):
     25
    1262020-01-29  Robin Morisset  <rmorisset@apple.com>
    227
  • trunk/Source/JavaScriptCore/bytecode/InternalFunctionAllocationProfile.h

    r251425 r255416  
    4848inline Structure* InternalFunctionAllocationProfile::createAllocationStructureFromBase(VM& vm, JSGlobalObject* baseGlobalObject, JSCell* owner, JSObject* prototype, Structure* baseStructure)
    4949{
    50     ASSERT(!m_structure || m_structure.get()->classInfo() != baseStructure->classInfo());
     50    ASSERT(!m_structure || m_structure.get()->classInfo() != baseStructure->classInfo() || m_structure->globalObject() != baseGlobalObject);
    5151    ASSERT(baseStructure->hasMonoProto());
    5252
Note: See TracChangeset for help on using the changeset viewer.