Changeset 39083 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
Dec 7, 2008, 3:55:04 PM (16 years ago)
Author:
[email protected]
Message:

<rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
<https://bugs.webkit.org/show_bug.cgi?id=21783>

Reviewed by Cameron Zwarich and Sam Weinig

Add a new allocator for use by the JIT that provides executable pages, so
we can get rid of the current hack that makes the entire heap executable.

1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!

Location:
trunk/JavaScriptCore/assembler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/AssemblerBuffer.h

    r38975 r39083  
    3232
    3333#include <string.h>
     34#include <jit/ExecutableAllocator.h>
    3435#include <wtf/Assertions.h>
    3536#include <wtf/FastMalloc.h>
     
    110111        }
    111112
    112         int size()
     113        int size() const
    113114        {
    114115            return m_size;
    115116        }
    116117
    117         void* executableCopy()
     118        void* executableCopy(ExecutablePool* allocator)
    118119        {
    119120            if (!m_size)
    120121                return 0;
    121122
    122             void* result = WTF::fastMallocExecutable(m_size);
     123            void* result = allocator->alloc(m_size);
    123124
    124125            if (!result)
  • trunk/JavaScriptCore/assembler/MacroAssembler.h

    r39061 r39083  
    5454    }
    5555   
    56     void* copyCode()
    57     {
    58         return m_assembler.executableCopy();
     56    size_t size() { return m_assembler.size(); }
     57    void* copyCode(ExecutablePool* allocator)
     58    {
     59        return m_assembler.executableCopy(allocator);
    5960    }
    6061
  • trunk/JavaScriptCore/assembler/X86Assembler.h

    r39020 r39083  
    211211    }
    212212
     213    size_t size() const { return m_buffer.size(); }
     214   
    213215    void int3()
    214216    {
     
    11141116    }
    11151117   
    1116     void* executableCopy()
    1117     {
    1118         void* copy = m_buffer.executableCopy();
     1118    void* executableCopy(ExecutablePool* allocator)
     1119    {
     1120        void* copy = m_buffer.executableCopy(allocator);
    11191121        ASSERT(copy);
    11201122        return copy;
Note: See TracChangeset for help on using the changeset viewer.