void MarkStack::append(ConservativeRoots& conservativeRoots) { JSCell** roots = conservativeRoots.roots(); size_t size = conservativeRoots.size(); for (size_t i = 0; i < size; ++i) internalAppend(roots[i]); }
void SlotVisitor::append(ConservativeRoots& conservativeRoots) { HeapCell** roots = conservativeRoots.roots(); size_t size = conservativeRoots.size(); for (size_t i = 0; i < size; ++i) appendJSCellOrAuxiliary(roots[i]); }
void SlotVisitor::append(ConservativeRoots& conservativeRoots) { StackStats::probe(); JSCell** roots = conservativeRoots.roots(); size_t size = conservativeRoots.size(); for (size_t i = 0; i < size; ++i) internalAppend(roots[i]); }
void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackOrigin, void* stackTop, RegisterState& calleeSavedRegisters) { void* registersBegin = &calleeSavedRegisters; void* registersEnd = reinterpret_cast<void*>(roundUpToMultipleOf<sizeof(void*)>(reinterpret_cast<uintptr_t>(&calleeSavedRegisters + 1))); conservativeRoots.add(registersBegin, registersEnd, jitStubRoutines, codeBlocks); conservativeRoots.add(stackTop, stackOrigin, jitStubRoutines, codeBlocks); }
void MachineThreads::gatherFromOtherThread(ConservativeRoots& conservativeRoots, Thread* thread) { PlatformThreadRegisters regs; size_t regSize = getPlatformThreadRegisters(thread->platformThread, regs); conservativeRoots.add(static_cast<void*>(®s), static_cast<void*>(reinterpret_cast<char*>(®s) + regSize)); void* stackPointer = otherThreadStackPointer(regs); void* stackBase = thread->stackBase; swapIfBackwards(stackPointer, stackBase); conservativeRoots.add(stackPointer, stackBase); freePlatformThreadRegisters(regs); }
void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { for (Register* it = start(); it != end(); ++it) { JSValue v = it->jsValue(); if (!v.isCell()) continue; conservativeRoots.add(v.asCell()); } }
void VM::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { for (size_t i = 0; i < scratchBuffers.size(); i++) { ScratchBuffer* scratchBuffer = scratchBuffers[i]; if (scratchBuffer->activeLength()) { void* bufferStart = scratchBuffer->dataBuffer(); conservativeRoots.add(bufferStart, static_cast<void*>(static_cast<char*>(bufferStart) + scratchBuffer->activeLength())); } } }
void MachineThreads::gatherFromCurrentThread(ConservativeRoots& conservativeRoots, void* stackCurrent) { // setjmp forces volatile registers onto the stack jmp_buf registers REGISTER_BUFFER_ALIGNMENT; #if COMPILER(MSVC) #pragma warning(push) #pragma warning(disable: 4611) #endif setjmp(registers); #if COMPILER(MSVC) #pragma warning(pop) #endif void* registersBegin = ®isters; void* registersEnd = reinterpret_cast<void*>(roundUpToMultipleOf<sizeof(void*)>(reinterpret_cast<uintptr_t>(®isters + 1))); swapIfBackwards(registersBegin, registersEnd); conservativeRoots.add(registersBegin, registersEnd); void* stackBegin = stackCurrent; void* stackEnd = wtfThreadData().stack().origin(); swapIfBackwards(stackBegin, stackEnd); conservativeRoots.add(stackBegin, stackEnd); }
void MachineThreads::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks, void* stackOrigin, void* stackTop, RegisterState& calleeSavedRegisters) { gatherFromCurrentThread(conservativeRoots, jitStubRoutines, codeBlocks, stackOrigin, stackTop, calleeSavedRegisters); size_t size; size_t capacity = 0; void* buffer = nullptr; MutexLocker lock(m_registeredThreadsMutex); while (!tryCopyOtherThreadStacks(lock, buffer, capacity, &size)) growBuffer(size, &buffer, &capacity); if (!buffer) return; conservativeRoots.add(buffer, static_cast<char*>(buffer) + size, jitStubRoutines, codeBlocks); fastFree(buffer); }
void RegisterFile::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { conservativeRoots.add(start(), end()); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) { conservativeRoots.add(topOfStack() + 1, highAddress(), jitStubRoutines, codeBlocks); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { conservativeRoots.add(topOfStack() + 1, highAddress()); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { conservativeRoots.add(getBaseOfStack(), getTopOfStack()); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, CodeBlockSet& codeBlocks) { conservativeRoots.add(getBaseOfStack(), getTopOfStack(), jitStubRoutines, codeBlocks); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots, JITStubRoutineSet& jitStubRoutines, DFGCodeBlocks& dfgCodeBlocks) { conservativeRoots.add(begin(), end(), jitStubRoutines, dfgCodeBlocks); }
void JSStack::gatherConservativeRoots(ConservativeRoots& conservativeRoots) { conservativeRoots.add(begin(), end()); }