Changeset 73570 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
Dec 8, 2010, 5:30:18 PM (14 years ago)
Author:
[email protected]
Message:

Migrated OS-specific allocation code from PageReservation and PageAllocation to OSAllocator
https://bugs.webkit.org/show_bug.cgi?id=50653

Reviewed by Sam Weinig.

  • interpreter/RegisterFile.h:

(JSC::RegisterFile::RegisterFile):
(JSC::RegisterFile::grow):

  • jit/ExecutableAllocatorFixedVMPool.cpp:

(JSC::FixedVMPoolAllocator::reuse):
(JSC::FixedVMPoolAllocator::FixedVMPoolAllocator): Removed checkAllocatedOkay.
OSAllocator is now the central location for verifying that allocation succeeds.
This allowed me to remove some complicating cross-platform cruft.

  • runtime/AlignedMemoryAllocator.h:

(JSC::::allocate): Updated for code motion.

  • wtf/OSAllocator.h: Added Usage, writable, and executable parameters, to

support VM features required by clients of PageAllocation and PageReservation.

  • wtf/OSAllocatorPosix.cpp:

(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit): Moved PageAllocation support for randomizing
executable memory here.

  • wtf/OSAllocatorSymbian.cpp:

(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit): Updated for new function signatures.

  • wtf/OSAllocatorWin.cpp:

(WTF::protection):
(WTF::OSAllocator::reserve):
(WTF::OSAllocator::reserveAndCommit):
(WTF::OSAllocator::commit):
(WTF::OSAllocator::release): Updated for new function signatures. Moved
some protection-related and WINCE-related code from PageAllocation here.

  • wtf/PageAllocation.cpp: Nixed cross-platform lastError abstraction, since

it was only used by checkAllocatedOkay, which is now gone.

  • wtf/PageAllocation.h:

(WTF::PageAllocation::allocate):
(WTF::PageAllocation::allocateAligned):
(WTF::PageAllocation::deallocate):
(WTF::PageAllocation::isPowerOfTwo):
(WTF::PageAllocation::systemAllocateAligned): Removed system* functions,
and replaced calls to them with calls to OSAllocator.

  • wtf/PageReservation.h:

(WTF::PageReservation::commit):
(WTF::PageReservation::decommit):
(WTF::PageReservation::reserve):
(WTF::PageReservation::deallocate):
(WTF::PageReservation::PageReservation): Ditto. Added m_writable and
m_executable because these flags are now required when committing memory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/AlignedMemoryAllocator.h

    r64695 r73570  
    7777inline AlignedMemory<blockSize> AlignedMemoryAllocator<blockSize>::allocate()
    7878{
    79     return AlignedMemory<blockSize>(PageAllocation::allocateAligned(blockSize, PageAllocation::JSGCHeapPages));
     79    return AlignedMemory<blockSize>(PageAllocation::allocateAligned(blockSize, OSAllocator::JSGCHeapPages));
    8080}
    8181
Note: See TracChangeset for help on using the changeset viewer.