Ignore:
Timestamp:
Mar 12, 2020, 11:33:40 AM (5 years ago)
Author:
[email protected]
Message:

[JSC] Use CacheableIdentifier in ByValInfo
https://bugs.webkit.org/show_bug.cgi?id=208978

Reviewed by Saam Barati.

CodeBlock::finalizeUnconditionally discards JITData. And this includes ByValInfo, which holds Identifier.
However, finalizeUnconditionally is only guaranteeing that the main thread is not working. It can be invoked
in the heap thread, and it is not not setting the AtomStringTable for this heap thread. If Identifier destroys
AtomStringImpl, which fails to unregister itself from the table.

In this patch,

  1. We explicitly set nullptr for the current AtomStringTable to catch the bug as soon as possible in GC end phase.
  2. We use CacheableIdentifier in ByValInfo to avoid destroying Identifier in CodeBlock::finalizeUnconditionally.
  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • bytecode/ByValInfo.cpp: Added.

(JSC::ByValInfo::visitAggregate):

  • bytecode/ByValInfo.h:
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::stronglyVisitStrongReferences):

  • bytecode/CodeBlock.h:
  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::handlePutByVal):

  • heap/Heap.cpp:

(JSC::Heap::runEndPhase):

  • jit/JIT.h:
  • jit/JITOperations.cpp:
  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitByValIdentifierCheck):

  • runtime/CacheableIdentifier.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r256015 r258344  
    3333#include "ArithProfile.h"
    3434#include "BasicBlockLocation.h"
     35#include "ByValInfo.h"
    3536#include "BytecodeDumper.h"
    3637#include "BytecodeGenerator.h"
     
    16891690    if (auto* jitData = m_jitData.get()) {
    16901691        for (ByValInfo* byValInfo : jitData->m_byValInfos)
    1691             visitor.append(byValInfo->cachedSymbol);
     1692            byValInfo->visitAggregate(visitor);
    16921693        for (StructureStubInfo* stubInfo : jitData->m_stubInfos)
    16931694            stubInfo->visitAggregate(visitor);
Note: See TracChangeset for help on using the changeset viewer.