From 1a344afbd9ee7ae737cd5ada4ab0a19910516a1e Mon Sep 17 00:00:00 2001 From: Mikhail Skvortcov Date: Tue, 13 Dec 2016 11:30:37 +0300 Subject: [PATCH] Use proper heap for stubs --- src/vm/interpreter.cpp | 2 +- src/vm/stublink.cpp | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/vm/interpreter.cpp b/src/vm/interpreter.cpp index d4f289281838..dad1a62685ff 100644 --- a/src/vm/interpreter.cpp +++ b/src/vm/interpreter.cpp @@ -1579,7 +1579,7 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp, #else #error unsupported platform #endif - stub = sl.Link(); + stub = sl.Link(SystemDomain::GetGlobalLoaderAllocator()->GetStubHeap()); *nativeSizeOfCode = static_cast(stub->GetNumCodeBytes()); // TODO: manage reference count of interpreter stubs. Look for examples... diff --git a/src/vm/stublink.cpp b/src/vm/stublink.cpp index 43ec8cde19ef..d1833260c5f7 100644 --- a/src/vm/stublink.cpp +++ b/src/vm/stublink.cpp @@ -2139,10 +2139,6 @@ Stub* Stub::NewStub(PTR_VOID pCode, DWORD flags) return pStub; } -#if defined(PLATFORM_UNIX) && defined(_ARM_) -extern "C" int mprotect(void *addr, size_t len, int prot); -#endif - //------------------------------------------------------------------- // Stub allocation done here. //------------------------------------------------------------------- @@ -2205,14 +2201,6 @@ extern "C" int mprotect(void *addr, size_t len, int prot); pBlock = new (executable) BYTE[totalSize]; #else pBlock = new BYTE[totalSize]; -#if defined(PLATFORM_UNIX) && defined(_ARM_) - _ASSERTE(totalSize <= 0x1000); - unsigned addr = (unsigned)pBlock; - unsigned size = 0x1000; - if ((addr & 0xfff) + totalSize > 0x1000) - size += 0x1000; - mprotect((void*)(addr & 0xfffff000), size, 7); -#endif #endif } else