mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Bug 1271968 - IonMonkey: MIPS: Make jit code in same 256 MB-aligned region
Tag: #1542
This commit is contained in:
parent
90144c967f
commit
1d29d6882c
1 changed files with 16 additions and 0 deletions
|
|
@ -589,7 +589,23 @@ static ProcessExecutableMemory execMemory;
|
|||
void*
|
||||
js::jit::AllocateExecutableMemory(size_t bytes, ProtectionSetting protection)
|
||||
{
|
||||
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
|
||||
// On MIPS, j/jal instructions to branch within the current
|
||||
// 256 MB-aligned region.
|
||||
void* allocation = nullptr;
|
||||
js::Vector<void*, 8, SystemAllocPolicy> unused_maps;
|
||||
for (;;) {
|
||||
allocation = execMemory.allocate(bytes, protection);
|
||||
if ((uintptr_t(allocation) >> 28) == (uintptr_t(allocation + bytes) >> 28))
|
||||
break;
|
||||
unused_maps.append(allocation);
|
||||
}
|
||||
for (size_t i = 0; i < unused_maps.length(); i++)
|
||||
DeallocateExecutableMemory(unused_maps[i], bytes);
|
||||
return allocation;
|
||||
#else
|
||||
return execMemory.allocate(bytes, protection);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue