Changeset 276162 in webkit


Ignore:
Timestamp:
Apr 16, 2021, 12:59:33 PM (4 years ago)
Author:
mark.lam@apple.com
Message:

More changes to support the TerminationException.
https://bugs.webkit.org/show_bug.cgi?id=224681
rdar://76698113

Reviewed by Keith Miller.

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeProgram):

  • ProgramExecutable::initializeGlobalProperties() can throw the TerminationException. Add handling for that.
  • runtime/JSObject.cpp:

(JSC::JSObject::defineOwnIndexedProperty):

  • JSObject::defineOwnIndexedProperty() has a blob of assertion code that it verifying that getOwnPropertyDescriptor() should succeed without throwing any exceptions if the fast path is allowed. However, this is assertion is only true if there isn't a termination being requested. So, use the DeferTermination scope to allow this assertion to be tested without the complication of a TerminationException.
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r276155 r276162  
     12021-04-16  Mark Lam  <mark.lam@apple.com>
     2
     3        More changes to support the TerminationException.
     4        https://bugs.webkit.org/show_bug.cgi?id=224681
     5        rdar://76698113
     6
     7        Reviewed by Keith Miller.
     8
     9        * interpreter/Interpreter.cpp:
     10        (JSC::Interpreter::executeProgram):
     11        - ProgramExecutable::initializeGlobalProperties() can throw the TerminationException.
     12          Add handling for that.
     13
     14        * runtime/JSObject.cpp:
     15        (JSC::JSObject::defineOwnIndexedProperty):
     16        - JSObject::defineOwnIndexedProperty() has a blob of assertion code that it verifying
     17          that getOwnPropertyDescriptor() should succeed without throwing any exceptions if
     18          the fast path is allowed.  However, this is assertion is only true if there isn't
     19          a termination being requested.  So, use the DeferTermination scope to allow this
     20          assertion to be tested without the complication of a TerminationException.
     21
    1222021-04-16  Keith Miller  <keith_miller@apple.com>
    223
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r275860 r276162  
    798798    // Compile source to bytecode if necessary:
    799799    JSObject* error = program->initializeGlobalProperties(vm, globalObject, scope);
    800     EXCEPTION_ASSERT(!throwScope.exception() || !error);
     800    EXCEPTION_ASSERT(!throwScope.exception() || !error || vm.isTerminationException(throwScope.exception()));
     801    RETURN_IF_EXCEPTION(throwScope, checkedReturn(throwScope.exception()));
    801802    if (UNLIKELY(error))
    802803        return checkedReturn(throwException(globalObject, throwScope, error));
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r275788 r276162  
    26262626#if ASSERT_ENABLED
    26272627        if (canGetIndexQuickly(index) && canDoFastPutDirectIndex(vm, this)) {
     2628            DeferTermination deferScope(vm);
    26282629            PropertyDescriptor currentDescriptor;
    26292630            ASSERT(getOwnPropertyDescriptor(globalObject, Identifier::from(vm, index), currentDescriptor));
Note: See TracChangeset for help on using the changeset viewer.