Title: [241801] releases/WebKitGTK/webkit-2.24
Revision
241801
Author
[email protected]
Date
2019-02-20 04:44:36 -0800 (Wed, 20 Feb 2019)

Log Message

Merge r241756 - [ARM] Fix crash with sampling profiler
https://bugs.webkit.org/show_bug.cgi?id=194772

Reviewed by Mark Lam.

JSTests:

Do not skip test since crash with sampling profiler is now fixed.

* stress/sampling-profiler-richards.js:

Source/_javascript_Core:

sampling-profiler-richards.js was crashing with an enabled sampling profiler. add32
did not update the stack pointer in a single instruction. The src register was first
moved into the stack pointer, the immediate imm was added in a subsequent instruction.

This was problematic when a signal handler was invoked before applying the immediate,
when the stack pointer is still set to the temporary value. Avoid this by calculating src+imm in
a temporary register and then move it in one go into the stack pointer.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::add32):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog (241800 => 241801)


--- releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog	2019-02-20 12:44:31 UTC (rev 241800)
+++ releases/WebKitGTK/webkit-2.24/JSTests/ChangeLog	2019-02-20 12:44:36 UTC (rev 241801)
@@ -1,3 +1,14 @@
+2019-02-18  Dominik Infuehr  <[email protected]>
+
+        [ARM] Fix crash with sampling profiler
+        https://bugs.webkit.org/show_bug.cgi?id=194772
+
+        Reviewed by Mark Lam.
+
+        Do not skip test since crash with sampling profiler is now fixed.
+
+        * stress/sampling-profiler-richards.js:
+
 2019-02-18  Yusuke Suzuki  <[email protected]>
 
         [JSC] Add LazyClassStructure::getInitializedOnMainThread

Modified: releases/WebKitGTK/webkit-2.24/JSTests/stress/sampling-profiler-richards.js (241800 => 241801)


--- releases/WebKitGTK/webkit-2.24/JSTests/stress/sampling-profiler-richards.js	2019-02-20 12:44:31 UTC (rev 241800)
+++ releases/WebKitGTK/webkit-2.24/JSTests/stress/sampling-profiler-richards.js	2019-02-20 12:44:36 UTC (rev 241801)
@@ -1,6 +1,4 @@
-// [JSC] [Armv7] stress/sampling-profiler-richards.js crashes
-// https://bugs.webkit.org/show_bug.cgi?id=190426
-//@ skip if ["arm", "mips"].include?($architecture) and $hostOS == "linux"
+//@ skip if $architecture == "mips" and $hostOS == "linux"
 //@ skip if $architecture == "x86"
 //@ runDefault("--collectContinuously=1", "--useSamplingProfiler=1", "--collectSamplingProfilerDataForJSCShell=1")
 

Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog (241800 => 241801)


--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog	2019-02-20 12:44:31 UTC (rev 241800)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/ChangeLog	2019-02-20 12:44:36 UTC (rev 241801)
@@ -1,3 +1,21 @@
+2019-02-18  Dominik Infuehr  <[email protected]>
+
+        [ARM] Fix crash with sampling profiler
+        https://bugs.webkit.org/show_bug.cgi?id=194772
+
+        Reviewed by Mark Lam.
+
+        sampling-profiler-richards.js was crashing with an enabled sampling profiler. add32
+        did not update the stack pointer in a single instruction. The src register was first
+        moved into the stack pointer, the immediate imm was added in a subsequent instruction.
+
+        This was problematic when a signal handler was invoked before applying the immediate,
+        when the stack pointer is still set to the temporary value. Avoid this by calculating src+imm in
+        a temporary register and then move it in one go into the stack pointer.
+
+        * assembler/MacroAssemblerARMv7.h:
+        (JSC::MacroAssemblerARMv7::add32):
+
 2019-02-18  Mark Lam  <[email protected]>
 
         Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/GreaterEq and CompareStrictEq nodes.

Modified: releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/assembler/MacroAssemblerARMv7.h (241800 => 241801)


--- releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/assembler/MacroAssemblerARMv7.h	2019-02-20 12:44:31 UTC (rev 241800)
+++ releases/WebKitGTK/webkit-2.24/Source/_javascript_Core/assembler/MacroAssemblerARMv7.h	2019-02-20 12:44:36 UTC (rev 241801)
@@ -177,15 +177,15 @@
 
     void add32(TrustedImm32 imm, RegisterID src, RegisterID dest)
     {
-        ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
-
-        // For adds with stack pointer destination, moving the src first to sp is
-        // needed to avoid unpredictable instruction
+        // For adds with stack pointer destination avoid unpredictable instruction
         if (dest == ARMRegisters::sp && src != dest) {
-            move(src, ARMRegisters::sp);
-            src = ""
+            add32(imm, src, dataTempRegister);
+            move(dataTempRegister, dest);
+            return;
         }
 
+        ARMThumbImmediate armImm = ARMThumbImmediate::makeUInt12OrEncodedImm(imm.m_value);
+
         if (armImm.isValid())
             m_assembler.add(dest, src, armImm);
         else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to