Changeset 254491 in webkit


Ignore:
Timestamp:
Jan 13, 2020 9:24:58 PM (4 years ago)
Author:
keith_miller@apple.com
Message:

scanSideState scans too much side state
https://bugs.webkit.org/show_bug.cgi?id=206166

Reviewed by Tadeu Zagallo.

JSTests:

  • stress/checkpoint-side-state-gc-tmps-overflow.js: Added.

(v8):

Source/JavaScriptCore:

The old code would would scan tmps + sizeof(tmps) but sizeof(tmps)
is not the length of the array. instead we should scan tmps +
maxNumCheckpointTmps.

  • interpreter/CheckpointOSRExitSideState.h:
  • runtime/VM.cpp:

(JSC::VM::scanSideState const):

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r254480 r254491  
     12020-01-13  Keith Miller  <keith_miller@apple.com>
     2
     3        scanSideState scans too much side state
     4        https://bugs.webkit.org/show_bug.cgi?id=206166
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        * stress/checkpoint-side-state-gc-tmps-overflow.js: Added.
     9        (v8):
     10
    1112020-01-13  Saam Barati  <sbarati@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r254480 r254491  
     12020-01-13  Keith Miller  <keith_miller@apple.com>
     2
     3        scanSideState scans too much side state
     4        https://bugs.webkit.org/show_bug.cgi?id=206166
     5
     6        Reviewed by Tadeu Zagallo.
     7
     8        The old code would would scan tmps + sizeof(tmps) but sizeof(tmps)
     9        is not the length of the array. instead we should scan tmps +
     10        maxNumCheckpointTmps.
     11
     12        * interpreter/CheckpointOSRExitSideState.h:
     13        * runtime/VM.cpp:
     14        (JSC::VM::scanSideState const):
     15
    1162020-01-13  Saam Barati  <sbarati@apple.com>
    217
  • trunk/Source/JavaScriptCore/interpreter/CheckpointOSRExitSideState.h

    r254166 r254491  
    3636
    3737    BytecodeIndex bytecodeIndex;
    38     JSValue tmps[maxNumCheckpointTmps];
     38    JSValue tmps[maxNumCheckpointTmps] { };
    3939};
    4040
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r254464 r254491  
    10671067void VM::scanSideState(ConservativeRoots& roots) const
    10681068{
    1069     for (const auto& iter : m_checkpointSideState)
    1070         roots.add(iter.value->tmps, iter.value->tmps + sizeof(iter.value->tmps));
     1069    ASSERT(heap.mutatorState() != MutatorState::Running);
     1070    for (const auto& iter : m_checkpointSideState) {
     1071        static_assert(sizeof(iter.value->tmps) / sizeof(JSValue) == maxNumCheckpointTmps);
     1072        roots.add(iter.value->tmps, iter.value->tmps + maxNumCheckpointTmps);
     1073    }
    10711074}
    10721075#endif
Note: See TracChangeset for help on using the changeset viewer.