Ignore:
Timestamp:
Apr 20, 2009, 11:12:39 AM (16 years ago)
Author:
[email protected]
Message:

2009-04-20 Sam Weinig <[email protected]>

Reviewed by Kevin McCullough.

Always tag mmaped memory on darwin and clean up #defines
now that they are a little bigger.

  • interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
  • jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  • jit/ExecutableAllocatorPosix.cpp: (JSC::ExecutablePool::systemAlloc):
  • runtime/Collector.cpp: (JSC::allocateBlock):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/ExecutableAllocatorPosix.cpp

    r42649 r42676  
    3737#endif
    3838
     39#if PLATFORM(DARWIN)
     40// On Mac OS X, the VM subsystem allows tagging memory requested from mmap and vm_map
     41// in order to aid tools that inspect system memory use.
     42#if defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
     43#define TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
     44#else
     45#define TAG_FOR_EXECUTABLEALLOCATOR_MEMORY VM_MAKE_TAG(64)
     46#endif
     47#else
     48#define TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1
     49#endif
     50
    3951namespace JSC {
    4052
     
    4658ExecutablePool::Allocation ExecutablePool::systemAlloc(size_t n)
    4759{
    48     #if PLATFORM(DARWIN) && defined(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
    49         #define OPTIONAL_TAG VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR)
    50     #else
    51         #define OPTIONAL_TAG -1
    52     #endif
    53 
    54     ExecutablePool::Allocation alloc = { reinterpret_cast<char*>(mmap(NULL, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, OPTIONAL_TAG, 0)), n };
     60    ExecutablePool::Allocation alloc = { reinterpret_cast<char*>(mmap(NULL, n, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0)), n };
    5561    return alloc;
    5662}
     
    6470}
    6571
     72#undef TAG_FOR_EXECUTABLEALLOCATOR_MEMORY
     73
    6674#endif // HAVE(ASSEMBLER)
Note: See TracChangeset for help on using the changeset viewer.