|
Lines 55-61
JITCompiler::JITCompiler(Graph& dfg)
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec1
|
| 55 |
, m_blockHeads(dfg.numBlocks()) |
55 |
, m_blockHeads(dfg.numBlocks()) |
| 56 |
{ |
56 |
{ |
| 57 |
if (shouldShowDisassembly() || m_graph.m_vm.m_perBytecodeProfiler) |
57 |
if (shouldShowDisassembly() || m_graph.m_vm.m_perBytecodeProfiler) |
| 58 |
m_disassembler = adoptPtr(new Disassembler(dfg)); |
58 |
m_disassembler = std::make_unique<Disassembler>(dfg); |
| 59 |
} |
59 |
} |
| 60 |
|
60 |
|
| 61 |
JITCompiler::~JITCompiler() |
61 |
JITCompiler::~JITCompiler() |
|
Lines 291-297
void JITCompiler::compile()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec2
|
| 291 |
|
291 |
|
| 292 |
setStartOfCode(); |
292 |
setStartOfCode(); |
| 293 |
compileEntry(); |
293 |
compileEntry(); |
| 294 |
m_speculative = adoptPtr(new SpeculativeJIT(*this)); |
294 |
m_speculative = std::make_unique<SpeculativeJIT>(*this); |
| 295 |
addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister); |
295 |
addPtr(TrustedImm32(m_graph.stackPointerOffset() * sizeof(Register)), GPRInfo::callFrameRegister, stackPointerRegister); |
| 296 |
checkStackPointerAlignment(); |
296 |
checkStackPointerAlignment(); |
| 297 |
compileBody(); |
297 |
compileBody(); |
|
Lines 312-318
void JITCompiler::link()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec3
|
| 312 |
{ |
312 |
{ |
| 313 |
auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail); |
313 |
auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail); |
| 314 |
if (linkBuffer->didFailToAllocate()) { |
314 |
if (linkBuffer->didFailToAllocate()) { |
| 315 |
m_graph.m_plan.finalizer = adoptPtr(new FailedFinalizer(m_graph.m_plan)); |
315 |
m_graph.m_plan.finalizer = std::make_unique<FailedFinalizer>(m_graph.m_plan); |
| 316 |
return; |
316 |
return; |
| 317 |
} |
317 |
} |
| 318 |
|
318 |
|
|
Lines 324-331
void JITCompiler::link()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec4
|
| 324 |
|
324 |
|
| 325 |
disassemble(*linkBuffer); |
325 |
disassemble(*linkBuffer); |
| 326 |
|
326 |
|
| 327 |
m_graph.m_plan.finalizer = adoptPtr(new JITFinalizer( |
327 |
m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>( |
| 328 |
m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer))); |
328 |
m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer)); |
| 329 |
} |
329 |
} |
| 330 |
|
330 |
|
| 331 |
void JITCompiler::compileFunction() |
331 |
void JITCompiler::compileFunction() |
|
Lines 349-355
void JITCompiler::compileFunction()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec5
|
| 349 |
checkStackPointerAlignment(); |
349 |
checkStackPointerAlignment(); |
| 350 |
|
350 |
|
| 351 |
// === Function body code generation === |
351 |
// === Function body code generation === |
| 352 |
m_speculative = adoptPtr(new SpeculativeJIT(*this)); |
352 |
m_speculative = std::make_unique<SpeculativeJIT>(*this); |
| 353 |
compileBody(); |
353 |
compileBody(); |
| 354 |
setEndOfMainPath(); |
354 |
setEndOfMainPath(); |
| 355 |
|
355 |
|
|
Lines 414-420
void JITCompiler::linkFunction()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec6
|
| 414 |
// === Link === |
414 |
// === Link === |
| 415 |
auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail); |
415 |
auto linkBuffer = std::make_unique<LinkBuffer>(*m_vm, *this, m_codeBlock, JITCompilationCanFail); |
| 416 |
if (linkBuffer->didFailToAllocate()) { |
416 |
if (linkBuffer->didFailToAllocate()) { |
| 417 |
m_graph.m_plan.finalizer = adoptPtr(new FailedFinalizer(m_graph.m_plan)); |
417 |
m_graph.m_plan.finalizer = std::make_unique<FailedFinalizer>(m_graph.m_plan); |
| 418 |
return; |
418 |
return; |
| 419 |
} |
419 |
} |
| 420 |
link(*linkBuffer); |
420 |
link(*linkBuffer); |
|
Lines 429-436
void JITCompiler::linkFunction()
a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp_sec7
|
| 429 |
|
429 |
|
| 430 |
MacroAssemblerCodePtr withArityCheck = linkBuffer->locationOf(m_arityCheck); |
430 |
MacroAssemblerCodePtr withArityCheck = linkBuffer->locationOf(m_arityCheck); |
| 431 |
|
431 |
|
| 432 |
m_graph.m_plan.finalizer = adoptPtr(new JITFinalizer( |
432 |
m_graph.m_plan.finalizer = std::make_unique<JITFinalizer>( |
| 433 |
m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer), withArityCheck)); |
433 |
m_graph.m_plan, m_jitCode.release(), WTF::move(linkBuffer), withArityCheck); |
| 434 |
} |
434 |
} |
| 435 |
|
435 |
|
| 436 |
void JITCompiler::disassemble(LinkBuffer& linkBuffer) |
436 |
void JITCompiler::disassemble(LinkBuffer& linkBuffer) |