Skip to content
Permalink
Browse files
Run cacheFlush page by page to assure of flushing all the requested r…
…anges

https://bugs.webkit.org/show_bug.cgi?id=77712

Patch by Hojong Han <hojong.han@samsung.com> on 2012-03-14
Reviewed by Geoffrey Garen.

Current MetaAllocator concept, always coalesces adjacent free spaces,
doesn't meet memory management of Linux kernel.
In a certain case Linux kernel doesn't regard contiguous virtual memory areas as one but two.
Therefore cacheFlush page by page guarantees a flush-requested range.

* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::cacheFlush):

Canonical link: https://commits.webkit.org/98355@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Hojong Han authored and webkit-commit-queue committed Mar 15, 2012
1 parent cae6fe8 commit 975f6243cf61defc4b8c0edc10b5ae00aa2d6606
Showing 2 changed files with 34 additions and 12 deletions.
@@ -1,3 +1,18 @@
2012-03-14 Hojong Han <hojong.han@samsung.com>

Run cacheFlush page by page to assure of flushing all the requested ranges
https://bugs.webkit.org/show_bug.cgi?id=77712

Reviewed by Geoffrey Garen.

Current MetaAllocator concept, always coalesces adjacent free spaces,
doesn't meet memory management of Linux kernel.
In a certain case Linux kernel doesn't regard contiguous virtual memory areas as one but two.
Therefore cacheFlush page by page guarantees a flush-requested range.

* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::cacheFlush):

2012-03-14 Oliver Hunt <oliver@apple.com>

Make ARMv7 work again
@@ -194,18 +194,25 @@ class ExecutableAllocator {
#elif CPU(ARM_TRADITIONAL) && OS(LINUX) && COMPILER(GCC)
static void cacheFlush(void* code, size_t size)
{
asm volatile (
"push {r7}\n"
"mov r0, %0\n"
"mov r1, %1\n"
"mov r7, #0xf0000\n"
"add r7, r7, #0x2\n"
"mov r2, #0x0\n"
"svc 0x0\n"
"pop {r7}\n"
:
: "r" (code), "r" (reinterpret_cast<char*>(code) + size)
: "r0", "r1", "r2");
uintptr_t currentPage = reinterpret_cast<uintptr_t>(code) & ~(pageSize() - 1);
uintptr_t lastPage = (reinterpret_cast<uintptr_t>(code) + size) & ~(pageSize() - 1);

do {
asm volatile (
"push {r7}\n"
"mov r0, %0\n"
"mov r1, %1\n"
"mov r7, #0xf0000\n"
"add r7, r7, #0x2\n"
"mov r2, #0x0\n"
"svc 0x0\n"
"pop {r7}\n"
:
: "r" (currentPage), "r" (currentPage + pageSize())
: "r0", "r1", "r2");
currentPage += pageSize();
} while (lastPage >= currentPage);
}
}
#elif OS(WINCE)
static void cacheFlush(void* code, size_t size)

0 comments on commit 975f624

Please sign in to comment.