Bug 1530844 - Make push/pop pair for ecx conditional on previous ecx content r=mgaudet
authorkellykc72 <kellykc72@gmail.com>
Tue, 12 Mar 2019 13:11:19 +0000
changeset 521523 5ec94981916f0660a2cd2348ef41a10ffc4fca93
parent 521522 68d86a52738530fd10d3e0fd9b4dd0b270c89b81
child 521524 4d440c866f4440ff1456835a6836383120d9ed45
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1530844
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530844 - Make push/pop pair for ecx conditional on previous ecx content r=mgaudet The ECX register must contain the SHIFT amount. Before this change, ECX will always be push/pop during a SHIFT operation. However, ECX should only be push/pop if it's original contents are going to be overwritten. We now only push/pop ECX if it contains some arbituary value and hence will be overwritten by the SHIFT operation. Differential Revision: https://phabricator.services.mozilla.com/D22887
js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h
@@ -323,17 +323,20 @@ inline void FlexibleShift32(MacroAssembl
                             bool arithmetic = false) {
   // Choose an arbitrary register that's not ecx
   Register internalSrcDest = (srcDest != ecx) ? srcDest : ebx;
   MOZ_ASSERT(internalSrcDest != ecx);
 
   // Add registers we may clobber and want to ensure are restored as live, and
   // remove what we definitely clobber (the destination)
   LiveRegisterSet preserve;
-  preserve.add(ecx);
+
+  if (shift != ecx) {
+    preserve.add(ecx);
+  }
   preserve.add(internalSrcDest);
 
   preserve.takeUnchecked(srcDest);
 
   // [PUSH]
   masm.PushRegsInMask(preserve);
 
   // [MOVE]