Changeset 207476 in webkit


Ignore:
Timestamp:
Oct 18, 2016 12:03:29 PM (8 years ago)
Author:
keith_miller@apple.com
Message:

Cleanup Wasm memory.
https://bugs.webkit.org/show_bug.cgi?id=163601

Reviewed by Saam Barati.

There were a couple of issues with the original Wasm memory patch.
This is a follow-up patch to fix those issues.

  • wasm/WASMMemory.cpp:

(JSC::WASM::Memory::Memory):

  • wasm/WASMMemory.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207475 r207476  
     12016-10-18  Keith Miller  <keith_miller@apple.com>
     2
     3        Cleanup Wasm memory.
     4        https://bugs.webkit.org/show_bug.cgi?id=163601
     5
     6        Reviewed by Saam Barati.
     7
     8        There were a couple of issues with the original Wasm memory patch.
     9        This is a follow-up patch to fix those issues.
     10
     11        * wasm/WASMMemory.cpp:
     12        (JSC::WASM::Memory::Memory):
     13        * wasm/WASMMemory.h:
     14
    1152016-10-15  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/wasm/WASMMemory.cpp

    r207453 r207476  
    4141    ASSERT(pinnedSizeRegisters.size() > 0);
    4242
    43     void* result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, 0, 0);
     43    // FIXME: It would be nice if we had a VM tag for wasm memory. https://bugs.webkit.org/show_bug.cgi?id=163600
     44    void* result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
    4445    if (result == MAP_FAILED) {
    4546        // Try again with a different number.
    4647        m_mappedCapacity = m_capacity;
    47         result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, 0, 0);
     48        result = mmap(nullptr, m_mappedCapacity, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
    4849        if (result == MAP_FAILED)
    4950            return;
    5051    }
    5152
     53    ASSERT(startingSize <= m_mappedCapacity);
    5254    if (mprotect(result, startingSize, PROT_READ | PROT_WRITE)) {
    5355        munmap(result, m_mappedCapacity);
  • trunk/Source/JavaScriptCore/wasm/WASMMemory.h

    r207453 r207476  
    4040
    4141// FIXME: We should support more than one memory size register. Right now we take a vector with only one
    42 // entry. Specifically an extry where the sizeOffset == 0. If we have more than one size register,
     42// entry. Specifically an entry where the sizeOffset == 0. If we have more than one size register,
    4343// we can have one for each load size class. see: https://bugs.webkit.org/show_bug.cgi?id=162952
    4444struct PinnedRegisterInfo {
Note: See TracChangeset for help on using the changeset viewer.