<!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>[176095] 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/176095">176095</a></dd>
<dt>Author</dt> <dd>mark.lam@apple.com</dd>
<dt>Date</dt> <dd>2014-11-13 15:00:07 -0800 (Thu, 13 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Change X86/64 JIT probes to save/restore xmm regs as double instead of __m128.
&lt;https://webkit.org/b/138708&gt;

Reviewed by Michael Saboff.

The JIT code only uses the xmm regs as double registers.  This patch changes
the storage types of the FP registers in X86Assembler.h to double instead of
__m128, and updates the X86 and X86_64 JIT probe implementations accordingly.

Also made some minor cosmetic changes in the output of the probe dump functions.

* assembler/MacroAssemblerX86Common.cpp:
(JSC::MacroAssemblerX86Common::ProbeContext::dumpCPURegisters):
* assembler/X86Assembler.h:
* jit/JITStubsX86.h:
* jit/JITStubsX86Common.h:
* jit/JITStubsX86_64.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commoncpp">trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreassemblerX86Assemblerh">trunk/Source/JavaScriptCore/assembler/X86Assembler.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubsX86h">trunk/Source/JavaScriptCore/jit/JITStubsX86.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubsX86Commonh">trunk/Source/JavaScriptCore/jit/JITStubsX86Common.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITStubsX86_64h">trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/ChangeLog        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-11-13  Mark Lam  &lt;mark.lam@apple.com&gt;
+
+        Change X86/64 JIT probes to save/restore xmm regs as double instead of __m128.
+        &lt;https://webkit.org/b/138708&gt;
+
+        Reviewed by Michael Saboff.
+
+        The JIT code only uses the xmm regs as double registers.  This patch changes
+        the storage types of the FP registers in X86Assembler.h to double instead of
+        __m128, and updates the X86 and X86_64 JIT probe implementations accordingly.
+
+        Also made some minor cosmetic changes in the output of the probe dump functions.
+
+        * assembler/MacroAssemblerX86Common.cpp:
+        (JSC::MacroAssemblerX86Common::ProbeContext::dumpCPURegisters):
+        * assembler/X86Assembler.h:
+        * jit/JITStubsX86.h:
+        * jit/JITStubsX86Common.h:
+        * jit/JITStubsX86_64.h:
+
</ins><span class="cx"> 2014-11-13  Juergen Ributzka  &lt;juergen@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update WebKit to build with LLVM TOT
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerMacroAssemblerX86Commoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.cpp        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 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">@@ -37,12 +37,12 @@
</span><span class="cx"> #if CPU(X86)
</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    %6s: 0x%08x   %d\n&quot;, indentation, #_regName, value, value) ; \
</del><ins>+        dataLogF(&quot;%s    %6s: 0x%08x  %d\n&quot;, indentation, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx"> #elif CPU(X86_64)
</span><span class="cx">     #define DUMP_GPREGISTER(_type, _regName) { \
</span><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>+        dataLogF(&quot;%s    %6s: 0x%016llx  %lld\n&quot;, indentation, #_regName, value, value) ; \
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx">     FOR_EACH_CPU_GPREGISTER(DUMP_GPREGISTER)
</span><span class="lines">@@ -50,10 +50,9 @@
</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    %6s: 0x%08x%08x 0x%08x%08x   %12g %12g\n&quot;, \
-            indentation, #_regName, u[3], u[2], u[1], u[0], d[1], d[0]); \
</del><ins>+        dataLogF(&quot;%s    %6s: 0x%016llx  %.13g\n&quot;, indentation, #_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></pre></div>
<a id="trunkSourceJavaScriptCoreassemblerX86Assemblerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/assembler/X86Assembler.h (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/assembler/X86Assembler.h        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2012, 2013, 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">@@ -73,14 +73,14 @@
</span><span class="cx"> // the storing still expects a __m128 slot. This will be changed when the JIT
</span><span class="cx"> // probe code is updated later to reflect the JITs' usage of these registers.
</span><span class="cx"> #define FOR_EACH_CPU_FPREGISTER(V) \
</span><del>-    V(__m128, xmm0) \
-    V(__m128, xmm1) \
-    V(__m128, xmm2) \
-    V(__m128, xmm3) \
-    V(__m128, xmm4) \
-    V(__m128, xmm5) \
-    V(__m128, xmm6) \
-    V(__m128, xmm7) \
</del><ins>+    V(double, xmm0) \
+    V(double, xmm1) \
+    V(double, xmm2) \
+    V(double, xmm3) \
+    V(double, xmm4) \
+    V(double, xmm5) \
+    V(double, xmm6) \
+    V(double, xmm7) \
</ins><span class="cx">     FOR_EACH_X86_64_CPU_FPREGISTER(V)
</span><span class="cx"> 
</span><span class="cx"> #if CPU(X86)
</span><span class="lines">@@ -101,14 +101,14 @@
</span><span class="cx">     V(void*, r15)
</span><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_X86_64_CPU_FPREGISTER(V) \
</span><del>-    V(__m128, xmm8) \
-    V(__m128, xmm9) \
-    V(__m128, xmm10) \
-    V(__m128, xmm11) \
-    V(__m128, xmm12) \
-    V(__m128, xmm13) \
-    V(__m128, xmm14) \
-    V(__m128, xmm15)
</del><ins>+    V(double, xmm8) \
+    V(double, xmm9) \
+    V(double, xmm10) \
+    V(double, xmm11) \
+    V(double, xmm12) \
+    V(double, xmm13) \
+    V(double, xmm14) \
+    V(double, xmm15)
</ins><span class="cx"> 
</span><span class="cx"> #endif // CPU(X86_64)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubsX86h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubsX86.h (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubsX86.h        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/jit/JITStubsX86.h        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Cameron Zwarich &lt;cwzwarich@uwaterloo.ca&gt;
</span><span class="cx">  * Copyright (C) Research In Motion Limited 2010, 2011. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -95,14 +95,14 @@
</span><span class="cx">     &quot;movl 6 * &quot; STRINGIZE_VALUE_OF(PTR_SIZE) &quot;(%eax), %ecx&quot; &quot;\n&quot;
</span><span class="cx">     &quot;movl %ecx, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_ESP_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
</span><span class="cx"> 
</span><del>-    &quot;movdqa %xmm0, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm1, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm2, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm3, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm4, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm5, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm6, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm7, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
</del><ins>+    &quot;movq %xmm0, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm1, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm2, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm3, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm4, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm5, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm6, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
+    &quot;movq %xmm7, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%ebp)&quot; &quot;\n&quot;
</ins><span class="cx"> 
</span><span class="cx">     // Reserve stack space for the arg while maintaining the required stack
</span><span class="cx">     // pointer 32 byte alignment:
</span><span class="lines">@@ -119,14 +119,14 @@
</span><span class="cx">     &quot;movl &quot; STRINGIZE_VALUE_OF(PROBE_CPU_ESI_OFFSET) &quot;(%ebp), %esi&quot; &quot;\n&quot;
</span><span class="cx">     &quot;movl &quot; STRINGIZE_VALUE_OF(PROBE_CPU_EDI_OFFSET) &quot;(%ebp), %edi&quot; &quot;\n&quot;
</span><span class="cx"> 
</span><del>-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%ebp), %xmm0&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%ebp), %xmm1&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%ebp), %xmm2&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%ebp), %xmm3&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%ebp), %xmm4&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%ebp), %xmm5&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%ebp), %xmm6&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%ebp), %xmm7&quot; &quot;\n&quot;
</del><ins>+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%ebp), %xmm0&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%ebp), %xmm1&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%ebp), %xmm2&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%ebp), %xmm3&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%ebp), %xmm4&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%ebp), %xmm5&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%ebp), %xmm6&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%ebp), %xmm7&quot; &quot;\n&quot;
</ins><span class="cx"> 
</span><span class="cx">     // There are 6 more registers left to restore:
</span><span class="cx">     //     eax, ecx, ebp, esp, eip, and eflags.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubsX86Commonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubsX86Common.h (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubsX86Common.h        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/jit/JITStubsX86Common.h        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 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">@@ -50,39 +50,35 @@
</span><span class="cx"> #define PROBE_ARG1_OFFSET (1 * PTR_SIZE)
</span><span class="cx"> #define PROBE_ARG2_OFFSET (2 * PTR_SIZE)
</span><span class="cx"> 
</span><del>-#define PROBE_CPU_EAX_OFFSET (4 * PTR_SIZE)
-#define PROBE_CPU_EBX_OFFSET (5 * PTR_SIZE)
-#define PROBE_CPU_ECX_OFFSET (6 * PTR_SIZE)
-#define PROBE_CPU_EDX_OFFSET (7 * PTR_SIZE)
-#define PROBE_CPU_ESI_OFFSET (8 * PTR_SIZE)
-#define PROBE_CPU_EDI_OFFSET (9 * PTR_SIZE)
-#define PROBE_CPU_EBP_OFFSET (10 * PTR_SIZE)
-#define PROBE_CPU_ESP_OFFSET (11 * PTR_SIZE)
</del><ins>+#define PROBE_FIRST_GPR_OFFSET (3 * PTR_SIZE)
+#define PROBE_CPU_EAX_OFFSET (PROBE_FIRST_GPR_OFFSET + (0 * PTR_SIZE))
+#define PROBE_CPU_ECX_OFFSET (PROBE_FIRST_GPR_OFFSET + (1 * PTR_SIZE))
+#define PROBE_CPU_EDX_OFFSET (PROBE_FIRST_GPR_OFFSET + (2 * PTR_SIZE))
+#define PROBE_CPU_EBX_OFFSET (PROBE_FIRST_GPR_OFFSET + (3 * PTR_SIZE))
+#define PROBE_CPU_ESP_OFFSET (PROBE_FIRST_GPR_OFFSET + (4 * PTR_SIZE))
+#define PROBE_CPU_EBP_OFFSET (PROBE_FIRST_GPR_OFFSET + (5 * PTR_SIZE))
+#define PROBE_CPU_ESI_OFFSET (PROBE_FIRST_GPR_OFFSET + (6 * PTR_SIZE))
+#define PROBE_CPU_EDI_OFFSET (PROBE_FIRST_GPR_OFFSET + (7 * PTR_SIZE))
</ins><span class="cx"> 
</span><span class="cx"> #if CPU(X86)
</span><del>-#define PROBE_FIRST_SPECIAL_OFFSET (12 * PTR_SIZE)
</del><ins>+#define PROBE_FIRST_SPECIAL_OFFSET (PROBE_FIRST_GPR_OFFSET + (8 * PTR_SIZE))
</ins><span class="cx"> #else // CPU(X86_64)
</span><del>-#define PROBE_CPU_R8_OFFSET (12 * PTR_SIZE)
-#define PROBE_CPU_R9_OFFSET (13 * PTR_SIZE)
-#define PROBE_CPU_R10_OFFSET (14 * PTR_SIZE)
-#define PROBE_CPU_R11_OFFSET (15 * PTR_SIZE)
-#define PROBE_CPU_R12_OFFSET (16 * PTR_SIZE)
-#define PROBE_CPU_R13_OFFSET (17 * PTR_SIZE)
-#define PROBE_CPU_R14_OFFSET (18 * PTR_SIZE)
-#define PROBE_CPU_R15_OFFSET (19 * PTR_SIZE)
-#define PROBE_FIRST_SPECIAL_OFFSET (20 * PTR_SIZE)
</del><ins>+#define PROBE_CPU_R8_OFFSET (PROBE_FIRST_GPR_OFFSET + (8 * PTR_SIZE))
+#define PROBE_CPU_R9_OFFSET (PROBE_FIRST_GPR_OFFSET + (9 * PTR_SIZE))
+#define PROBE_CPU_R10_OFFSET (PROBE_FIRST_GPR_OFFSET + (10 * PTR_SIZE))
+#define PROBE_CPU_R11_OFFSET (PROBE_FIRST_GPR_OFFSET + (11 * PTR_SIZE))
+#define PROBE_CPU_R12_OFFSET (PROBE_FIRST_GPR_OFFSET + (12 * PTR_SIZE))
+#define PROBE_CPU_R13_OFFSET (PROBE_FIRST_GPR_OFFSET + (13 * PTR_SIZE))
+#define PROBE_CPU_R14_OFFSET (PROBE_FIRST_GPR_OFFSET + (14 * PTR_SIZE))
+#define PROBE_CPU_R15_OFFSET (PROBE_FIRST_GPR_OFFSET + (15 * PTR_SIZE))
+#define PROBE_FIRST_SPECIAL_OFFSET (PROBE_FIRST_GPR_OFFSET + (16 * PTR_SIZE))
</ins><span class="cx"> #endif // CPU(X86_64)
</span><span class="cx"> 
</span><span class="cx"> #define PROBE_CPU_EIP_OFFSET (PROBE_FIRST_SPECIAL_OFFSET + (0 * PTR_SIZE))
</span><span class="cx"> #define PROBE_CPU_EFLAGS_OFFSET (PROBE_FIRST_SPECIAL_OFFSET + (1 * PTR_SIZE))
</span><ins>+#define PROBE_FIRST_XMM_OFFSET (PROBE_FIRST_SPECIAL_OFFSET + (2 * PTR_SIZE))
</ins><span class="cx"> 
</span><del>-#if CPU(X86)
-#define PROBE_FIRST_XMM_OFFSET (PROBE_FIRST_SPECIAL_OFFSET + (4 * PTR_SIZE)) // After padding.
-#else // CPU(X86_64)
-#define PROBE_FIRST_XMM_OFFSET (PROBE_FIRST_SPECIAL_OFFSET + (2 * PTR_SIZE)) // After padding.
-#endif // CPU(X86_64)
-
-#define XMM_SIZE 16
</del><ins>+#define XMM_SIZE 8
</ins><span class="cx"> #define PROBE_CPU_XMM0_OFFSET (PROBE_FIRST_XMM_OFFSET + (0 * XMM_SIZE))
</span><span class="cx"> #define PROBE_CPU_XMM1_OFFSET (PROBE_FIRST_XMM_OFFSET + (1 * XMM_SIZE))
</span><span class="cx"> #define PROBE_CPU_XMM2_OFFSET (PROBE_FIRST_XMM_OFFSET + (2 * XMM_SIZE))
</span><span class="lines">@@ -92,7 +88,19 @@
</span><span class="cx"> #define PROBE_CPU_XMM6_OFFSET (PROBE_FIRST_XMM_OFFSET + (6 * XMM_SIZE))
</span><span class="cx"> #define PROBE_CPU_XMM7_OFFSET (PROBE_FIRST_XMM_OFFSET + (7 * XMM_SIZE))
</span><span class="cx"> 
</span><ins>+#if CPU(X86)
</ins><span class="cx"> #define PROBE_SIZE (PROBE_CPU_XMM7_OFFSET + XMM_SIZE)
</span><ins>+#else // CPU(X86_64)
+#define PROBE_CPU_XMM8_OFFSET (PROBE_FIRST_XMM_OFFSET + (8 * XMM_SIZE))
+#define PROBE_CPU_XMM9_OFFSET (PROBE_FIRST_XMM_OFFSET + (9 * XMM_SIZE))
+#define PROBE_CPU_XMM10_OFFSET (PROBE_FIRST_XMM_OFFSET + (10 * XMM_SIZE))
+#define PROBE_CPU_XMM11_OFFSET (PROBE_FIRST_XMM_OFFSET + (11 * XMM_SIZE))
+#define PROBE_CPU_XMM12_OFFSET (PROBE_FIRST_XMM_OFFSET + (12 * XMM_SIZE))
+#define PROBE_CPU_XMM13_OFFSET (PROBE_FIRST_XMM_OFFSET + (13 * XMM_SIZE))
+#define PROBE_CPU_XMM14_OFFSET (PROBE_FIRST_XMM_OFFSET + (14 * XMM_SIZE))
+#define PROBE_CPU_XMM15_OFFSET (PROBE_FIRST_XMM_OFFSET + (15 * XMM_SIZE))
+#define PROBE_SIZE (PROBE_CPU_XMM15_OFFSET + XMM_SIZE)
+#endif // CPU(X86_64)
</ins><span class="cx"> 
</span><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="lines">@@ -132,11 +140,19 @@
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm6) == PROBE_CPU_XMM6_OFFSET, ProbeContext_cpu_xmm6_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm7) == PROBE_CPU_XMM7_OFFSET, ProbeContext_cpu_xmm7_offset_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> 
</span><ins>+#if CPU(X86_64)
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm8) == PROBE_CPU_XMM8_OFFSET, ProbeContext_cpu_xmm8_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm9) == PROBE_CPU_XMM9_OFFSET, ProbeContext_cpu_xmm9_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm10) == PROBE_CPU_XMM10_OFFSET, ProbeContext_cpu_xmm10_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm11) == PROBE_CPU_XMM11_OFFSET, ProbeContext_cpu_xmm11_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm12) == PROBE_CPU_XMM12_OFFSET, ProbeContext_cpu_xmm12_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm13) == PROBE_CPU_XMM13_OFFSET, ProbeContext_cpu_xmm13_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm14) == PROBE_CPU_XMM14_OFFSET, ProbeContext_cpu_xmm14_offset_matches_ctiMasmProbeTrampoline);
+COMPILE_ASSERT(PROBE_OFFSETOF(cpu.xmm15) == PROBE_CPU_XMM15_OFFSET, ProbeContext_cpu_xmm15_offset_matches_ctiMasmProbeTrampoline);
+#endif // CPU(X86_64)
+
</ins><span class="cx"> COMPILE_ASSERT(sizeof(MacroAssembler::ProbeContext) == PROBE_SIZE, ProbeContext_size_matches_ctiMasmProbeTrampoline);
</span><span class="cx"> 
</span><del>-// Also double check that the xmm registers are 16 byte (128-bit) aligned as
-// required by the movdqa instruction used in the trampoline.
-COMPILE_ASSERT(!(PROBE_OFFSETOF(cpu.xmm0) % 16), ProbeContext_xmm0_offset_not_aligned_properly);
</del><span class="cx"> #undef PROBE_OFFSETOF
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(MASM_PROBE)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITStubsX86_64h"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h (176094 => 176095)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h        2014-11-13 22:59:04 UTC (rev 176094)
+++ trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h        2014-11-13 23:00:07 UTC (rev 176095)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2013, 2014 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Cameron Zwarich &lt;cwzwarich@uwaterloo.ca&gt;
</span><span class="cx">  * Copyright (C) Research In Motion Limited 2010, 2011. All rights reserved.
</span><span class="cx">  *
</span><span class="lines">@@ -104,14 +104,22 @@
</span><span class="cx">     &quot;movq %r14, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_R14_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
</span><span class="cx">     &quot;movq %r15, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_R15_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
</span><span class="cx"> 
</span><del>-    &quot;movdqa %xmm0, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm1, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm2, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm3, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm4, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm5, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm6, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
-    &quot;movdqa %xmm7, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
</del><ins>+    &quot;movq %xmm0, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm1, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm2, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm3, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm4, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm5, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm6, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm7, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm8, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM8_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm9, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM9_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm10, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM10_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm11, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM11_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm12, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM12_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm13, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM13_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm14, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM14_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
+    &quot;movq %xmm15, &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM15_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
</ins><span class="cx"> 
</span><span class="cx">     &quot;movq %rbp, %rdi&quot; &quot;\n&quot; // the ProbeContext* arg.
</span><span class="cx">     &quot;call *&quot; STRINGIZE_VALUE_OF(PROBE_PROBE_FUNCTION_OFFSET) &quot;(%rbp)&quot; &quot;\n&quot;
</span><span class="lines">@@ -133,14 +141,22 @@
</span><span class="cx">     &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_R14_OFFSET) &quot;(%rbp), %r14&quot; &quot;\n&quot;
</span><span class="cx">     &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_R15_OFFSET) &quot;(%rbp), %r15&quot; &quot;\n&quot;
</span><span class="cx"> 
</span><del>-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%rbp), %xmm0&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%rbp), %xmm1&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%rbp), %xmm2&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%rbp), %xmm3&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%rbp), %xmm4&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%rbp), %xmm5&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%rbp), %xmm6&quot; &quot;\n&quot;
-    &quot;movdqa &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%rbp), %xmm7&quot; &quot;\n&quot;
</del><ins>+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM0_OFFSET) &quot;(%rbp), %xmm0&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM1_OFFSET) &quot;(%rbp), %xmm1&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM2_OFFSET) &quot;(%rbp), %xmm2&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM3_OFFSET) &quot;(%rbp), %xmm3&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM4_OFFSET) &quot;(%rbp), %xmm4&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM5_OFFSET) &quot;(%rbp), %xmm5&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM6_OFFSET) &quot;(%rbp), %xmm6&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM7_OFFSET) &quot;(%rbp), %xmm7&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM8_OFFSET) &quot;(%rbp), %xmm8&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM9_OFFSET) &quot;(%rbp), %xmm9&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM10_OFFSET) &quot;(%rbp), %xmm10&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM11_OFFSET) &quot;(%rbp), %xmm11&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM12_OFFSET) &quot;(%rbp), %xmm12&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM13_OFFSET) &quot;(%rbp), %xmm13&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM14_OFFSET) &quot;(%rbp), %xmm14&quot; &quot;\n&quot;
+    &quot;movq &quot; STRINGIZE_VALUE_OF(PROBE_CPU_XMM15_OFFSET) &quot;(%rbp), %xmm15&quot; &quot;\n&quot;
</ins><span class="cx"> 
</span><span class="cx">     // There are 6 more registers left to restore:
</span><span class="cx">     //     rax, rcx, rbp, rsp, rip, and rflags.
</span></span></pre>
</div>
</div>

</body>
</html>