Ignore:
Timestamp:
May 27, 2011, 11:30:08 AM (14 years ago)
Author:
[email protected]
Message:

2011-05-27 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Try to release unused executable memory when the FixedVMPool allocator is under pressure
https://bugs.webkit.org/show_bug.cgi?id=61651

Rather than crashing when full the FixedVMPool allocator now returns a null
allocation. We replace the code that used to CRASH() on null allocations
with logic that asks the provided globalData to release any executable memory
that it can. Currently this just means throwing away all regexp code, but
in future we'll try to be more aggressive.

  • assembler/ARMAssembler.cpp: (JSC::ARMAssembler::executableCopy):
  • assembler/ARMAssembler.h:
  • assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::executableCopy):
  • assembler/AssemblerBufferWithConstantPool.h:
  • assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::linkCode):
  • assembler/MIPSAssembler.h: (JSC::MIPSAssembler::executableCopy):
  • assembler/SH4Assembler.h: (JSC::SH4Assembler::executableCopy):
  • assembler/X86Assembler.h: (JSC::X86Assembler::executableCopy): (JSC::X86Assembler::X86InstructionFormatter::executableCopy):
  • dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::compileFunction):
  • jit/ExecutableAllocator.h: (JSC::ExecutablePool::create): (JSC::ExecutablePool::alloc): (JSC::ExecutableAllocator::ExecutableAllocator): (JSC::ExecutableAllocator::poolForSize): (JSC::ExecutablePool::ExecutablePool): (JSC::ExecutablePool::poolAllocate):
  • jit/ExecutableAllocatorFixedVMPool.cpp: (JSC::FixedVMPoolAllocator::alloc):
  • jit/JIT.cpp: (JSC::JIT::privateCompile):
  • jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines): (JSC::JIT::privateCompileCTINativeCall):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdSelfList): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • jit/SpecializedThunkJIT.h: (JSC::SpecializedThunkJIT::finalize):
  • jit/ThunkGenerators.cpp: (JSC::charCodeAtThunkGenerator): (JSC::charAtThunkGenerator): (JSC::fromCharCodeThunkGenerator): (JSC::sqrtThunkGenerator): (JSC::powThunkGenerator):
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): (JSC::JSGlobalData::releaseExecutableMemory): (JSC::releaseExecutableMemory):
  • runtime/JSGlobalData.h:
  • runtime/RegExpCache.cpp: (JSC::RegExpCache::invalidateCode):
  • runtime/RegExpCache.h:
  • yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::compile):
File:
1 edited

Legend:

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

    r85497 r87527  
    129129        }
    130130
    131         void* executableCopy(ExecutablePool* allocator)
     131        void* executableCopy(JSGlobalData& globalData, ExecutablePool* allocator)
    132132        {
    133133            if (!m_index)
    134134                return 0;
    135135
    136             void* result = allocator->alloc(m_index);
     136            void* result = allocator->alloc(globalData, m_index);
    137137
    138138            if (!result)
Note: See TracChangeset for help on using the changeset viewer.