class DemandExecutableAllocator : public MetaAllocator {
public:
DemandExecutableAllocator()
- : MetaAllocator(32) // round up all allocations to 32 bytes
+ : MetaAllocator(jitAllocationGranule)
{
MutexLocker lock(allocatorsMutex());
allocators().add(this);
#endif
PageReservation reservation = PageReservation::reserve(numPages * pageSize(), OSAllocator::JSJITCodePages, EXECUTABLE_POOL_WRITABLE, true);
- if (!reservation)
- CRASH();
+ RELEASE_ASSERT(reservation);
reservations.append(reservation);
}
#endif
-ExecutableAllocator::ExecutableAllocator(JSGlobalData&)
+ExecutableAllocator::ExecutableAllocator(VM&)
#if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
: m_allocator(adoptPtr(new DemandExecutableAllocator()))
#endif
}
-PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(JSGlobalData&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
+PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
{
RefPtr<ExecutableMemoryHandle> result = allocator()->allocate(sizeInBytes, ownerUID);
- if (!result && effort == JITCompilationMustSucceed)
- CRASH();
+ RELEASE_ASSERT(result || effort != JITCompilationMustSucceed);
return result.release();
}