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!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/FastMalloc.cpp

    r38866 r39083  
    240240}
    241241
    242 #if HAVE(VIRTUALALLOC)
    243 void* fastMallocExecutable(size_t n)
    244 {
    245     return VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    246 }
    247 
    248 void fastFreeExecutable(void* p)
    249 {
    250     VirtualFree(p, 0, MEM_RELEASE);
    251 }
    252 #else
    253 void* fastMallocExecutable(size_t n)
    254 {
    255     return fastMalloc(n);
    256 }
    257 
    258 void fastFreeExecutable(void* p)
    259 {
    260     fastFree(p);
    261 }
    262 #endif
    263 
    264242} // namespace WTF
    265243
     
    34053383    return old_ptr;
    34063384  }
    3407 }
    3408 
    3409 void* fastMallocExecutable(size_t n)
    3410 {
    3411     return malloc<false>(n);
    3412 }
    3413 
    3414 void fastFreeExecutable(void* p)
    3415 {
    3416     free(p);
    34173385}
    34183386
Note: See TracChangeset for help on using the changeset viewer.