Bug 43009 - Abstract out page allocation from executable allocators
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jul 2010 05:02:09 +0000 (05:02 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jul 2010 05:02:09 +0000 (05:02 +0000)
commit3326832930acaf7ceec411ec361d7230b02bbfa1
treeb1f66b1c42a167724f185be444da3539ff1c101d
parent43ce85dfdfcf204e8aa8fdf091693391e4c1cb1d
Bug 43009 - Abstract out page allocation from executable allocators

Reviewed by Oliver Hunt.

JavaScriptCore:

It would be great to have a single platform abstraction for block allocation, rather than copy/paste code.

In this initial implementation I've made Symbian fall back to use malloc/free for non-executable memory.
I think this will match current behaviour for the next client we will want to port across (RegisterFile &
Collector).

* CMakeListsEfl.txt:
* GNUmakefile.am:
* JavaScriptCore.gypi:
* JavaScriptCore.pro:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::intializePageSize):
(JSC::ExecutablePool::systemAlloc):
(JSC::ExecutablePool::systemRelease):
(JSC::ExecutableAllocator::isValid):
* jit/ExecutableAllocator.h:
(JSC::ExecutablePool::ExecutablePool):
(JSC::ExecutablePool::poolAllocate):
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::FixedVMPoolAllocator::release):
(JSC::FixedVMPoolAllocator::reuse):
(JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
(JSC::FixedVMPoolAllocator::alloc):
(JSC::FixedVMPoolAllocator::free):
(JSC::FixedVMPoolAllocator::isValid):
(JSC::FixedVMPoolAllocator::isWithinVMPool):
(JSC::ExecutablePool::systemAlloc):
(JSC::ExecutablePool::systemRelease):
* jit/ExecutableAllocatorPosix.cpp: Removed.
* jit/ExecutableAllocatorSymbian.cpp: Removed.
* jit/ExecutableAllocatorWin.cpp: Removed.
* wscript:
* wtf/PageAllocator.cpp: Added.
(WTF::protection):
(WTF::PageAllocation::commit):
(WTF::PageAllocation::decommit):
(WTF::PageAllocator::allocate):
(WTF::PageAllocator::reserve):
(WTF::PageAllocator::deallocate):
(WTF::PageAllocator::pagesize):
* wtf/PageAllocator.h: Added.
(WTF::PageAllocation::PageAllocation):
(WTF::PageAllocation::base):
(WTF::PageAllocation::size):
(WTF::PageAllocation::chunk):
(WTF::PageAllocation::operator!):
(WTF::PageAllocator::):

JavaScriptGlue:

* ForwardingHeaders/wtf/PageAllocation.h: Added.

WebCore:

* ForwardingHeaders/wtf/PageAllocation.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@64105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
JavaScriptCore/CMakeListsEfl.txt
JavaScriptCore/ChangeLog
JavaScriptCore/GNUmakefile.am
JavaScriptCore/JavaScriptCore.gypi
JavaScriptCore/JavaScriptCore.pro
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/jit/ExecutableAllocator.cpp
JavaScriptCore/jit/ExecutableAllocator.h
JavaScriptCore/jit/ExecutableAllocatorFixedVMPool.cpp
JavaScriptCore/jit/ExecutableAllocatorPosix.cpp [deleted file]
JavaScriptCore/jit/ExecutableAllocatorSymbian.cpp [deleted file]
JavaScriptCore/jit/ExecutableAllocatorWin.cpp [deleted file]
JavaScriptCore/wscript
JavaScriptCore/wtf/PageAllocation.cpp [new file with mode: 0644]
JavaScriptCore/wtf/PageAllocation.h [new file with mode: 0644]
JavaScriptGlue/ChangeLog
JavaScriptGlue/ForwardingHeaders/wtf/PageAllocation.h [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ForwardingHeaders/wtf/PageAllocation.h [new file with mode: 0644]