*/
template <int maxPoolSize, int barrierSize, int maxInstructionSize, class AssemblerType>
-class AssemblerBufferWithConstantPool: public AssemblerBuffer {
+class AssemblerBufferWithConstantPool : public AssemblerBuffer {
typedef SegmentedVector<uint32_t, 512> LoadOffsets;
using AssemblerBuffer::putIntegral;
using AssemblerBuffer::putIntegralUnchecked;
AssemblerBuffer::ensureSpace(insnSpace);
}
- void ensureSpaceForAnyOneInstruction()
+ void ensureSpaceForAnyInstruction(int amount = 1)
{
- flushIfNoSpaceFor(maxInstructionSize, sizeof(uint64_t));
+ flushIfNoSpaceFor(amount * maxInstructionSize, amount * sizeof(uint64_t));
}
bool isAligned(int alignment)
putIntegralUnchecked(value.low);
}
- void* executableCopy(JSGlobalData& globalData, ExecutablePool* allocator)
+ PassRefPtr<ExecutableMemoryHandle> executableCopy(VM& vm, void* ownerUID, JITCompilationEffort effort)
{
flushConstantPool(false);
- return AssemblerBuffer::executableCopy(globalData, allocator);
+ return AssemblerBuffer::executableCopy(vm, ownerUID, effort);
}
void putShortWithConstantInt(uint16_t insn, uint32_t constant, bool isReusable = false)
void flushWithoutBarrier(bool isForced = false)
{
// Flush if constant pool is more than 60% full to avoid overuse of this function.
- if (isForced || 5 * m_numConsts > 3 * maxPoolSize / sizeof(uint32_t))
+ if (isForced || 5 * static_cast<uint32_t>(m_numConsts) > 3 * maxPoolSize / sizeof(uint32_t))
flushConstantPool(false);
}