size_t JSStack::committedByteCount() { #if ENABLE(LLINT_C_LOOP) MutexLocker locker(stackStatisticsMutex()); return committedBytesCount; #else // When using the C stack, we don't know how many stack pages are actually // committed. So, we use the current stack usage as an estimate. ASSERT(wtfThreadData().stack().isGrowingDownward()); int8_t* current = reinterpret_cast<int8_t*>(¤t); int8_t* high = reinterpret_cast<int8_t*>(wtfThreadData().stack().origin()); return high - current; #endif }
void JSStack::initializeThreading() { stackStatisticsMutex(); }
void JSStack::addToCommittedByteCount(long byteCount) { MutexLocker locker(stackStatisticsMutex()); ASSERT(static_cast<long>(committedBytesCount) + byteCount > -1); committedBytesCount += byteCount; }
size_t JSStack::committedByteCount() { MutexLocker locker(stackStatisticsMutex()); return committedBytesCount; }