Bug 1447742: Understand movups in 32-bit DLL interceptor. r=handyman
authorDavid Major <dmajor@mozilla.com>
Thu, 22 Mar 2018 14:20:36 -0400
changeset 409490 fe73c0251346959fde93018cef7aab7182e557b7
parent 409489 714385f620c736f6c5c045f06336a88fbdc5591e
child 409491 d3f271715340fe8b6ade42b4c8eca9a3a284e01c
push id101218
push userdmajor@mozilla.com
push dateThu, 22 Mar 2018 18:19:34 +0000
treeherdermozilla-inbound@d3f271715340 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershandyman
bugs1447742
milestone61.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 1447742: Understand movups in 32-bit DLL interceptor. r=handyman
xpcom/build/nsWindowsDllInterceptor.h
--- a/xpcom/build/nsWindowsDllInterceptor.h
+++ b/xpcom/build/nsWindowsDllInterceptor.h
@@ -772,16 +772,28 @@ protected:
         // various MOVs
         ++nOrigBytes;
         int len = CountModRmSib(origBytes + nOrigBytes);
         if (len < 0) {
           MOZ_ASSERT_UNREACHABLE("Unrecognized MOV opcode sequence");
           return;
         }
         nOrigBytes += len;
+      } else if (origBytes[nOrigBytes] == 0x0f &&
+                 (origBytes[nOrigBytes + 1] == 0x10 ||
+                  origBytes[nOrigBytes + 1] == 0x11)) {
+        // SSE: movups xmm, xmm/m128
+        //      movups xmm/m128, xmm
+        nOrigBytes += 2;
+        int len = CountModRmSib(origBytes + nOrigBytes);
+        if (len < 0) {
+          MOZ_ASSERT_UNREACHABLE("Unrecognized MOV opcode sequence");
+          return;
+        }
+        nOrigBytes += len;
       } else if (origBytes[nOrigBytes] == 0xA1) {
         // MOV eax, [seg:offset]
         nOrigBytes += 5;
       } else if (origBytes[nOrigBytes] == 0xB8) {
         // MOV 0xB8: http://ref.x86asm.net/coder32.html#xB8
         nOrigBytes += 5;
       } else if (origBytes[nOrigBytes] == 0x33 &&
                  (origBytes[nOrigBytes+1] & kMaskMod) == kModReg) {
@@ -1257,24 +1269,24 @@ protected:
         } else {
           MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
           return;
         }
       } else if (origBytes[nOrigBytes] == 0x83 &&
                  (origBytes[nOrigBytes + 1] & 0xf8) == 0x60) {
         // and [r+d], imm8
         COPY_CODES(5);
-      } else if (origBytes[nOrigBytes] == 0xc6) {
-        // mov [r+d], imm8
-        int len = CountModRmSib(&origBytes[nOrigBytes + 1]);
-        if (len < 0) {
-          // RIP-relative not yet supported
-          MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
-          return;
-        }
+      } else if (origBytes[nOrigBytes] == 0xc6) {
+        // mov [r+d], imm8
+        int len = CountModRmSib(&origBytes[nOrigBytes + 1]);
+        if (len < 0) {
+          // RIP-relative not yet supported
+          MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
+          return;
+        }
         COPY_CODES(len + 1);
       } else {
         MOZ_ASSERT_UNREACHABLE("Unrecognized opcode sequence");
         return;
       }
     }
 #else
 #error "Unknown processor type"