Skip to content

Commit 98f204b

Browse files
authored
Delete IA64-specific comment and associated code (#121226)
1 parent 15f209b commit 98f204b

File tree

14 files changed

+31
-226
lines changed

14 files changed

+31
-226
lines changed

src/coreclr/vm/amd64/cgenamd64.cpp

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -279,47 +279,9 @@ void HijackFrame::UpdateRegDisplay_Impl(const PREGDISPLAY pRD, bool updateFloats
279279
}
280280
#endif // FEATURE_HIJACK
281281

282-
BOOL isJumpRel32(PCODE pCode)
282+
bool isBackToBackJump(PCODE pCode)
283283
{
284-
CONTRACTL {
285-
NOTHROW;
286-
GC_NOTRIGGER;
287-
SUPPORTS_DAC;
288-
} CONTRACTL_END;
289-
290-
PTR_BYTE pbCode = PTR_BYTE(pCode);
291-
292-
return 0xE9 == pbCode[0];
293-
}
294-
295-
//
296-
// Given the same pBuffer that was used by emitJump this
297-
// method decodes the instructions and returns the jump target
298-
//
299-
PCODE decodeJump32(PCODE pBuffer)
300-
{
301-
CONTRACTL
302-
{
303-
NOTHROW;
304-
GC_NOTRIGGER;
305-
SUPPORTS_DAC;
306-
}
307-
CONTRACTL_END;
308-
309-
// jmp rel32
310-
_ASSERTE(isJumpRel32(pBuffer));
311-
312-
return rel32Decode(pBuffer+1);
313-
}
314-
315-
BOOL isJumpRel64(PCODE pCode)
316-
{
317-
CONTRACTL {
318-
NOTHROW;
319-
GC_NOTRIGGER;
320-
SUPPORTS_DAC;
321-
} CONTRACTL_END;
322-
284+
LIMITED_METHOD_CONTRACT;
323285
PTR_BYTE pbCode = PTR_BYTE(pCode);
324286

325287
return 0x48 == pbCode[0] &&
@@ -328,19 +290,13 @@ BOOL isJumpRel64(PCODE pCode)
328290
0xE0 == pbCode[11];
329291
}
330292

331-
PCODE decodeJump64(PCODE pBuffer)
293+
PCODE decodeBackToBackJump(PCODE pBuffer)
332294
{
333-
CONTRACTL
334-
{
335-
NOTHROW;
336-
GC_NOTRIGGER;
337-
SUPPORTS_DAC;
338-
}
339-
CONTRACTL_END;
295+
LIMITED_METHOD_CONTRACT;
340296

341297
// mov rax, xxx
342298
// jmp rax
343-
_ASSERTE(isJumpRel64(pBuffer));
299+
_ASSERTE(isBackToBackJump(pBuffer));
344300

345301
return *PTR_UINT64(pBuffer+2);
346302
}
@@ -353,11 +309,11 @@ BOOL GetAnyThunkTarget (CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc)
353309
*pTargetMethodDesc = (TADDR)NULL;
354310

355311
//
356-
// Check for something generated by emitJump.
312+
// Check for something generated by emitBackToBackJump.
357313
//
358-
if (isJumpRel64(pThunk))
314+
if (isBackToBackJump(pThunk))
359315
{
360-
*pTarget = decodeJump64(pThunk);
316+
*pTarget = decodeBackToBackJump(pThunk);
361317
return TRUE;
362318
}
363319

@@ -368,12 +324,6 @@ BOOL GetAnyThunkTarget (CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc)
368324

369325
#ifndef DACCESS_COMPILE
370326

371-
// Note: This is only used on server GC on Windows.
372-
//
373-
// This function returns the number of logical processors on a given physical chip. If it cannot
374-
// determine the number of logical cpus, or the machine is not populated uniformly with the same
375-
// type of processors, this function returns 1.
376-
377327
void EncodeLoadAndJumpThunk (LPBYTE pBuffer, LPVOID pv, LPVOID pTarget)
378328
{
379329
CONTRACTL
@@ -444,7 +394,7 @@ void emitCOMStubCall (ComCallMethodDesc *pCOMMethodRX, ComCallMethodDesc *pCOMMe
444394
RETURN;
445395
}
446396

447-
void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
397+
void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
448398
{
449399
CONTRACTL
450400
{

src/coreclr/vm/amd64/cgencpu.h

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -508,39 +508,10 @@ INT32 rel32UsingPreallocatedJumpStub(INT32 UNALIGNED * pRel32, PCODE target, PCO
508508

509509
void emitCOMStubCall (ComCallMethodDesc *pCOMMethodRX, ComCallMethodDesc *pCOMMethodRW, PCODE target);
510510

511-
void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target);
511+
void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target);
512512

513-
BOOL isJumpRel32(PCODE pCode);
514-
PCODE decodeJump32(PCODE pCode);
515-
516-
BOOL isJumpRel64(PCODE pCode);
517-
PCODE decodeJump64(PCODE pCode);
518-
519-
//
520-
// On IA64 back to back jumps should be separated by a nop bundle to get
521-
// the best performance from the hardware's branch prediction logic.
522-
// For all other platforms back to back jumps don't require anything special
523-
// That is why we have these two wrapper functions that call emitJump and decodeJump
524-
//
525-
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
526-
{
527-
WRAPPER_NO_CONTRACT;
528-
529-
emitJump(pBufferRX, pBufferRW, target);
530-
}
531-
532-
inline PCODE decodeBackToBackJump(PCODE pCode)
533-
{
534-
WRAPPER_NO_CONTRACT;
535-
SUPPORTS_DAC;
536-
if (isJumpRel32(pCode))
537-
return decodeJump32(pCode);
538-
else
539-
if (isJumpRel64(pCode))
540-
return decodeJump64(pCode);
541-
else
542-
return (PCODE)0;
543-
}
513+
bool isBackToBackJump(PCODE pCode);
514+
PCODE decodeBackToBackJump(PCODE pCode);
544515

545516
extern "C" void setFPReturn(int fpSize, INT64 retVal);
546517
extern "C" void getFPReturn(int fpSize, INT64 *retval);

src/coreclr/vm/arm/cgencpu.h

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ inline int16_t decodeUnconditionalBranchThumb(LPBYTE pBuffer)
332332
}
333333

334334
//------------------------------------------------------------------------
335-
inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
335+
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
336336
{
337337
LIMITED_METHOD_CONTRACT;
338338

@@ -347,9 +347,9 @@ inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
347347
}
348348

349349
//------------------------------------------------------------------------
350-
// Given the same pBuffer that was used by emitJump this method
350+
// Given the same pBuffer that was used by emitBackToBackJump this method
351351
// decodes the instructions and returns the jump target
352-
inline PCODE decodeJump(PCODE pCode)
352+
inline PCODE decodeBackToBackJump(PCODE pCode)
353353
{
354354
LIMITED_METHOD_CONTRACT;
355355

@@ -358,27 +358,6 @@ inline PCODE decodeJump(PCODE pCode)
358358
return *dac_cast<PTR_PCODE>(pInstr + sizeof(DWORD));
359359
}
360360

361-
//
362-
// On IA64 back to back jumps should be separated by a nop bundle to get
363-
// the best performance from the hardware's branch prediction logic.
364-
// For all other platforms back to back jumps don't require anything special
365-
// That is why we have these two wrapper functions that call emitJump and decodeJump
366-
//
367-
368-
//------------------------------------------------------------------------
369-
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
370-
{
371-
WRAPPER_NO_CONTRACT;
372-
emitJump(pBufferRX, pBufferRW, target);
373-
}
374-
375-
//------------------------------------------------------------------------
376-
inline PCODE decodeBackToBackJump(PCODE pBuffer)
377-
{
378-
WRAPPER_NO_CONTRACT;
379-
return decodeJump(pBuffer);
380-
}
381-
382361
//----------------------------------------------------------------------
383362
#include "stublink.h"
384363

src/coreclr/vm/arm64/cgencpu.h

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ inline BOOL ClrFlushInstructionCache(LPCVOID pCodeAddr, size_t sizeOfCode, bool
353353
}
354354

355355
//------------------------------------------------------------------------
356-
inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
356+
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
357357
{
358358
LIMITED_METHOD_CONTRACT;
359359
UINT32* pCode = (UINT32*)pBufferRW;
@@ -376,9 +376,9 @@ inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
376376
}
377377

378378
//------------------------------------------------------------------------
379-
// Given the same pBuffer that was used by emitJump this method
379+
// Given the same pBuffer that was used by emitBackToBackJump this method
380380
// decodes the instructions and returns the jump target
381-
inline PCODE decodeJump(PCODE pCode)
381+
inline PCODE decodeBackToBackJump(PCODE pCode)
382382
{
383383
LIMITED_METHOD_CONTRACT;
384384

@@ -387,20 +387,6 @@ inline PCODE decodeJump(PCODE pCode)
387387
return *dac_cast<PTR_PCODE>(pInstr + 2*sizeof(DWORD));
388388
}
389389

390-
//------------------------------------------------------------------------
391-
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
392-
{
393-
WRAPPER_NO_CONTRACT;
394-
emitJump(pBufferRX, pBufferRW, target);
395-
}
396-
397-
//------------------------------------------------------------------------
398-
inline PCODE decodeBackToBackJump(PCODE pBuffer)
399-
{
400-
WRAPPER_NO_CONTRACT;
401-
return decodeJump(pBuffer);
402-
}
403-
404390
//----------------------------------------------------------------------
405391

406392
struct IntReg

src/coreclr/vm/arm64/stubs.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -585,14 +585,6 @@ LONG CLRNoCatchHandler(EXCEPTION_POINTERS* pExceptionInfo, PVOID pv)
585585
return EXCEPTION_CONTINUE_SEARCH;
586586
}
587587

588-
#ifdef DACCESS_COMPILE
589-
BOOL GetAnyThunkTarget (T_CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc)
590-
{
591-
_ASSERTE(!"ARM64:NYI");
592-
return FALSE;
593-
}
594-
#endif // DACCESS_COMPILE
595-
596588
#ifndef DACCESS_COMPILE
597589
// ----------------------------------------------------------------
598590
// StubLinkerCPU methods

src/coreclr/vm/codeman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ HeapList* LoaderCodeHeap::CreateCodeHeap(CodeHeapRequestInfo *pInfo, LoaderHeap
24282428
if (pHp->CLRPersonalityRoutine != NULL)
24292429
{
24302430
ExecutableWriterHolder<BYTE> personalityRoutineWriterHolder(pHp->CLRPersonalityRoutine, 12);
2431-
emitJump(pHp->CLRPersonalityRoutine, personalityRoutineWriterHolder.GetRW(), (void *)ProcessCLRException);
2431+
emitBackToBackJump(pHp->CLRPersonalityRoutine, personalityRoutineWriterHolder.GetRW(), (void *)ProcessCLRException);
24322432
}
24332433
#endif // TARGET_64BIT
24342434

src/coreclr/vm/dynamicmethod.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ HeapList* HostCodeHeap::InitializeHeapList(CodeHeapRequestInfo *pInfo)
474474
if (pHp->CLRPersonalityRoutine != NULL)
475475
{
476476
ExecutableWriterHolder<BYTE> personalityRoutineWriterHolder(pHp->CLRPersonalityRoutine, 12);
477-
emitJump(pHp->CLRPersonalityRoutine, personalityRoutineWriterHolder.GetRW(), (void *)ProcessCLRException);
477+
emitBackToBackJump(pHp->CLRPersonalityRoutine, personalityRoutineWriterHolder.GetRW(), (void *)ProcessCLRException);
478478
}
479479
#endif
480480

src/coreclr/vm/i386/cgencpu.h

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ inline BOOL isCallRegisterIndirect(const BYTE *pRetAddr)
367367
}
368368

369369
//------------------------------------------------------------------------
370-
inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
370+
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
371371
{
372372
LIMITED_METHOD_CONTRACT;
373373

@@ -385,36 +385,15 @@ inline void emitJumpInd(LPBYTE pBuffer, LPVOID target)
385385
}
386386

387387
//------------------------------------------------------------------------
388-
// Given the same pBuffer that was used by emitJump this method
388+
// Given the same pBuffer that was used by emitBackToBackJump this method
389389
// decodes the instructions and returns the jump target
390-
inline PCODE decodeJump(PCODE pCode)
390+
inline PCODE decodeBackToBackJump(PCODE pCode)
391391
{
392392
LIMITED_METHOD_DAC_CONTRACT;
393393
CONSISTENCY_CHECK(*PTR_BYTE(pCode) == X86_INSTR_JMP_REL32);
394394
return rel32Decode(pCode+1);
395395
}
396396

397-
//
398-
// On IA64 back to back jumps should be separated by a nop bundle to get
399-
// the best performance from the hardware's branch prediction logic.
400-
// For all other platforms back to back jumps don't require anything special
401-
// That is why we have these two wrapper functions that call emitJump and decodeJump
402-
//
403-
404-
//------------------------------------------------------------------------
405-
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
406-
{
407-
WRAPPER_NO_CONTRACT;
408-
emitJump(pBufferRX, pBufferRW, target);
409-
}
410-
411-
//------------------------------------------------------------------------
412-
inline PCODE decodeBackToBackJump(PCODE pBuffer)
413-
{
414-
WRAPPER_NO_CONTRACT;
415-
SUPPORTS_DAC;
416-
return decodeJump(pBuffer);
417-
}
418397

419398
EXTERN_C void __stdcall setFPReturn(int fpSize, INT64 retVal);
420399
EXTERN_C void __stdcall getFPReturn(int fpSize, INT64 *pretval);

src/coreclr/vm/loongarch64/cgencpu.h

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ inline BOOL ClrFlushInstructionCache(LPCVOID pCodeAddr, size_t sizeOfCode, bool
293293
}
294294

295295
//------------------------------------------------------------------------
296-
inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
296+
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
297297
{
298298
LIMITED_METHOD_CONTRACT;
299299
UINT32* pCode = (UINT32*)pBufferRW;
@@ -319,9 +319,9 @@ inline void emitJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
319319
}
320320

321321
//------------------------------------------------------------------------
322-
// Given the same pBuffer that was used by emitJump this method
322+
// Given the same pBuffer that was used by emitBackToBackJump this method
323323
// decodes the instructions and returns the jump target
324-
inline PCODE decodeJump(PCODE pCode)
324+
inline PCODE decodeBackToBackJump(PCODE pCode)
325325
{
326326
LIMITED_METHOD_CONTRACT;
327327

@@ -330,21 +330,6 @@ inline PCODE decodeJump(PCODE pCode)
330330
return *dac_cast<PTR_PCODE>(pInstr + 16);
331331
}
332332

333-
//------------------------------------------------------------------------
334-
inline void emitBackToBackJump(LPBYTE pBufferRX, LPBYTE pBufferRW, LPVOID target)
335-
{
336-
WRAPPER_NO_CONTRACT;
337-
emitJump(pBufferRX, pBufferRW, target);
338-
}
339-
340-
//------------------------------------------------------------------------
341-
inline PCODE decodeBackToBackJump(PCODE pBuffer)
342-
{
343-
WRAPPER_NO_CONTRACT;
344-
return decodeJump(pBuffer);
345-
}
346-
347-
348333
//----------------------------------------------------------------------
349334

350335
struct IntReg

src/coreclr/vm/loongarch64/stubs.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,6 @@ int SwitchToNonWriteWatchBarrier(bool isRuntimeSuspended)
679679
}
680680
#endif // FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
681681

682-
#ifdef DACCESS_COMPILE
683-
BOOL GetAnyThunkTarget (T_CONTEXT *pctx, TADDR *pTarget, TADDR *pTargetMethodDesc)
684-
{
685-
_ASSERTE(!"LOONGARCH64:NYI");
686-
return FALSE;
687-
}
688-
#endif // DACCESS_COMPILE
689-
690682
#ifndef DACCESS_COMPILE
691683
// ----------------------------------------------------------------
692684
// StubLinkerCPU methods

0 commit comments

Comments
 (0)