Exemplo n.º 1
0
void CallLinkInfo::unlink(VM& vm)
{
    if (!isLinked()) {
        // We could be called even if we're not linked anymore because of how polymorphic calls
        // work. Each callsite within the polymorphic call stub may separately ask us to unlink().
        RELEASE_ASSERT(!isOnList());
        return;
    }
    
    unlinkFor(vm, *this);

    // It will be on a list if the callee has a code block.
    if (isOnList())
        remove();
}
Exemplo n.º 2
0
CallLinkInfo::~CallLinkInfo()
{
    clearStub();
    
    if (isOnList())
        remove();
}
Exemplo n.º 3
0
void CallLinkInfo::unlink(RepatchBuffer& repatchBuffer)
{
    if (!isLinked()) {
        // We could be called even if we're not linked anymore because of how polymorphic calls
        // work. Each callsite within the polymorphic call stub may separately ask us to unlink().
        RELEASE_ASSERT(!isOnList());
        return;
    }
    
    unlinkFor(
        repatchBuffer, *this,
        (m_callType == Construct || m_callType == ConstructVarargs)? CodeForConstruct : CodeForCall,
        m_isFTL ? MustPreserveRegisters : RegisterPreservationNotRequired);

    // It will be on a list if the callee has a code block.
    if (isOnList())
        remove();
}
Exemplo n.º 4
0
void JumpReplacementWatchpoint::fireInternal()
{
    void* source = bitwise_cast<void*>(m_source);
    void* destination = bitwise_cast<void*>(m_destination);
    if (Options::showDisassembly())
        dataLog("Firing jump replacement watchpoint from %p, to %p.\n", source, destination);
    MacroAssembler::replaceWithJump(CodeLocationLabel(source), CodeLocationLabel(destination));
    if (isOnList())
        remove();
}
void CodeBlockJettisoningWatchpoint::fireInternal()
{
    if (DFG::shouldShowDisassembly())
        dataLog("Firing watchpoint ", RawPointer(this), " on ", *m_codeBlock, "\n");

    m_codeBlock->jettison(CountReoptimization);

    if (isOnList())
        remove();
}
Exemplo n.º 6
0
Watchpoint::~Watchpoint()
{
    if (isOnList()) {
        // This will happen if we get destroyed before the set fires. That's totally a valid
        // possibility. For example:
        //
        // CodeBlock has a Watchpoint on transition from structure S1. The transition never
        // happens, but the CodeBlock gets destroyed because of GC.
        remove();
    }
}
Exemplo n.º 7
0
WeakBlock::FreeCell* WeakSet::addAllocator()
{
    if (!isOnList())
        heap()->objectSpace().addActiveWeakSet(this);
    
    WeakBlock* block = WeakBlock::create(*heap(), m_container);
    heap()->didAllocate(WeakBlock::blockSize);
    m_blocks.append(block);
    WeakBlock::SweepResult sweepResult = block->takeSweepResult();
    ASSERT(!sweepResult.isNull() && sweepResult.freeList);
    return sweepResult.freeList;
}
Exemplo n.º 8
0
WeakSet::~WeakSet()
{
    if (isOnList())
        remove();
    
    Heap& heap = *this->heap();
    WeakBlock* next = 0;
    for (WeakBlock* block = m_blocks.head(); block; block = next) {
        next = block->next();
        WeakBlock::destroy(heap, block);
    }
    m_blocks.clear();
}
Exemplo n.º 9
0
void WeakSet::shrink()
{
    WeakBlock* next;
    for (WeakBlock* block = m_blocks.head(); block; block = next) {
        next = block->next();

        if (block->isEmpty())
            removeAllocator(block);
    }

    resetAllocator();
    
    if (m_blocks.isEmpty() && isOnList())
        remove();
}
void ProfiledCodeBlockJettisoningWatchpoint::fireInternal()
{
    if (DFG::shouldShowDisassembly()) {
        dataLog(
            "Firing profiled watchpoint ", RawPointer(this), " on ", *m_codeBlock, " due to ",
            m_exitKind, " at ", m_codeOrigin, "\n");
    }
    
    baselineCodeBlockForOriginAndBaselineCodeBlock(
        m_codeOrigin, m_codeBlock->baselineVersion())->addFrequentExitSite(
            DFG::FrequentExitSite(m_codeOrigin.bytecodeIndex, m_exitKind));
    
#if ENABLE(JIT)
    m_codeBlock->jettison(CountReoptimization);
#endif

    if (isOnList())
        remove();
}
Exemplo n.º 11
0
void CallLinkInfo::unlink(RepatchBuffer& repatchBuffer)
{
    ASSERT(isLinked());
    
    if (Options::showDisassembly())
        dataLog("Unlinking call from ", callReturnLocation, " to ", pointerDump(repatchBuffer.codeBlock()), "\n");

    repatchBuffer.revertJumpReplacementToBranchPtrWithPatch(RepatchBuffer::startOfBranchPtrWithPatchOnRegister(hotPathBegin), static_cast<MacroAssembler::RegisterID>(calleeGPR), 0);
    repatchBuffer.relink(
        callReturnLocation,
        repatchBuffer.codeBlock()->vm()->getCTIStub(linkThunkGeneratorFor(
            (callType == Construct || callType == ConstructVarargs)? CodeForConstruct : CodeForCall,
            isFTL ? MustPreserveRegisters : RegisterPreservationNotRequired)).code());
    hasSeenShouldRepatch = false;
    callee.clear();
    stub.clear();

    // It will be on a list if the callee has a code block.
    if (isOnList())
        remove();
}
Exemplo n.º 12
0
LargeAllocation::~LargeAllocation()
{
    if (isOnList())
        remove();
}
Exemplo n.º 13
0
void Watchpoint::fire(const FireDetail& detail)
{
    RELEASE_ASSERT(!isOnList());
    fireInternal(detail);
}
Watchpoint::~Watchpoint()
{
    if (isOnList())
        remove();
}