delete superpmi-shared/compileresult.cpp assert on x86. (#19841)
authorSergey Andreenko <seandree@microsoft.com>
Fri, 7 Sep 2018 23:59:10 +0000 (16:59 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Sep 2018 23:59:10 +0000 (16:59 -0700)
* fix emitOutputAM for x86.

* Revert "fix emitOutputAM for x86."

This reverts commit fe5ade83e7c8e1ac1cb4442defdfee1d3a3be3f0.

* delete an assert

* add an assert about slotNum

src/ToolBox/superpmi/superpmi-shared/compileresult.cpp
src/jit/emit.cpp
src/jit/emitxarch.cpp

index 1c714c0..70f54d2 100644 (file)
@@ -672,6 +672,8 @@ void CompileResult::repRecordRelocation(void* location, void* target, WORD fRelo
     value.slotNum    = (DWORD)slotNum;
     value.addlDelta  = (DWORD)addlDelta;
 
+    Assert(value.slotNum == 0);
+
     RecordRelocation->Append(value);
 }
 
@@ -731,10 +733,6 @@ void CompileResult::applyRelocs(unsigned char* block1, ULONG blocksize1, void* o
                              (DWORD)tmp.target);
                     *(DWORD*)address = (DWORD)tmp.target;
                 }
-                if (tmp.addlDelta != 0)
-                    __debugbreak();
-                if (tmp.slotNum != 0)
-                    __debugbreak();
             }
             break;
 #endif // _TARGET_X86_
index f320596..cd733d7 100644 (file)
@@ -7169,6 +7169,8 @@ void emitter::emitRecordRelocation(void* location,            /* IN */
                                    WORD  slotNum /* = 0 */,   /* IN */
                                    INT32 addlDelta /* = 0 */) /* IN */
 {
+    assert(slotNum == 0); // It is unused on all supported platforms.
+
     // If we're an unmatched altjit, don't tell the VM anything. We still record the relocation for
     // late disassembly; maybe we'll need it?
     if (emitComp->info.compMatchedVM)
index 9a6d63f..5add863 100644 (file)
@@ -9526,9 +9526,9 @@ GOT_DSP:
 #ifdef _TARGET_AMD64_
                         // all these opcodes only take a sign-extended 4-byte immediate
                         noway_assert(opsz < 8 || ((int)cval == cval && !addc->cnsReloc));
-#else
+#else  //_TARGET_X86_
                         noway_assert(opsz <= 4);
-#endif
+#endif //_TARGET_X86_
 
                         switch (opsz)
                         {
@@ -10762,9 +10762,9 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
 #ifdef _TARGET_AMD64_
             // all these opcodes only take a sign-extended 4-byte immediate
             noway_assert(opsz < 8 || ((int)cval == cval && !addc->cnsReloc));
-#else
+#else  //_TARGET_X86_
             noway_assert(opsz <= 4);
-#endif
+#endif //_TARGET_X86_
 
             switch (opsz)
             {