<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[176134] trunk/Source/JavaScriptCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176134">176134</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2014-11-14 12:24:55 -0800 (Fri, 14 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reduce amount of cut-and-paste needed for probe mechanism implementations.
&lt;https://webkit.org/b/138671&gt;

Reviewed by Geoffrey Garen.

The existing code requires that each MacroAssembler implementation provide
their own copy of all of the probe implementations even when most of it is
identical.  This patch hoists the common parts into AbstractMacroAssembler
(with some minor renaming).  Each target specific MacroAssembler now only
need to implement a few target specific methods that are expected by and
documented in AbstractMacroAssembler.h in the ENABLE(MASM_PROBE) section.

In this patch, I also simplified the X86 and X86_64 ports to use the same
port implementation.  The ARMv7 probe implementation should not conditionally
exclude the higher FP registers (since the JIT doesn't).  Fixed the ARMv7
probe code to include the higher FP registers always. 

This is all done in preparation to add printing functionality in JITted code
for debugging.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::Label::Label):
(JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
(JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
(JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
(JSC::AbstractMacroAssembler::DataLabelCompact::DataLabelCompact):
(JSC::AbstractMacroAssembler::Jump::link):
(JSC::AbstractMacroAssembler::Jump::linkTo):
(JSC::AbstractMacroAssembler::JumpList::link):
(JSC::AbstractMacroAssembler::JumpList::linkTo):
(JSC::AbstractMacroAssembler::ProbeContext::print):
(JSC::AbstractMacroAssembler::printIndent):
(JSC::AbstractMacroAssembler::printCPU):
(JSC::AbstractMacroAssembler::CachedTempRegister::CachedTempRegister):
- Except for the 3 printing methods (which are for the probe), the rest
  are touched simply because we need to add the MacroAssemblerType to the
  template args.
  The MacroAssemblerType is used by the abstract probe code to call the
  few probe methods that need to have CPU specific implementations.

* assembler/MacroAssemblerARM.cpp:
(JSC::MacroAssemblerARM::printCPURegisters):
- This was refactored from ProbeContext::dumpCPURegisters() which no
  longer exists.
(JSC::MacroAssemblerARM::ProbeContext::dumpCPURegisters): Deleted.
(JSC::MacroAssemblerARM::ProbeContext::dump): Deleted.

* assembler/MacroAssemblerARM.h:
* assembler/MacroAssemblerARM64.h:

* assembler/MacroAssemblerARMv7.cpp:
(JSC::MacroAssemblerARMv7::printCPURegisters):
- This was refactored from ProbeContext::dumpCPURegisters() which no
  longer exists.
(JSC::MacroAssemblerARMv7::ProbeContext::dumpCPURegisters): Deleted.
(JSC::MacroAssemblerARMv7::ProbeContext::dump): Deleted.

* assembler/MacroAssemblerARMv7.h:
* assembler/MacroAssemblerMIPS.h:
* assembler/MacroAssemblerSH4.h:
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::trustedImm32FromPtr): Deleted.
(JSC::MacroAssemblerX86::probe): Deleted.

* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssemblerX86Common::printCPURegisters):
- This was refactored from ProbeContext::dumpCPURegisters() which no
  longer exists.
(JSC::MacroAssemblerX86Common::probe):
- This implementation of probe() is based on the one originally in
  MacroAssemblerX86_64.h.  It is generic and should work for both
  32-bit and 64-bit.
(JSC::MacroAssemblerX86Common::ProbeContext::dumpCPURegisters): Deleted.
(JSC::MacroAssemblerX86Common::ProbeContext::dump): Deleted.

* assembler/MacroAssemblerX86Common.h:
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::trustedImm64FromPtr): Deleted.
(JSC::MacroAssemblerX86_64::probe): Deleted.
* jit/JITStubsARMv7.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerAbstractMacroAssemblerh">trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARMcpp">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARMh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARM64h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARMv7cpp">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerARMv7h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerMIPSh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerSH4h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commoncpp">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubsARMv7h">trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -1,3 +1,86 @@
</span><ins>+2014-11-13  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Reduce amount of cut-and-paste needed for probe mechanism implementations.
+        &lt;https://webkit.org/b/138671&gt;
+
+        Reviewed by Geoffrey Garen.
+
+        The existing code requires that each MacroAssembler implementation provide
+        their own copy of all of the probe implementations even when most of it is
+        identical.  This patch hoists the common parts into AbstractMacroAssembler
+        (with some minor renaming).  Each target specific MacroAssembler now only
+        need to implement a few target specific methods that are expected by and
+        documented in AbstractMacroAssembler.h in the ENABLE(MASM_PROBE) section.
+
+        In this patch, I also simplified the X86 and X86_64 ports to use the same
+        port implementation.  The ARMv7 probe implementation should not conditionally
+        exclude the higher FP registers (since the JIT doesn't).  Fixed the ARMv7
+        probe code to include the higher FP registers always. 
+
+        This is all done in preparation to add printing functionality in JITted code
+        for debugging.
+
+        * assembler/AbstractMacroAssembler.h:
+        (JSC::AbstractMacroAssembler::Label::Label):
+        (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
+        (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
+        (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
+        (JSC::AbstractMacroAssembler::DataLabelCompact::DataLabelCompact):
+        (JSC::AbstractMacroAssembler::Jump::link):
+        (JSC::AbstractMacroAssembler::Jump::linkTo):
+        (JSC::AbstractMacroAssembler::JumpList::link):
+        (JSC::AbstractMacroAssembler::JumpList::linkTo):
+        (JSC::AbstractMacroAssembler::ProbeContext::print):
+        (JSC::AbstractMacroAssembler::printIndent):
+        (JSC::AbstractMacroAssembler::printCPU):
+        (JSC::AbstractMacroAssembler::CachedTempRegister::CachedTempRegister):
+        - Except for the 3 printing methods (which are for the probe), the rest
+          are touched simply because we need to add the MacroAssemblerType to the
+          template args.
+          The MacroAssemblerType is used by the abstract probe code to call the
+          few probe methods that need to have CPU specific implementations.
+
+        * assembler/MacroAssemblerARM.cpp:
+        (JSC::MacroAssemblerARM::printCPURegisters):
+        - This was refactored from ProbeContext::dumpCPURegisters() which no
+          longer exists.
+        (JSC::MacroAssemblerARM::ProbeContext::dumpCPURegisters): Deleted.
+        (JSC::MacroAssemblerARM::ProbeContext::dump): Deleted.
+
+        * assembler/MacroAssemblerARM.h:
+        * assembler/MacroAssemblerARM64.h:
+
+        * assembler/MacroAssemblerARMv7.cpp:
+        (JSC::MacroAssemblerARMv7::printCPURegisters):
+        - This was refactored from ProbeContext::dumpCPURegisters() which no
+          longer exists.
+        (JSC::MacroAssemblerARMv7::ProbeContext::dumpCPURegisters): Deleted.
+        (JSC::MacroAssemblerARMv7::ProbeContext::dump): Deleted.
+
+        * assembler/MacroAssemblerARMv7.h:
+        * assembler/MacroAssemblerMIPS.h:
+        * assembler/MacroAssemblerSH4.h:
+        * assembler/MacroAssemblerX86.h:
+        (JSC::MacroAssemblerX86::trustedImm32FromPtr): Deleted.
+        (JSC::MacroAssemblerX86::probe): Deleted.
+
+        * assembler/MacroAssemblerX86Common.cpp:
+        (JSC::MacroAssemblerX86Common::printCPURegisters):
+        - This was refactored from ProbeContext::dumpCPURegisters() which no
+          longer exists.
+        (JSC::MacroAssemblerX86Common::probe):
+        - This implementation of probe() is based on the one originally in
+          MacroAssemblerX86_64.h.  It is generic and should work for both
+          32-bit and 64-bit.
+        (JSC::MacroAssemblerX86Common::ProbeContext::dumpCPURegisters): Deleted.
+        (JSC::MacroAssemblerX86Common::ProbeContext::dump): Deleted.
+
+        * assembler/MacroAssemblerX86Common.h:
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::trustedImm64FromPtr): Deleted.
+        (JSC::MacroAssemblerX86_64::probe): Deleted.
+        * jit/JITStubsARMv7.h:
+
</ins><span class="cx"> 2014-11-13  Michael Saboff  &lt;msaboff@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add scope operand to op_new_func* byte codes
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerAbstractMacroAssemblerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -88,10 +88,11 @@
</span><span class="cx"> struct OSRExit;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;class AssemblerType&gt;
</del><ins>+template &lt;class AssemblerType, class MacroAssemblerType&gt;
</ins><span class="cx"> class AbstractMacroAssembler {
</span><span class="cx"> public:
</span><span class="cx">     friend class JITWriteBarrierBase;
</span><ins>+    typedef AbstractMacroAssembler&lt;AssemblerType, MacroAssemblerType&gt; AbstractMacroAssemblerType;
</ins><span class="cx">     typedef AssemblerType AssemblerType_T;
</span><span class="cx"> 
</span><span class="cx">     typedef MacroAssemblerCodePtr CodePtr;
</span><span class="lines">@@ -355,7 +356,7 @@
</span><span class="cx">     // A Label records a point in the generated instruction stream, typically such that
</span><span class="cx">     // it may be used as a destination for a jump.
</span><span class="cx">     class Label {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend struct DFG::OSRExit;
</span><span class="cx">         friend class Jump;
</span><span class="lines">@@ -368,7 +369,7 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        Label(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        Label(AbstractMacroAssemblerType* masm)
</ins><span class="cx">             : m_label(masm-&gt;m_assembler.label())
</span><span class="cx">         {
</span><span class="cx">             masm-&gt;invalidateAllTempRegisters();
</span><span class="lines">@@ -390,7 +391,7 @@
</span><span class="cx">     //
</span><span class="cx">     // addPtr(TrustedImmPtr(i), a, b)
</span><span class="cx">     class ConvertibleLoadLabel {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend class LinkBuffer;
</span><span class="cx">         
</span><span class="lines">@@ -399,7 +400,7 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        ConvertibleLoadLabel(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        ConvertibleLoadLabel(AbstractMacroAssemblerType* masm)
</ins><span class="cx">             : m_label(masm-&gt;m_assembler.labelIgnoringWatchpoints())
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -414,7 +415,7 @@
</span><span class="cx">     // A DataLabelPtr is used to refer to a location in the code containing a pointer to be
</span><span class="cx">     // patched after the code has been generated.
</span><span class="cx">     class DataLabelPtr {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend class LinkBuffer;
</span><span class="cx">     public:
</span><span class="lines">@@ -422,7 +423,7 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        DataLabelPtr(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        DataLabelPtr(AbstractMacroAssemblerType* masm)
</ins><span class="cx">             : m_label(masm-&gt;m_assembler.label())
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -438,7 +439,7 @@
</span><span class="cx">     // A DataLabel32 is used to refer to a location in the code containing a 32-bit constant to be
</span><span class="cx">     // patched after the code has been generated.
</span><span class="cx">     class DataLabel32 {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend class LinkBuffer;
</span><span class="cx">     public:
</span><span class="lines">@@ -446,7 +447,7 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        DataLabel32(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        DataLabel32(AbstractMacroAssemblerType* masm)
</ins><span class="cx">             : m_label(masm-&gt;m_assembler.label())
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -462,7 +463,7 @@
</span><span class="cx">     // A DataLabelCompact is used to refer to a location in the code containing a
</span><span class="cx">     // compact immediate to be patched after the code has been generated.
</span><span class="cx">     class DataLabelCompact {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend class LinkBuffer;
</span><span class="cx">     public:
</span><span class="lines">@@ -470,7 +471,7 @@
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        DataLabelCompact(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        DataLabelCompact(AbstractMacroAssemblerType* masm)
</ins><span class="cx">             : m_label(masm-&gt;m_assembler.label())
</span><span class="cx">         {
</span><span class="cx">         }
</span><span class="lines">@@ -493,7 +494,7 @@
</span><span class="cx">     // relative offset such that when executed it will call to the desired
</span><span class="cx">     // destination.
</span><span class="cx">     class Call {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx"> 
</span><span class="cx">     public:
</span><span class="lines">@@ -537,7 +538,7 @@
</span><span class="cx">     // relative offset such that when executed it will jump to the desired
</span><span class="cx">     // destination.
</span><span class="cx">     class Jump {
</span><del>-        template&lt;class TemplateAssemblerType&gt;
</del><ins>+        template&lt;class TemplateAssemblerType, class TemplateMacroAssemblerType&gt;
</ins><span class="cx">         friend class AbstractMacroAssembler;
</span><span class="cx">         friend class Call;
</span><span class="cx">         friend struct DFG::OSRExit;
</span><span class="lines">@@ -602,7 +603,7 @@
</span><span class="cx">             return result;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        void link(AbstractMacroAssembler&lt;AssemblerType&gt;* masm) const
</del><ins>+        void link(AbstractMacroAssemblerType* masm) const
</ins><span class="cx">         {
</span><span class="cx">             masm-&gt;invalidateAllTempRegisters();
</span><span class="cx"> 
</span><span class="lines">@@ -626,7 +627,7 @@
</span><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        void linkTo(Label label, AbstractMacroAssembler&lt;AssemblerType&gt;* masm) const
</del><ins>+        void linkTo(Label label, AbstractMacroAssemblerType* masm) const
</ins><span class="cx">         {
</span><span class="cx"> #if ENABLE(DFG_REGISTER_ALLOCATION_VALIDATION)
</span><span class="cx">             masm-&gt;checkRegisterAllocationAgainstBranchRange(label.m_label.m_offset, m_label.m_offset);
</span><span class="lines">@@ -698,7 +699,7 @@
</span><span class="cx">                 append(jump);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        void link(AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        void link(AbstractMacroAssemblerType* masm)
</ins><span class="cx">         {
</span><span class="cx">             size_t size = m_jumps.size();
</span><span class="cx">             for (size_t i = 0; i &lt; size; ++i)
</span><span class="lines">@@ -706,7 +707,7 @@
</span><span class="cx">             m_jumps.clear();
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-        void linkTo(Label label, AbstractMacroAssembler&lt;AssemblerType&gt;* masm)
</del><ins>+        void linkTo(Label label, AbstractMacroAssemblerType* masm)
</ins><span class="cx">         {
</span><span class="cx">             size_t size = m_jumps.size();
</span><span class="cx">             for (size_t i = 0; i &lt; size; ++i)
</span><span class="lines">@@ -836,6 +837,95 @@
</span><span class="cx">         AssemblerType::cacheFlush(code, size);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+#if ENABLE(MASM_PROBE)
+
+    struct CPUState {
+        #define DECLARE_REGISTER(_type, _regName) \
+            _type _regName;
+        FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
+        #undef DECLARE_REGISTER
+    };
+
+    struct ProbeContext;
+    typedef void (*ProbeFunction)(struct ProbeContext*);
+
+    struct ProbeContext {
+        ProbeFunction probeFunction;
+        void* arg1;
+        void* arg2;
+        CPUState cpu;
+
+        void print(int indentation = 0)
+        {
+            #define INDENT MacroAssemblerType::printIndent(indentation)
+
+            INDENT, dataLogF(&quot;ProbeContext %p {\n&quot;, this);
+            indentation++;
+            {
+                INDENT, dataLogF(&quot;probeFunction: %p\n&quot;, probeFunction);
+                INDENT, dataLogF(&quot;arg1: %p %llu\n&quot;, arg1, reinterpret_cast&lt;int64_t&gt;(arg1));
+                INDENT, dataLogF(&quot;arg2: %p %llu\n&quot;, arg2, reinterpret_cast&lt;int64_t&gt;(arg2));
+                MacroAssemblerType::printCPU(cpu, indentation);
+            }
+            indentation--;
+            INDENT, dataLog(&quot;}\n&quot;);
+
+            #undef INDENT
+        }
+    };
+
+    static void printIndent(int indentation)
+    {
+        for (; indentation &gt; 0; indentation--)
+            dataLog(&quot;    &quot;);
+    }
+
+    static void printCPU(CPUState&amp; cpu, int indentation = 0)
+    {
+        #define INDENT printIndent(indentation)
+
+        INDENT, dataLog(&quot;cpu: {\n&quot;);
+        MacroAssemblerType::printCPURegisters(cpu, indentation + 1);
+        INDENT, dataLog(&quot;}\n&quot;);
+
+        #undef INDENT
+    }
+
+
+    // This function will be called by printCPU() to print the contents of the
+    // target specific registers which are saved away in the CPUInfo struct.
+    // printCPURegisters() should make use of printIndentation() to print the
+    // registers with the appropriate amount of indentation.
+    //
+    // Note: printCPURegisters() should be implemented by the target specific
+    // MacroAssembler. This prototype is only provided here to document the
+    // interface.
+
+    static void printCPURegisters(CPUState&amp;, int indentation = 0);
+
+    // This function emits code to preserve the CPUInfo (e.g. registers),
+    // call a user supplied probe function, and restore the CPUInfo before
+    // continuing with other JIT generated code.
+    //
+    // The user supplied probe function will be called with a single pointer to
+    // a ProbeContext struct (defined above) which contains, among other things,
+    // the preserved CPUInfo. This allows the user probe function to inspect
+    // the CPUInfo at that point in the JIT generated code.
+    //
+    // If the user probe function alters the register values in the ProbeContext,
+    // the altered values will be loaded into the CPU registers when the probe
+    // returns.
+    //
+    // The ProbeContext is stack allocated and is only valid for the duration
+    // of the call to the user probe function.
+    //
+    // Note: probe() should be implemented by the target specific MacroAssembler.
+    // This prototype is only provided here to document the interface.
+
+    void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
+
+#endif // ENABLE(MASM_PROBE)
+
</ins><span class="cx">     AssemblerType m_assembler;
</span><span class="cx">     
</span><span class="cx"> protected:
</span><span class="lines">@@ -877,7 +967,7 @@
</span><span class="cx">         friend class Label;
</span><span class="cx"> 
</span><span class="cx">     public:
</span><del>-        CachedTempRegister(AbstractMacroAssembler&lt;AssemblerType&gt;* masm, RegisterID registerID)
</del><ins>+        CachedTempRegister(AbstractMacroAssemblerType* masm, RegisterID registerID)
</ins><span class="cx">             : m_masm(masm)
</span><span class="cx">             , m_registerID(registerID)
</span><span class="cx">             , m_value(0)
</span><span class="lines">@@ -905,7 +995,7 @@
</span><span class="cx">         ALWAYS_INLINE void invalidate() { m_masm-&gt;clearTempRegisterValid(m_validBit); }
</span><span class="cx"> 
</span><span class="cx">     private:
</span><del>-        AbstractMacroAssembler&lt;AssemblerType&gt;* m_masm;
</del><ins>+        AbstractMacroAssemblerType* m_masm;
</ins><span class="cx">         RegisterID m_registerID;
</span><span class="cx">         intptr_t m_value;
</span><span class="cx">         unsigned m_validBit;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc.
</del><ins>+ * Copyright (C) 2013, 2014 Apple Inc.
</ins><span class="cx">  * Copyright (C) 2009 University of Szeged
</span><span class="cx">  * All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -31,10 +31,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MacroAssemblerARM.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-#include &lt;wtf/StdLibExtras.h&gt;
-#endif
-
</del><span class="cx"> #if OS(LINUX)
</span><span class="cx"> #include &lt;sys/types.h&gt;
</span><span class="cx"> #include &lt;sys/stat.h&gt;
</span><span class="lines">@@ -101,49 +97,34 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span><del>-void MacroAssemblerARM::ProbeContext::dumpCPURegisters(const char* indentation)
</del><ins>+#define INDENT printIndent(indentation)
+
+void MacroAssemblerARM::printCPURegisters(CPUState&amp; cpu, int indentation)
</ins><span class="cx"> {
</span><span class="cx">     #define DUMP_GPREGISTER(_type, _regName) { \
</span><span class="cx">         int32_t value = reinterpret_cast&lt;int32_t&gt;(cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %5s: 0x%08x   %d\n&quot;, indentation, #_regName, value, value) ; \
</del><ins>+        INDENT, dataLogF(&quot;%5s: 0x%08x  %d\n&quot;, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx">     FOR_EACH_CPU_GPREGISTER(DUMP_GPREGISTER)
</span><span class="cx">     FOR_EACH_CPU_SPECIAL_REGISTER(DUMP_GPREGISTER)
</span><span class="cx">     #undef DUMP_GPREGISTER
</span><span class="cx"> 
</span><span class="cx">     #define DUMP_FPREGISTER(_type, _regName) { \
</span><del>-        uint32_t* u = reinterpret_cast&lt;uint32_t*&gt;(&amp;cpu._regName); \
</del><ins>+        uint64_t* u = reinterpret_cast&lt;uint64_t*&gt;(&amp;cpu._regName); \
</ins><span class="cx">         double* d = reinterpret_cast&lt;double*&gt;(&amp;cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %5s: 0x %08x %08x   %12g\n&quot;, \
-            indentation, #_regName, u[1], u[0], d[0]); \
</del><ins>+        INDENT, dataLogF(&quot;%5s: 0x%016llx  %.13g\n&quot;, #_regName, *u, *d); \
</ins><span class="cx">     }
</span><span class="cx">     FOR_EACH_CPU_FPREGISTER(DUMP_FPREGISTER)
</span><span class="cx">     #undef DUMP_FPREGISTER
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MacroAssemblerARM::ProbeContext::dump(const char* indentation)
-{
-    if (!indentation)
-        indentation = &quot;&quot;;
</del><ins>+#undef INDENT
</ins><span class="cx"> 
</span><del>-    dataLogF(&quot;%sProbeContext %p {\n&quot;, indentation, this);
-    dataLogF(&quot;%s  probeFunction: %p\n&quot;, indentation, probeFunction);
-    dataLogF(&quot;%s  arg1: %p %llu\n&quot;, indentation, arg1, reinterpret_cast&lt;int64_t&gt;(arg1));
-    dataLogF(&quot;%s  arg2: %p %llu\n&quot;, indentation, arg2, reinterpret_cast&lt;int64_t&gt;(arg2));
-    dataLogF(&quot;%s  cpu: {\n&quot;, indentation);
-
-    dumpCPURegisters(indentation);
-
-    dataLogF(&quot;%s  }\n&quot;, indentation);
-    dataLogF(&quot;%s}\n&quot;, indentation);
-}
-
-
</del><span class="cx"> extern &quot;C&quot; void ctiMasmProbeTrampoline();
</span><span class="cx"> 
</span><span class="cx"> // For details on &quot;What code is emitted for the probe?&quot; and &quot;What values are in
</span><del>-// the saved registers?&quot;, see comment for MacroAssemblerX86::probe() in
-// MacroAssemblerX86_64.h.
</del><ins>+// the saved registers?&quot;, see comment for MacroAssemblerX86Common::probe() in
+// MacroAssemblerX86Common.cpp.
</ins><span class="cx"> 
</span><span class="cx"> void MacroAssemblerARM::probe(MacroAssemblerARM::ProbeFunction function, void* arg1, void* arg2)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2013 Apple Inc.
</del><ins>+ * Copyright (C) 2008, 2013, 2014 Apple Inc.
</ins><span class="cx">  * Copyright (C) 2009, 2010 University of Szeged
</span><span class="cx">  * All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerARM : public AbstractMacroAssembler&lt;ARMAssembler&gt; {
</del><ins>+class MacroAssemblerARM : public AbstractMacroAssembler&lt;ARMAssembler, MacroAssemblerARM&gt; {
</ins><span class="cx">     static const int DoubleConditionMask = 0x0f;
</span><span class="cx">     static const int DoubleConditionBitSpecial = 0x10;
</span><span class="cx">     COMPILE_ASSERT(!(DoubleConditionBitSpecial &amp; DoubleConditionMask), DoubleConditionBitSpecial_should_not_interfere_with_ARMAssembler_Condition_codes);
</span><span class="lines">@@ -1433,28 +1433,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><del>-    struct CPUState {
-        #define DECLARE_REGISTER(_type, _regName) \
-            _type _regName;
-        FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
-        #undef DECLARE_REGISTER
-    };
-
-    struct ProbeContext;
-    typedef void (*ProbeFunction)(struct ProbeContext*);
-
-    struct ProbeContext {
-        ProbeFunction probeFunction;
-        void* arg1;
-        void* arg2;
-        CPUState cpu;
-
-        void dump(const char* indentation = 0);
-    private:
-        void dumpCPURegisters(const char* indentation);
-    };
-
-    // For details about probe(), see comment in MacroAssemblerX86_64.h.
</del><ins>+    // Methods required by the MASM_PROBE mechanism as defined in
+    // AbstractMacroAssembler.h. 
+    static void printCPURegisters(CPUState&amp;, int indentation = 0);
</ins><span class="cx">     void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
</span><span class="cx"> #endif // ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARM64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerARM64 : public AbstractMacroAssembler&lt;ARM64Assembler&gt; {
</del><ins>+class MacroAssemblerARM64 : public AbstractMacroAssembler&lt;ARM64Assembler, MacroAssemblerARM64&gt; {
</ins><span class="cx">     static const RegisterID dataTempRegister = ARM64Registers::ip0;
</span><span class="cx">     static const RegisterID memoryTempRegister = ARM64Registers::ip1;
</span><span class="cx">     static const ARM64Registers::FPRegisterID fpTempRegister = ARM64Registers::q31;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARMv7cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -28,57 +28,38 @@
</span><span class="cx"> #if ENABLE(ASSEMBLER) &amp;&amp; CPU(ARM_THUMB2)
</span><span class="cx"> #include &quot;MacroAssemblerARMv7.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-#include &lt;wtf/StdLibExtras.h&gt;
-#endif
-
</del><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span><del>-void MacroAssemblerARMv7::ProbeContext::dumpCPURegisters(const char* indentation)
</del><ins>+#define INDENT printIndent(indentation)
+
+void MacroAssemblerARMv7::printCPURegisters(CPUState&amp; cpu, int indentation)
</ins><span class="cx"> {
</span><span class="cx">     #define DUMP_GPREGISTER(_type, _regName) { \
</span><span class="cx">         int32_t value = reinterpret_cast&lt;int32_t&gt;(cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %5s: 0x%08x   %d\n&quot;, indentation, #_regName, value, value) ; \
</del><ins>+        INDENT, dataLogF(&quot;%5s: 0x%08x  %d\n&quot;, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx">     FOR_EACH_CPU_GPREGISTER(DUMP_GPREGISTER)
</span><span class="cx">     FOR_EACH_CPU_SPECIAL_REGISTER(DUMP_GPREGISTER)
</span><span class="cx">     #undef DUMP_GPREGISTER
</span><span class="cx"> 
</span><span class="cx">     #define DUMP_FPREGISTER(_type, _regName) { \
</span><del>-        uint32_t* u = reinterpret_cast&lt;uint32_t*&gt;(&amp;cpu._regName); \
</del><ins>+        uint64_t* u = reinterpret_cast&lt;uint64_t*&gt;(&amp;cpu._regName); \
</ins><span class="cx">         double* d = reinterpret_cast&lt;double*&gt;(&amp;cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %5s: 0x %08x %08x   %12g\n&quot;, \
-            indentation, #_regName, u[1], u[0], d[0]); \
</del><ins>+        INDENT, dataLogF(&quot;%5s: 0x%016llx  %.13g\n&quot;, #_regName, *u, *d); \
</ins><span class="cx">     }
</span><span class="cx">     FOR_EACH_CPU_FPREGISTER(DUMP_FPREGISTER)
</span><span class="cx">     #undef DUMP_FPREGISTER
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MacroAssemblerARMv7::ProbeContext::dump(const char* indentation)
-{
-    if (!indentation)
-        indentation = &quot;&quot;;
</del><ins>+#undef INDENT
</ins><span class="cx"> 
</span><del>-    dataLogF(&quot;%sProbeContext %p {\n&quot;, indentation, this);
-    dataLogF(&quot;%s  probeFunction: %p\n&quot;, indentation, probeFunction);
-    dataLogF(&quot;%s  arg1: %p %llu\n&quot;, indentation, arg1, reinterpret_cast&lt;int64_t&gt;(arg1));
-    dataLogF(&quot;%s  arg2: %p %llu\n&quot;, indentation, arg2, reinterpret_cast&lt;int64_t&gt;(arg2));
-    dataLogF(&quot;%s  cpu: {\n&quot;, indentation);
-
-    dumpCPURegisters(indentation);
-
-    dataLogF(&quot;%s  }\n&quot;, indentation);
-    dataLogF(&quot;%s}\n&quot;, indentation);
-}
-
-
</del><span class="cx"> extern &quot;C&quot; void ctiMasmProbeTrampoline();
</span><span class="cx"> 
</span><span class="cx"> // For details on &quot;What code is emitted for the probe?&quot; and &quot;What values are in
</span><del>-// the saved registers?&quot;, see comment for MacroAssemblerX86::probe() in
-// MacroAssemblerX86_64.h.
</del><ins>+// the saved registers?&quot;, see comment for MacroAssemblerX86Common::probe() in
+// MacroAssemblerX86Common.cpp.
</ins><span class="cx"> 
</span><span class="cx"> void MacroAssemblerARMv7::probe(MacroAssemblerARMv7::ProbeFunction function, void* arg1, void* arg2)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerARMv7h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerARMv7 : public AbstractMacroAssembler&lt;ARMv7Assembler&gt; {
</del><ins>+class MacroAssemblerARMv7 : public AbstractMacroAssembler&lt;ARMv7Assembler, MacroAssemblerARMv7&gt; {
</ins><span class="cx">     static const RegisterID dataTempRegister = ARMRegisters::ip;
</span><span class="cx">     static const RegisterID addressTempRegister = ARMRegisters::r6;
</span><span class="cx"> 
</span><span class="lines">@@ -1902,28 +1902,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><del>-    struct CPUState {
-        #define DECLARE_REGISTER(_type, _regName) \
-            _type _regName;
-        FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
-        #undef DECLARE_REGISTER
-    };
-
-    struct ProbeContext;
-    typedef void (*ProbeFunction)(struct ProbeContext*);
-
-    struct ProbeContext {
-        ProbeFunction probeFunction;
-        void* arg1;
-        void* arg2;
-        CPUState cpu;
-
-        void dump(const char* indentation = 0);
-    private:
-        void dumpCPURegisters(const char* indentation);
-    };
-
-    // For details about probe(), see comment in MacroAssemblerX86_64.h.
</del><ins>+    // Methods required by the MASM_PROBE mechanism as defined in
+    // AbstractMacroAssembler.h. 
+    static void printCPURegisters(CPUState&amp;, int indentation = 0);
</ins><span class="cx">     void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
</span><span class="cx"> #endif // ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerMIPSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerMIPS.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2010 MIPS Technologies, Inc. All rights reserved.
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerMIPS : public AbstractMacroAssembler&lt;MIPSAssembler&gt; {
</del><ins>+class MacroAssemblerMIPS : public AbstractMacroAssembler&lt;MIPSAssembler, MacroAssemblerMIPS&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     typedef MIPSRegisters::FPRegisterID FPRegisterID;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerSH4h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerSH4.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2013 Cisco Systems, Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2009-2011 STMicroelectronics. All rights reserved.
</span><del>- * Copyright (C) 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerSH4 : public AbstractMacroAssembler&lt;SH4Assembler&gt; {
</del><ins>+class MacroAssemblerSH4 : public AbstractMacroAssembler&lt;SH4Assembler, MacroAssemblerSH4&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     typedef SH4Assembler::FPRegisterID FPRegisterID;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -30,10 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MacroAssemblerX86Common.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-#include &lt;wtf/StdLibExtras.h&gt;
-#endif
-
</del><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class MacroAssemblerX86 : public MacroAssemblerX86Common {
</span><span class="lines">@@ -349,11 +345,6 @@
</span><span class="cx">         X86Assembler::revertJumpTo_cmpl_im_force32(instructionStart.executableAddress(), initialValue, 0, address.base);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-    // For details about probe(), see comment in MacroAssemblerX86_64.h.
-    void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
-#endif // ENABLE(MASM_PROBE)
-
</del><span class="cx"> private:
</span><span class="cx">     friend class LinkBuffer;
</span><span class="cx">     friend class RepatchBuffer;
</span><span class="lines">@@ -372,46 +363,8 @@
</span><span class="cx">     {
</span><span class="cx">         X86Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
</span><span class="cx">     }
</span><del>-
-#if ENABLE(MASM_PROBE)
-    inline TrustedImm32 trustedImm32FromPtr(void* ptr)
-    {
-        return TrustedImm32(TrustedImmPtr(ptr));
-    }
-
-    inline TrustedImm32 trustedImm32FromPtr(ProbeFunction function)
-    {
-        return TrustedImm32(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(function)));
-    }
-
-    inline TrustedImm32 trustedImm32FromPtr(void (*function)())
-    {
-        return TrustedImm32(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(function)));
-    }
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-
-extern &quot;C&quot; void ctiMasmProbeTrampoline();
-
-// For details on &quot;What code is emitted for the probe?&quot; and &quot;What values are in
-// the saved registers?&quot;, see comment for MacroAssemblerX86::probe() in
-// MacroAssemblerX86_64.h.
-
-inline void MacroAssemblerX86::probe(MacroAssemblerX86::ProbeFunction function, void* arg1, void* arg2)
-{
-    push(RegisterID::esp);
-    push(RegisterID::eax);
-    push(trustedImm32FromPtr(arg2));
-    push(trustedImm32FromPtr(arg1));
-    push(trustedImm32FromPtr(function));
-
-    move(trustedImm32FromPtr(ctiMasmProbeTrampoline), RegisterID::eax);
-    call(RegisterID::eax);
-}
-#endif // ENABLE(MASM_PROBE)
-
</del><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASSEMBLER)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -32,47 +32,89 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span><del>-void MacroAssemblerX86Common::ProbeContext::dumpCPURegisters(const char* indentation)
</del><ins>+#define INDENT printIndent(indentation)
+
+void MacroAssemblerX86Common::printCPURegisters(MacroAssemblerX86Common::CPUState&amp; cpu, int indentation)
</ins><span class="cx"> {
</span><span class="cx"> #if CPU(X86)
</span><del>-    #define DUMP_GPREGISTER(_type, _regName) { \
</del><ins>+    #define PRINT_GPREGISTER(_type, _regName) { \
</ins><span class="cx">         int32_t value = reinterpret_cast&lt;int32_t&gt;(cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %6s: 0x%08x  %d\n&quot;, indentation, #_regName, value, value) ; \
</del><ins>+        INDENT, dataLogF(&quot;%6s: 0x%08x  %d\n&quot;, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx"> #elif CPU(X86_64)
</span><del>-    #define DUMP_GPREGISTER(_type, _regName) { \
</del><ins>+    #define PRINT_GPREGISTER(_type, _regName) { \
</ins><span class="cx">         int64_t value = reinterpret_cast&lt;int64_t&gt;(cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %6s: 0x%016llx  %lld\n&quot;, indentation, #_regName, value, value) ; \
</del><ins>+        INDENT, dataLogF(&quot;%6s: 0x%016llx  %lld\n&quot;, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-    FOR_EACH_CPU_GPREGISTER(DUMP_GPREGISTER)
-    FOR_EACH_CPU_SPECIAL_REGISTER(DUMP_GPREGISTER)
-    #undef DUMP_GPREGISTER
</del><ins>+    FOR_EACH_CPU_GPREGISTER(PRINT_GPREGISTER)
+    FOR_EACH_CPU_SPECIAL_REGISTER(PRINT_GPREGISTER)
+    #undef PRINT_GPREGISTER
</ins><span class="cx"> 
</span><del>-    #define DUMP_FPREGISTER(_type, _regName) { \
</del><ins>+    #define PRINT_FPREGISTER(_type, _regName) { \
</ins><span class="cx">         uint64_t* u = reinterpret_cast&lt;uint64_t*&gt;(&amp;cpu._regName); \
</span><span class="cx">         double* d = reinterpret_cast&lt;double*&gt;(&amp;cpu._regName); \
</span><del>-        dataLogF(&quot;%s    %6s: 0x%016llx  %.13g\n&quot;, indentation, #_regName, *u, *d); \
</del><ins>+        INDENT, dataLogF(&quot;%6s: 0x%016llx  %.13g\n&quot;, #_regName, *u, *d); \
</ins><span class="cx">     }
</span><del>-    FOR_EACH_CPU_FPREGISTER(DUMP_FPREGISTER)
-    #undef DUMP_FPREGISTER
</del><ins>+    FOR_EACH_CPU_FPREGISTER(PRINT_FPREGISTER)
+    #undef PRINT_FPREGISTER
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MacroAssemblerX86Common::ProbeContext::dump(const char* indentation)
-{
-    if (!indentation)
-        indentation = &quot;&quot;;
</del><ins>+#undef INDENT
</ins><span class="cx"> 
</span><del>-    dataLogF(&quot;%sProbeContext %p {\n&quot;, indentation, this);
-    dataLogF(&quot;%s  probeFunction: %p\n&quot;, indentation, probeFunction);
-    dataLogF(&quot;%s  arg1: %p %llu\n&quot;, indentation, arg1, reinterpret_cast&lt;int64_t&gt;(arg1));
-    dataLogF(&quot;%s  arg2: %p %llu\n&quot;, indentation, arg2, reinterpret_cast&lt;int64_t&gt;(arg2));
-    dataLogF(&quot;%s  cpu: {\n&quot;, indentation);
</del><ins>+extern &quot;C&quot; void ctiMasmProbeTrampoline();
</ins><span class="cx"> 
</span><del>-    dumpCPURegisters(indentation);
</del><ins>+// What code is emitted for the probe?
+// ==================================
+// We want to keep the size of the emitted probe invocation code as compact as
+// possible to minimize the perturbation to the JIT generated code. However,
+// we also need to preserve the CPU registers and set up the ProbeContext to be
+// passed to the user probe function.
+//
+// Hence, we do only the minimum here to preserve a scratch register (i.e. rax
+// in this case) and the stack pointer (i.e. rsp), and pass the probe arguments.
+// We'll let the ctiMasmProbeTrampoline handle the rest of the probe invocation
+// work i.e. saving the CPUState (and setting up the ProbeContext), calling the
+// user probe function, and restoring the CPUState before returning to JIT
+// generated code.
+//
+// What registers need to be saved?
+// ===============================
+// The registers are saved for 2 reasons:
+// 1. To preserve their state in the JITted code. This means that all registers
+//    that are not callee saved needs to be saved. We also need to save the
+//    condition code registers because the probe can be inserted between a test
+//    and a branch.
+// 2. To allow the probe to inspect the values of the registers for debugging
+//    purposes. This means all registers need to be saved.
+//
+// In summary, save everything. But for reasons stated above, we should do the
+// minimum here and let ctiMasmProbeTrampoline do the heavy lifting to save the
+// full set.
+//
+// What values are in the saved registers?
+// ======================================
+// Conceptually, the saved registers should contain values as if the probe
+// is not present in the JIT generated code. Hence, they should contain values
+// that are expected at the start of the instruction immediately following the
+// probe.
+//
+// Specifically, the saved stack pointer register will point to the stack
+// position before we push the ProbeContext frame. The saved rip will point to
+// the address of the instruction immediately following the probe. 
</ins><span class="cx"> 
</span><del>-    dataLogF(&quot;%s  }\n&quot;, indentation);
-    dataLogF(&quot;%s}\n&quot;, indentation);
</del><ins>+void MacroAssemblerX86Common::probe(MacroAssemblerX86Common::ProbeFunction function, void* arg1, void* arg2)
+{
+    push(RegisterID::esp);
+    push(RegisterID::eax);
+    move(TrustedImmPtr(arg2), RegisterID::eax);
+    push(RegisterID::eax);
+    move(TrustedImmPtr(arg1), RegisterID::eax);
+    push(RegisterID::eax);
+    move(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(function)), RegisterID::eax);
+    push(RegisterID::eax);
+    move(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(ctiMasmProbeTrampoline)), RegisterID::eax);
+    call(RegisterID::eax);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MASM_PROBE)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><del>-class MacroAssemblerX86Common : public AbstractMacroAssembler&lt;X86Assembler&gt; {
</del><ins>+class MacroAssemblerX86Common : public AbstractMacroAssembler&lt;X86Assembler, MacroAssemblerX86Common&gt; {
</ins><span class="cx"> public:
</span><span class="cx"> #if CPU(X86_64)
</span><span class="cx">     static const X86Registers::RegisterID scratchRegister = X86Registers::r11;
</span><span class="lines">@@ -1470,26 +1470,10 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MASM_PROBE)
</span><del>-    struct CPUState {
-        #define DECLARE_REGISTER(_type, _regName) \
-            _type _regName;
-        FOR_EACH_CPU_REGISTER(DECLARE_REGISTER)
-        #undef DECLARE_REGISTER
-    };
-
-    struct ProbeContext;
-    typedef void (*ProbeFunction)(struct ProbeContext*);
-
-    struct ProbeContext {
-        ProbeFunction probeFunction;
-        void* arg1;
-        void* arg2;
-        CPUState cpu;
-
-        void dump(const char* indentation = 0);
-    private:
-        void dumpCPURegisters(const char* indentation);
-    };
</del><ins>+    // Methods required by the MASM_PROBE mechanism as defined in
+    // AbstractMacroAssembler.h. 
+    static void printCPURegisters(CPUState&amp;, int indentation = 0);
+    void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
</ins><span class="cx"> #endif // ENABLE(MASM_PROBE)
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86_64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -30,10 +30,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MacroAssemblerX86Common.h&quot;
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-#include &lt;wtf/StdLibExtras.h&gt;
-#endif
-
</del><span class="cx"> #define REPTACH_OFFSET_CALL_R11 3
</span><span class="cx"> 
</span><span class="cx"> inline bool CAN_SIGN_EXTEND_32_64(int64_t value) { return value == (int64_t)(int32_t)value; }
</span><span class="lines">@@ -840,26 +836,6 @@
</span><span class="cx">         X86Assembler::revertJumpTo_movq_i64r(instructionStart.executableAddress(), reinterpret_cast&lt;intptr_t&gt;(initialValue), scratchRegister);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-    // This function emits code to preserve the CPUState (e.g. registers),
-    // call a user supplied probe function, and restore the CPUState before
-    // continuing with other JIT generated code.
-    //
-    // The user supplied probe function will be called with a single pointer to
-    // a ProbeContext struct (defined above) which contains, among other things,
-    // the preserved CPUState. This allows the user probe function to inspect
-    // the CPUState at that point in the JIT generated code.
-    //
-    // If the user probe function alters the register values in the ProbeContext,
-    // the altered values will be loaded into the CPU registers when the probe
-    // returns.
-    //
-    // The ProbeContext is stack allocated and is only valid for the duration
-    // of the call to the user probe function.
-
-    void probe(ProbeFunction, void* arg1 = 0, void* arg2 = 0);
-#endif // ENABLE(MASM_PROBE)
-
</del><span class="cx"> private:
</span><span class="cx">     friend class LinkBuffer;
</span><span class="cx">     friend class RepatchBuffer;
</span><span class="lines">@@ -881,69 +857,8 @@
</span><span class="cx">     {
</span><span class="cx">         X86Assembler::repatchPointer(call.dataLabelPtrAtOffset(-REPTACH_OFFSET_CALL_R11).dataLocation(), destination.executableAddress());
</span><span class="cx">     }
</span><del>-
-#if ENABLE(MASM_PROBE)
-    inline TrustedImm64 trustedImm64FromPtr(void* ptr)
-    {
-        return TrustedImm64(TrustedImmPtr(ptr));
-    }
-
-    inline TrustedImm64 trustedImm64FromPtr(ProbeFunction function)
-    {
-        return TrustedImm64(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(function)));
-    }
-
-    inline TrustedImm64 trustedImm64FromPtr(void (*function)())
-    {
-        return TrustedImm64(TrustedImmPtr(reinterpret_cast&lt;void*&gt;(function)));
-    }
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if ENABLE(MASM_PROBE)
-
-extern &quot;C&quot; void ctiMasmProbeTrampoline();
-
-// What code is emitted for the probe?
-// ==================================
-// We want to keep the size of the emitted probe invocation code as compact as
-// possible to minimize the perturbation to the JIT generated code. However,
-// we also need to preserve the CPU registers and set up the ProbeContext to be
-// passed to the user probe function.
-//
-// Hence, we do only the minimum here to preserve a scratch register (i.e. rax
-// in this case) and the stack pointer (i.e. rsp), and pass the probe arguments.
-// We'll let the ctiMasmProbeTrampoline handle the rest of the probe invocation
-// work i.e. saving the CPUState (and setting up the ProbeContext), calling the
-// user probe function, and restoring the CPUState before returning to JIT
-// generated code.
-//
-// What values are in the saved registers?
-// ======================================
-// Conceptually, the saved registers should contain values as if the probe
-// is not present in the JIT generated code. Hence, they should contain values
-// that are expected at the start of the instruction immediately following the
-// probe.
-//
-// Specifcally, the saved stack pointer register will point to the stack
-// position before we push the ProbeContext frame. The saved rip will point to
-// the address of the instruction immediately following the probe. 
-
-inline void MacroAssemblerX86_64::probe(MacroAssemblerX86_64::ProbeFunction function, void* arg1, void* arg2)
-{
-    push(RegisterID::esp);
-    push(RegisterID::eax);
-    move(trustedImm64FromPtr(arg2), RegisterID::eax);
-    push(RegisterID::eax);
-    move(trustedImm64FromPtr(arg1), RegisterID::eax);
-    push(RegisterID::eax);
-    move(trustedImm64FromPtr(function), RegisterID::eax);
-    push(RegisterID::eax);
-    move(trustedImm64FromPtr(ctiMasmProbeTrampoline), RegisterID::eax);
-    call(RegisterID::eax);
-}
-#endif // ENABLE(MASM_PROBE)
-
</del><span class="cx"> } // namespace JSC
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(ASSEMBLER)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubsARMv7h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h (176133 => 176134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h        2014-11-14 20:05:26 UTC (rev 176133)
+++ trunk/Source/JavaScriptCore/jit/JITStubsARMv7.h        2014-11-14 20:24:55 UTC (rev 176134)
</span><span class="lines">@@ -94,8 +94,6 @@
</span><span class="cx"> #define PROBE_CPU_D13_OFFSET (PROBE_FIRST_FPREG_OFFSET + (13 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_CPU_D14_OFFSET (PROBE_FIRST_FPREG_OFFSET + (14 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_CPU_D15_OFFSET (PROBE_FIRST_FPREG_OFFSET + (15 * FPREG_SIZE))
</span><del>-
-#if CPU(APPLE_ARMV7S)
</del><span class="cx"> #define PROBE_CPU_D16_OFFSET (PROBE_FIRST_FPREG_OFFSET + (16 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_CPU_D17_OFFSET (PROBE_FIRST_FPREG_OFFSET + (17 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_CPU_D18_OFFSET (PROBE_FIRST_FPREG_OFFSET + (18 * FPREG_SIZE))
</span><span class="lines">@@ -113,11 +111,7 @@
</span><span class="cx"> #define PROBE_CPU_D30_OFFSET (PROBE_FIRST_FPREG_OFFSET + (30 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_CPU_D31_OFFSET (PROBE_FIRST_FPREG_OFFSET + (31 * FPREG_SIZE))
</span><span class="cx"> #define PROBE_SIZE (PROBE_FIRST_FPREG_OFFSET + (32 * FPREG_SIZE))
</span><del>-#else
-#define PROBE_SIZE (PROBE_FIRST_FPREG_OFFSET + (16 * FPREG_SIZE))
-#endif // CPU(APPLE_ARMV7S)
</del><span class="cx"> 
</span><del>-
</del><span class="cx"> // These ASSERTs remind you that if you change the layout of ProbeContext,
</span><span class="cx"> // you need to change ctiMasmProbeTrampoline offsets above to match.
</span><span class="cx"> #define PROBE_OFFSETOF(x) offsetof(struct MacroAssembler::ProbeContext, x)
</span><span class="lines">@@ -162,7 +156,6 @@
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d14) == PROBE_CPU_D14_OFFSET, ProbeContext_cpu_d14_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d15) == PROBE_CPU_D15_OFFSET, ProbeContext_cpu_d15_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> 
</span><del>-#if CPU(APPLE_ARMV7S)
</del><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d16) == PROBE_CPU_D16_OFFSET, ProbeContext_cpu_d16_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d17) == PROBE_CPU_D17_OFFSET, ProbeContext_cpu_d17_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d18) == PROBE_CPU_D18_OFFSET, ProbeContext_cpu_d18_offset_matches_ctiMasmProbeTrampoline);
</span><span class="lines">@@ -179,7 +172,6 @@
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d29) == PROBE_CPU_D29_OFFSET, ProbeContext_cpu_d29_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d30) == PROBE_CPU_D30_OFFSET, ProbeContext_cpu_d30_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.d31) == PROBE_CPU_D31_OFFSET, ProbeContext_cpu_d31_offset_matches_ctiMasmProbeTrampoline);
</span><del>-#endif // CPU(APPLE_ARMV7S)
</del><span class="cx"> 
</span><span class="cx"> COMPILE_ASSERT(sizeof(MacroAssembler::ProbeContext) == PROBE_SIZE, ProbeContext_size_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> 
</span><span class="lines">@@ -238,11 +230,7 @@
</span><span class="cx">     &quot;ldr       lr, [sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_PC_OFFSET) &quot;]&quot; &quot;\n&quot;
</span><span class="cx"> 
</span><span class="cx">     &quot;add       ip, sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_D0_OFFSET) &quot;\n&quot;
</span><del>-#if CPU(APPLE_ARMV7S)
</del><span class="cx">     &quot;vstmia.64 ip, { d0-d31 }&quot; &quot;\n&quot;
</span><del>-#else
-    &quot;vstmia.64 ip, { d0-d15 }&quot; &quot;\n&quot;
-#endif
</del><span class="cx"> 
</span><span class="cx">     &quot;mov       fp, sp&quot; &quot;\n&quot; // Save the ProbeContext*.
</span><span class="cx"> 
</span><span class="lines">@@ -255,13 +243,8 @@
</span><span class="cx">     // To enable probes to modify register state, we copy all registers
</span><span class="cx">     // out of the ProbeContext before returning.
</span><span class="cx"> 
</span><del>-#if CPU(APPLE_ARMV7S)
</del><span class="cx">     &quot;add       ip, sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_D31_OFFSET + FPREG_SIZE) &quot;\n&quot;
</span><span class="cx">     &quot;vldmdb.64 ip!, { d0-d31 }&quot; &quot;\n&quot;
</span><del>-#else
-    &quot;add       ip, sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_D15_OFFSET + FPREG_SIZE) &quot;\n&quot;
-    &quot;vldmdb.64 ip!, { d0-d15 }&quot; &quot;\n&quot;
-#endif
</del><span class="cx">     &quot;add       ip, sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_R11_OFFSET + GPREG_SIZE) &quot;\n&quot;
</span><span class="cx">     &quot;ldmdb     ip, { r0-r11 }&quot; &quot;\n&quot;
</span><span class="cx">     &quot;ldr       ip, [sp, #&quot; STRINGIZE_VALUE_OF(PROBE_CPU_FPSCR_OFFSET) &quot;]&quot; &quot;\n&quot;
</span></span></pre>
</div>
</div>

</body>
</html>