[foreign-memaccess+abi] RFR: Prevent maxAlign virtual calls for polluted accesses [v2]

Radoslaw Smogura duke at openjdk.org
Tue Aug 16 19:25:54 UTC 2022


On Mon, 15 Aug 2022 19:23:42 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Thanks for the experiment - that seems a better way to handle this situation, but I'll leave further comments to @PaulSandoz or @iwanowww.
>
> Expanding the profiling to for method names starting with "loadFrom" and "storeInto" seems reasonable, given the most other access methods are also profiled (although not all the read-modify-write methods are).
> 
> I think we should separate out the comparison of method names thereby we don't inadvertently profile other methods just in case new methods get added. Plus we can add some comments to the class doc of `Unsafe` and `ScopedMemoryAccess` to indicate such methods are profiled. Ideally I would prefer an HotSpot-specific annotation indicated that all arguments of an annotated method should be profiled.
>  
> The profiling of all arguments is a blunter hammer that necessary in this case but so be it.

Adding annotation for this could be useful for profiling other methods too. I'll try to find some time and prepare some draft.

One thing I see that adding such annotation could consume one bit here (still there will be 5 spare): 
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/method.hpp#L98

-------------

PR: https://git.openjdk.org/panama-foreign/pull/700


More information about the panama-dev mailing list