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).
(JSC::ARMAssembler::executableCopy):
- assembler/ARMAssembler.h:
(ARMAssembler):
- assembler/AssemblerBuffer.h:
(JSC::AssemblerBuffer::executableCopy):
(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):
(JSC::ProgramCodeBlock::jitCompileImpl):
(JSC::EvalCodeBlock::jitCompileImpl):
(JSC::FunctionCodeBlock::jitCompileImpl):
(JSC::CodeBlock::jitCompile):
(CodeBlock):
(ProgramCodeBlock):
(EvalCodeBlock):
(FunctionCodeBlock):
(JSC::DFG::compile):
(JSC::DFG::JITCompiler::compile):
(JSC::DFG::JITCompiler::compileFunction):
(JITCompiler):
- jit/ExecutableAllocator.cpp:
(JSC::DemandExecutableAllocator::allocateNewSpace):
(JSC::ExecutableAllocator::allocate):
- jit/ExecutableAllocator.h:
(ExecutableAllocator):
- jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::allocate):
(JSC::JIT::privateCompile):
(JSC::JIT::compile):
(JIT):
- jit/JITCompilationEffort.h: Added.
(JSC):
(JSC::jitCompileIfAppropriate):
(JSC::jitCompileFunctionIfAppropriate):
- llint/LLIntSlowPaths.cpp:
(LLInt):
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::entryOSR):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::EvalExecutable::jitCompile):
(JSC::ProgramExecutable::jitCompile):
(JSC::FunctionExecutable::jitCompileForCall):
(JSC::FunctionExecutable::jitCompileForConstruct):
(EvalExecutable):
(ProgramExecutable):
(FunctionExecutable):
(JSC::FunctionExecutable::jitCompileFor):
- runtime/ExecutionHarness.h:
(JSC::prepareForExecution):
(JSC::prepareFunctionForExecution):