Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Enable regular GC budget for RyuJIT codegen - #1434

Merged
janvorli merged 5 commits into
dotnet:masterfrom
jkotas:unix-fixes
Jun 26, 2016
Merged

janvorli merged 5 commits into
dotnet:masterfrom
jkotas:unix-fixes

Conversation

@jkotas

@jkotas jkotas commented Jun 24, 2016

Copy link
Copy Markdown
Member

No description provided.

jkotas added 2 commits June 23, 2016 19:10
Addition of OFFSETOF__InterfaceDispatchCache__m_rgEntries was getting dropped by the assembler in the original code for some reason.
@jkotas

jkotas commented Jun 24, 2016

Copy link
Copy Markdown
Member Author

Related to #913

@jkotas

jkotas commented Jun 24, 2016

Copy link
Copy Markdown
Member Author

@janvorli PTLA

FORCEINLINE UInt8 PalInterlockedCompareExchange128(_Inout_ _Interlocked_operand_ Int64 volatile *pDst, Int64 iValueHigh, Int64 iValueLow, Int64 *pComparandAndResult)
{
return __sync_val_compare_and_swap((__int128_t volatile*)pDst, *(__int128_t*)pComparand, ((__int128_t)iValueHigh << 64) + iValueLow);
__int128_t iComparand = ((__int128_t)pComparandAndResult[1] << 64) + (UInt64)pComparandAndResult[0];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why cannot we just cast the pComparandAndResult to __int128_t* for both the __sync_val_compare_and_swap and the assignment after that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change to make the code more portable while I was on it. The compiler may assume that __int128_t* pointer is aligned and take advantage of it. We do not guarantee this alignment for the pComparandAndResult argument.

It does not actually make a difference today. The optimized code on x64 is same both with casts and shifts.

@janvorli

Copy link
Copy Markdown
Member

LGTM

@janvorli
janvorli merged commit 1ded7c6 into dotnet:master Jun 26, 2016
@jkotas
jkotas deleted the unix-fixes branch July 23, 2016 14:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants