void JSStack::releaseExcessCapacity()
{
    ptrdiff_t delta = reinterpret_cast<uintptr_t>(highAddress()) - reinterpret_cast<uintptr_t>(m_commitEnd);
    m_reservation.decommit(m_commitEnd, delta);
    addToCommittedByteCount(-delta);
    m_commitEnd = highAddress();
}
Example #2
0
JSStack::~JSStack()
{
    ptrdiff_t sizeToDecommit = reinterpret_cast<char*>(highAddress()) - reinterpret_cast<char*>(m_commitTop);
    m_reservation.decommit(reinterpret_cast<void*>(m_commitTop), sizeToDecommit);
    addToCommittedByteCount(-sizeToDecommit);
    m_reservation.deallocate();
}
Example #3
0
void JSStack::releaseExcessCapacity()
{
    Register* highAddressWithReservedZone = highAddress() - m_reservedZoneSizeInRegisters;
    ptrdiff_t delta = reinterpret_cast<char*>(highAddressWithReservedZone) - reinterpret_cast<char*>(m_commitTop);
    m_reservation.decommit(m_commitTop, delta);
    addToCommittedByteCount(-delta);
    m_commitTop = highAddressWithReservedZone;
}
JSStack::JSStack(VM& vm, size_t capacity)
    : m_vm(vm)
    , m_end(0)
    , m_topCallFrame(vm.topCallFrame)
{
    ASSERT(capacity && isPageAligned(capacity));

    m_reservation = PageReservation::reserve(roundUpAllocationSize(capacity * sizeof(Register), commitSize), OSAllocator::JSVMStackPages);
    updateStackLimit(highAddress());
    m_commitEnd = highAddress();
    
    m_lastStackTop = getBaseOfStack();

    disableErrorStackReserve();

    m_topCallFrame = 0;
}
Example #5
0
JSStack::JSStack(VM& vm)
    : m_vm(vm)
    , m_topCallFrame(vm.topCallFrame)
#if ENABLE(LLINT_C_LOOP)
    , m_end(0)
    , m_reservedZoneSizeInRegisters(0)
#endif
{
#if ENABLE(LLINT_C_LOOP)
    size_t capacity = Options::maxPerThreadStackUsage();
    ASSERT(capacity && isPageAligned(capacity));

    m_reservation = PageReservation::reserve(WTF::roundUpToMultipleOf(commitSize, capacity), OSAllocator::JSVMStackPages);
    setStackLimit(highAddress());
    m_commitTop = highAddress();
    
    m_lastStackTop = baseOfStack();
#endif // ENABLE(LLINT_C_LOOP)

    m_topCallFrame = 0;
}
Example #6
0
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks)
{
    conservativeRoots.add(topOfStack() + 1, highAddress(), jitStubRoutines, codeBlocks);
}
Example #7
0
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots)
{
    conservativeRoots.add(topOfStack() + 1, highAddress());
}