Bug 728623: disable jitcode address randomization on Win64, r=dvander

This commit is contained in:
David Mandelin 2012-03-14 17:36:34 -07:00
Родитель 37fcdc194c
Коммит d67fb2efbc
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -103,11 +103,15 @@ RandomizeIsBroken()
ExecutablePool::Allocation ExecutableAllocator::systemAlloc(size_t n)
{
void *allocation = NULL;
// Randomization disabled to avoid a performance fault on x64 builds.
// See bug 728623.
#ifndef JS_CPU_X64
if (allocBehavior == AllocationCanRandomize && !RandomizeIsBroken()) {
void *randomAddress = computeRandomAllocationAddress();
allocation = VirtualAlloc(randomAddress, n, MEM_COMMIT | MEM_RESERVE,
PAGE_EXECUTE_READWRITE);
}
#endif
if (!allocation)
allocation = VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
ExecutablePool::Allocation alloc = { reinterpret_cast<char*>(allocation), n };