diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
commit | 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch) | |
tree | 0287b1a69d84492c901e8bc820e635e7133809a0 /Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | |
parent | 682ab87480e7757346802ce7f54cfdbdfeb2339e (diff) | |
download | qtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz |
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGJITCompiler.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGJITCompiler.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp index 561f51615..3c85cc77c 100644 --- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp +++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp @@ -40,6 +40,15 @@ namespace JSC { namespace DFG { +JITCompiler::JITCompiler(Graph& dfg) + : CCallHelpers(&dfg.m_globalData, dfg.m_codeBlock) + , m_graph(dfg) + , m_currentCodeOriginIndex(0) +{ + if (shouldShowDisassembly()) + m_disassembler = adoptPtr(new Disassembler(dfg)); +} + void JITCompiler::linkOSRExits() { for (unsigned i = 0; i < codeBlock()->numberOfOSRExits(); ++i) { @@ -201,9 +210,11 @@ void JITCompiler::link(LinkBuffer& linkBuffer) bool JITCompiler::compile(JITCode& entry) { + setStartOfCode(); compileEntry(); SpeculativeJIT speculative(*this); compileBody(speculative); + setEndOfMainPath(); // Generate slow path code. speculative.runSlowPathGenerators(); @@ -213,6 +224,7 @@ bool JITCompiler::compile(JITCode& entry) // Create OSR entry trampolines if necessary. speculative.createOSREntries(); + setEndOfCode(); LinkBuffer linkBuffer(*m_globalData, this, m_codeBlock, JITCompilationCanFail); if (linkBuffer.didFailToAllocate()) @@ -220,14 +232,18 @@ bool JITCompiler::compile(JITCode& entry) link(linkBuffer); speculative.linkOSREntries(linkBuffer); + if (m_disassembler) + m_disassembler->dump(linkBuffer); + entry = JITCode( - FINALIZE_CODE(linkBuffer, ("DFG program/eval CodeBlock %p", m_codeBlock)), + linkBuffer.finalizeCodeWithoutDisassembly(), JITCode::DFGJIT); return true; } bool JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWithArityCheck) { + setStartOfCode(); compileEntry(); // === Function header code generation === @@ -246,6 +262,7 @@ bool JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi // === Function body code generation === SpeculativeJIT speculative(*this); compileBody(speculative); + setEndOfMainPath(); // === Function footer code generation === // @@ -290,7 +307,7 @@ bool JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi // Create OSR entry trampolines if necessary. speculative.createOSREntries(); - + setEndOfCode(); // === Link === LinkBuffer linkBuffer(*m_globalData, this, m_codeBlock, JITCompilationCanFail); @@ -302,10 +319,13 @@ bool JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi // FIXME: switch the register file check & arity check over to DFGOpertaion style calls, not JIT stubs. linkBuffer.link(callRegisterFileCheck, cti_register_file_check); linkBuffer.link(callArityCheck, m_codeBlock->m_isConstructor ? cti_op_construct_arityCheck : cti_op_call_arityCheck); + + if (m_disassembler) + m_disassembler->dump(linkBuffer); entryWithArityCheck = linkBuffer.locationOf(arityCheck); entry = JITCode( - FINALIZE_CODE(linkBuffer, ("DFG function CodeBlock %p", m_codeBlock)), + linkBuffer.finalizeCodeWithoutDisassembly(), JITCode::DFGJIT); return true; } |