Commit 3f15c21c authored by hausmann@webkit.org's avatar hausmann@webkit.org

2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>

        Reviewed by Simon Hausmann.

        Implemented the block allocation on Symbian through heap allocation.

        Unfortunately there is no way to allocate virtual memory. The Posix
        layer provides mmap() but no anonymous mapping. So this is a very slow
        solution but it should work as a start.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 07a5d325
2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
Reviewed by Simon Hausmann.
Implemented the block allocation on Symbian through heap allocation.
Unfortunately there is no way to allocate virtual memory. The Posix
layer provides mmap() but no anonymous mapping. So this is a very slow
solution but it should work as a start.
* runtime/Collector.cpp:
(JSC::allocateBlock):
(JSC::freeBlock):
2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann. Reviewed by Simon Hausmann.
......
...@@ -189,6 +189,10 @@ static NEVER_INLINE CollectorBlock* allocateBlock() ...@@ -189,6 +189,10 @@ static NEVER_INLINE CollectorBlock* allocateBlock()
vm_address_t address = 0; vm_address_t address = 0;
// FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: <rdar://problem/6054788>. // FIXME: tag the region as a JavaScriptCore heap when we get a registered VM tag: <rdar://problem/6054788>.
vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT); vm_map(current_task(), &address, BLOCK_SIZE, BLOCK_OFFSET_MASK, VM_FLAGS_ANYWHERE, MEMORY_OBJECT_NULL, 0, FALSE, VM_PROT_DEFAULT, VM_PROT_DEFAULT, VM_INHERIT_DEFAULT);
#elif PLATFORM(SYMBIAN)
// no memory map in symbian, need to hack with fastMalloc
void* address = fastMalloc(BLOCK_SIZE);
memset(reinterpret_cast<void*>(address), 0, BLOCK_SIZE);
#elif PLATFORM(WIN_OS) #elif PLATFORM(WIN_OS)
// windows virtual address granularity is naturally 64k // windows virtual address granularity is naturally 64k
LPVOID address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); LPVOID address = VirtualAlloc(NULL, BLOCK_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
...@@ -231,6 +235,8 @@ static void freeBlock(CollectorBlock* block) ...@@ -231,6 +235,8 @@ static void freeBlock(CollectorBlock* block)
{ {
#if PLATFORM(DARWIN) #if PLATFORM(DARWIN)
vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE); vm_deallocate(current_task(), reinterpret_cast<vm_address_t>(block), BLOCK_SIZE);
#elif PLATFORM(SYMBIAN)
fastFree(block);
#elif PLATFORM(WIN_OS) #elif PLATFORM(WIN_OS)
VirtualFree(block, 0, MEM_RELEASE); VirtualFree(block, 0, MEM_RELEASE);
#elif HAVE(POSIX_MEMALIGN) #elif HAVE(POSIX_MEMALIGN)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment