dotnet / corert

This repo contains CoreRT, an experimental .NET Core runtime optimized for AOT (ahead of time compilation) scenarios, with the accompanying compiler toolchain.
http://dot.net
MIT License
2.91k stars 508 forks source link

ARM64: RhpGcPoll #8343

Closed RalfKornmannEnvision closed 4 years ago

RalfKornmannEnvision commented 4 years ago
jkotas commented 4 years ago

I think it would best to port just the few functions for GcPoll and leave the GC stress infrastructure out. The GC stress infrastructure was specific to .NET Native for UWP codegen. We did not make it work with RyuJIT codegen - RyuJIT does GC stress very differently, so it will need to be redone for that.

RalfKornmannEnvision commented 4 years ago

So it's, just RhpGcPoll and RhpGcPollRare?

There ist although RhpGcProbe & RhpGcProbeRare in this file but I could not find any reference to these.

jkotas commented 4 years ago

So it's, just RhpGcPoll and RhpGcPollRare?

Yes, that should be it.

jkotas commented 4 years ago

Are you able to hit RhpGcPoll in a test program? I am not able to write a test to hit it. I think we may have a bug in the handling of SuppressGCTransitionAttribute.

RalfKornmannEnvision commented 4 years ago

Yes, that was the reason why I even started to implement it. In general I try to avoid adding implementing things that I cannot test or are not needed yet

S_P_CoreLib_Interop_Sys__GetTimestamp:
0x0000002d7901b710 stp x29, x30, [sp, #-48]!
0x0000002d7901b714 mov x29, sp
0x0000002d7901b718 str xzr, [x29, #40]
0x0000002d7901b71c str xzr, [x29, #32]
0x0000002d7901b720 bl 0x2d78e0e9c0 <RhpGcPoll()>
0x0000002d7901b724 bl 0x2d78d7a030 SystemNative_GetTimestamp@plt 

And this function is called all the time as soon as a thread pool is running. 

jkotas commented 4 years ago

Thanks!

jkotas commented 4 years ago

there seems to be more problems with SuppressGCTransitionAttribute - I will take a look at those.

https://github.com/dotnet/runtimelab/pull/139