Fix a bug with cpuid in the FTL.
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 00:35:49 +0000 (00:35 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Nov 2017 00:35:49 +0000 (00:35 +0000)
Rubber stamped by Mark Lam.

Before uploading the previous patch, I tried to condense the code. I
accidentally removed a crucial line saying that CPUID clobbers various
registers.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCPUIntrinsic):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

index b5f834e..b47fa9c 100644 (file)
@@ -1,5 +1,18 @@
 2017-11-16  Saam Barati  <sbarati@apple.com>
 
+        Fix a bug with cpuid in the FTL.
+
+        Rubber stamped by Mark Lam.
+
+        Before uploading the previous patch, I tried to condense the code. I
+        accidentally removed a crucial line saying that CPUID clobbers various
+        registers.
+
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileCPUIntrinsic):
+
+2017-11-16  Saam Barati  <sbarati@apple.com>
+
         Add some X86 intrinsics to $vm to help with some perf testing
         https://bugs.webkit.org/show_bug.cgi?id=179693
 
index d1d55b8..b461163 100644 (file)
@@ -8208,6 +8208,9 @@ private:
         case CPUPauseIntrinsic: {
             PatchpointValue* patchpoint = m_out.patchpoint(Void);
             patchpoint->effects = Effects::forCall();
+            if (intrinsic == CPUCpuidIntrinsic)
+                patchpoint->clobber(RegisterSet { X86Registers::eax, X86Registers::ebx, X86Registers::ecx, X86Registers::edx });
+
             patchpoint->setGenerator([=] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
                 switch (intrinsic) {
                 case CPUMfenceIntrinsic: