Changeset 259576 in webkit


Ignore:
Timestamp:
Apr 6, 2020 10:35:44 AM (4 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] Since ArrayBufferViewWatchpointAdaptor::add can fire watchpoints, DFG::Plan should check validity of CodeBlock after executing reallyAdd
https://bugs.webkit.org/show_bug.cgi?id=210055
<rdar://problem/61331962>

Reviewed by Keith Miller.

JSTests:

  • stress/array-buffer-view-watchpoint-can-be-fired-in-really-add-in-dfg.js: Added.

(xxx.foo):

Source/JavaScriptCore:

Since ArrayBufferViewWatchpointAdaptor::add can fire watchpoints, it is possible that the DFG CodeBlock is already invalidated after executing DFG::Plan::reallyAdd.
We should check CodeBlock's validity again and terminate DFG::Plan::finalizeWithoutNotifyingCallback with CompilationInvalidated if CodeBlock got invalidated.

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r259564 r259576  
     12020-04-06  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Since ArrayBufferViewWatchpointAdaptor::add can fire watchpoints, DFG::Plan should check validity of CodeBlock after executing reallyAdd
     4        https://bugs.webkit.org/show_bug.cgi?id=210055
     5        <rdar://problem/61331962>
     6
     7        Reviewed by Keith Miller.
     8
     9        * stress/array-buffer-view-watchpoint-can-be-fired-in-really-add-in-dfg.js: Added.
     10        (xxx.foo):
     11
    1122020-04-05  Ross Kirsling  <ross.kirsling@sony.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r259572 r259576  
     12020-04-06  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] Since ArrayBufferViewWatchpointAdaptor::add can fire watchpoints, DFG::Plan should check validity of CodeBlock after executing reallyAdd
     4        https://bugs.webkit.org/show_bug.cgi?id=210055
     5        <rdar://problem/61331962>
     6
     7        Reviewed by Keith Miller.
     8
     9        Since ArrayBufferViewWatchpointAdaptor::add can fire watchpoints, it is possible that the DFG CodeBlock is already invalidated after executing DFG::Plan::reallyAdd.
     10        We should check CodeBlock's validity again and terminate DFG::Plan::finalizeWithoutNotifyingCallback with CompilationInvalidated if CodeBlock got invalidated.
     11
     12        * dfg/DFGPlan.cpp:
     13        (JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
     14
    1152020-04-06  Yusuke Suzuki  <ysuzuki@apple.com>
    216
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r259424 r259576  
    628628        }
    629629
     630        // Since Plan::reallyAdd could fire watchpoints (see ArrayBufferViewWatchpointAdaptor::add), it is possible that the current CodeBlock is now invalidated.
     631        if (!m_codeBlock->jitCode()->dfgCommon()->isStillValid) {
     632            CODEBLOCK_LOG_EVENT(m_codeBlock, "dfgFinalize", ("invalidated"));
     633            return CompilationInvalidated;
     634        }
     635
    630636        if (validationEnabled()) {
    631637            TrackedReferences trackedReferences;
Note: See TracChangeset for help on using the changeset viewer.