Changeset 249499 in webkit


Ignore:
Timestamp:
Sep 4, 2019 2:12:47 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Structure::storedPrototype() and storedPrototypeObject() should assert with isCompilationThread(), not !isMainThread().
https://bugs.webkit.org/show_bug.cgi?id=201449

Reviewed by Yusuke Suzuki.

Using !isMainThread() in the assertion also disables the assertion for the mutator
of worker threads. This is not what we intended.

  • runtime/StructureInlines.h:

(JSC::Structure::storedPrototype const):
(JSC::Structure::storedPrototypeObject const):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r249495 r249499  
     12019-09-03  Mark Lam  <mark.lam@apple.com>
     2
     3        Structure::storedPrototype() and storedPrototypeObject() should assert with isCompilationThread(), not !isMainThread().
     4        https://bugs.webkit.org/show_bug.cgi?id=201449
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Using !isMainThread() in the assertion also disables the assertion for the mutator
     9        of worker threads.  This is not what we intended.
     10
     11        * runtime/StructureInlines.h:
     12        (JSC::Structure::storedPrototype const):
     13        (JSC::Structure::storedPrototypeObject const):
     14
    1152019-09-04  Mark Lam  <mark.lam@apple.com>
    216
  • trunk/Source/JavaScriptCore/runtime/StructureInlines.h

    r249247 r249499  
    3333#include "StructureChain.h"
    3434#include "StructureRareDataInlines.h"
     35#include <wtf/Threading.h>
    3536
    3637namespace JSC {
     
    109110ALWAYS_INLINE JSValue Structure::storedPrototype(const JSObject* object) const
    110111{
    111     ASSERT(!isMainThread() || object->structure() == this);
     112    ASSERT(isCompilationThread() || Thread::mayBeGCThread() || object->structure() == this);
    112113    if (hasMonoProto())
    113114        return storedPrototype();
     
    117118ALWAYS_INLINE JSObject* Structure::storedPrototypeObject(const JSObject* object) const
    118119{
    119     ASSERT(!isMainThread() || object->structure() == this);
     120    ASSERT(isCompilationThread() || Thread::mayBeGCThread() || object->structure() == this);
    120121    if (hasMonoProto())
    121122        return storedPrototypeObject();
Note: See TracChangeset for help on using the changeset viewer.