<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Apologies in advance for cross-posting – not seeing any activity on webkit-help.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Caveat: Due to divergence in the code base and the target platform, I’m working with an older port based on v2.1.1. But, I believe my question is broad enough that someone may be able to help point me in the right area.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m enabling LLINT which was not enabled for the port we’re working with in this version. In the dispatch to llint_program_prologue, the CodeBlock.m_instructions[0] points to the value 0 which results into a jmp to 0 and a subsequent
access violation.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m looking to understand what conditions cause CodeBlock.m_instructions[0] to not point to code. Both JIT and LLINT are enabled.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">JSC::prepareForExecution builds a CTI stub with programEntryThunkGenerator, the prologue thunk executes and lands in the prologue code. I verified that the CodeBlock processed in prologue is the CodeBlock set up by this stack:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">x!JSC::prepareForExecution<JSC::ProgramCodeBlock>(JSC::ExecState *, WTF::OwnPtr<JSC::ProgramCodeBlock> & {...}, JSC::JITCode & {...}, JSC::JITCode::JITType BaselineJIT, unsigned int) executionharness.h line 42<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">x!JSC::ProgramExecutable::compileInternal(JSC::ExecState *, JSC::JSScope *, JSC::JITCode::JITType BaselineJIT, unsigned int) executable.cpp line 328 + 19 bytes<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">x!JSC::ProgramExecutable::compile(JSC::ExecState *, JSC::JSScope *) executable.h line 514 + 19 bytes<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Note that this code path is not taken as the profiler is not enabled, I’m not clear as to the design if this would impact this 0 index of m_instructions or not.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> if (exec->vm().m_perBytecodeProfiler)<o:p></o:p></p>
<p class="MsoNormal"> exec->vm().m_perBytecodeProfiler->ensureBytecodesFor(codeBlock.get());<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">After the prepareForExecution and going through the thunk, it’s the processing of the CodeBlock that lands the instruction pointer at 0. The offset of m_instructions looks correct comparing the offset with other assembly generated for
other modules (including CodeBlock.cpp itself). Inspecting the CodeBlock object and m_instructions[0] verifies it has a 0 in this entry. I am assuming this is unexpected – but I don’t understand where this is supposed to be set up when tracing step-by-step
through this code path.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any suggestions/pointers appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<pre style="margin-left:.5in;background:#29382F"><span style="color:white">_llint_program_prologue:<o:p></o:p></span></pre>
<pre style="margin-left:.5in;background:#29382F"><span style="color:white"> prologue(notFunctionCodeBlockGetter, notFunctionCodeBlockSetter, _llint_entry_osr, _llint_trace_prologue)<o:p></o:p></span></pre>
<pre style="margin-left:.5in;background:#29382F"><span style="color:white"> dispatch(</span><span style="color:#8080FF">0</span><span style="color:white">)<o:p></o:p></span></pre>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white"> # Set up the PC.<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white"> </span><span style="font-size:10.0pt;font-family:"Courier New";color:yellow">if</span><span style="font-size:10.0pt;font-family:"Courier New";color:white">
JSVALUE64<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white"> loadp CodeBlock::m_instructions[t1], PB<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white"> move
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#8080FF">0</span><span style="font-size:10.0pt;font-family:"Courier New";color:white">, PC<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white">
</span><span style="font-size:10.0pt;font-family:"Courier New";color:yellow">else</span><span style="font-size:10.0pt;font-family:"Courier New";color:white"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white"> loadp CodeBlock::m_instructions[t1], PC<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-left:.5in;background:#29382F"><span style="font-size:10.0pt;font-family:"Courier New";color:white">
</span><span style="font-size:10.0pt;font-family:"Courier New";color:yellow">end</span><span style="font-size:10.0pt;font-family:"Courier New";color:white"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>