Ignore:
Timestamp:
Feb 29, 2012, 9:46:20 PM (13 years ago)
Author:
[email protected]
Message:

The JIT should not crash the entire process just because there is not
enough executable memory, if the LLInt is enabled
https://bugs.webkit.org/show_bug.cgi?id=79962
<rdar://problem/10922215>

Reviewed by Gavin Barraclough.

Added the notion of JITCompilationEffort. If we're JIT'ing as a result of
a tier-up, then we set it to JITCompilationCanFail. Otherwise it's
JITCompilationMustSucceed. This preserves the old behavior of LLInt is
disabled or if we're compiling something that can't be interpreted (like
an OSR exit stub).

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/ARMAssembler.cpp:

(JSC::ARMAssembler::executableCopy):

  • assembler/ARMAssembler.h:

(ARMAssembler):

  • assembler/AssemblerBuffer.h:

(JSC::AssemblerBuffer::executableCopy):

  • assembler/LinkBuffer.h:

(JSC::LinkBuffer::LinkBuffer):
(JSC::LinkBuffer::~LinkBuffer):
(LinkBuffer):
(JSC::LinkBuffer::didFailToAllocate):
(JSC::LinkBuffer::isValid):
(JSC::LinkBuffer::linkCode):
(JSC::LinkBuffer::performFinalization):

  • assembler/MIPSAssembler.h:

(JSC::MIPSAssembler::executableCopy):

  • assembler/SH4Assembler.h:

(JSC::SH4Assembler::executableCopy):

  • assembler/X86Assembler.h:

(JSC::X86Assembler::executableCopy):
(JSC::X86Assembler::X86InstructionFormatter::executableCopy):

  • bytecode/CodeBlock.cpp:

(JSC::ProgramCodeBlock::jitCompileImpl):
(JSC::EvalCodeBlock::jitCompileImpl):
(JSC::FunctionCodeBlock::jitCompileImpl):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::jitCompile):
(CodeBlock):
(ProgramCodeBlock):
(EvalCodeBlock):
(FunctionCodeBlock):

  • dfg/DFGDriver.cpp:

(JSC::DFG::compile):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):

  • dfg/DFGJITCompiler.h:

(JITCompiler):

  • jit/ExecutableAllocator.cpp:

(JSC::DemandExecutableAllocator::allocateNewSpace):
(JSC::ExecutableAllocator::allocate):

  • jit/ExecutableAllocator.h:

(ExecutableAllocator):

  • jit/ExecutableAllocatorFixedVMPool.cpp:

(JSC::ExecutableAllocator::allocate):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JIT.h:

(JSC::JIT::compile):
(JIT):

  • jit/JITCompilationEffort.h: Added.

(JSC):

  • jit/JITDriver.h:

(JSC::jitCompileIfAppropriate):
(JSC::jitCompileFunctionIfAppropriate):

  • llint/LLIntSlowPaths.cpp:

(LLInt):
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::entryOSR):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/Executable.cpp:

(JSC::EvalExecutable::jitCompile):
(JSC::ProgramExecutable::jitCompile):
(JSC::FunctionExecutable::jitCompileForCall):
(JSC::FunctionExecutable::jitCompileForConstruct):

  • runtime/Executable.h:

(EvalExecutable):
(ProgramExecutable):
(FunctionExecutable):
(JSC::FunctionExecutable::jitCompileFor):

  • runtime/ExecutionHarness.h:

(JSC::prepareForExecution):
(JSC::prepareFunctionForExecution):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/ARMAssembler.cpp

    r105636 r109307  
    345345}
    346346
    347 PassRefPtr<ExecutableMemoryHandle> ARMAssembler::executableCopy(JSGlobalData& globalData, void* ownerUID)
     347PassRefPtr<ExecutableMemoryHandle> ARMAssembler::executableCopy(JSGlobalData& globalData, void* ownerUID, JITCompilationEffort effort)
    348348{
    349349    // 64-bit alignment is required for next constant pool and JIT code as well
     
    352352        bkpt(0);
    353353
    354     RefPtr<ExecutableMemoryHandle> result = m_buffer.executableCopy(globalData, ownerUID);
     354    RefPtr<ExecutableMemoryHandle> result = m_buffer.executableCopy(globalData, ownerUID, effort);
    355355    char* data = reinterpret_cast<char*>(result->start());
    356356
Note: See TracChangeset for help on using the changeset viewer.