RFR: thaw_kind cleanup

Coleen Phillimore coleenp at openjdk.java.net
Thu Apr 28 12:57:53 UTC 2022


On Wed, 27 Apr 2022 18:36:19 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> In continuationFreezeThaw.cpp, the following enum is declared:
> enum thaw_kind {
>   thaw_top = 0,
>   thaw_return_barrier = 1,
>   thaw_exception = 2,
> };
> 
> thaw_kind being declared in a .cpp file, it cannot be exported to other files. The consequence of that is that in the assembly code preparing the argument for the thaw() method, hard coded values are used instead of values from the enum:
>     if (exception)           __ movl(c_rarg1, (int32_t)2);
>     else if (return_barrier) __ movl(c_rarg1, (int32_t)1);
>     else                     __ movl(c_rarg1, (int32_t)0);
> 
> The fix is to move the declaration of thaw_kind to continuation.hpp and use it everywhere instead of using hard coded values.
> 
> Tested with Loom test, tier 1 to 5.
> 
> Thank you,
> 
> Fred

This is a really good change.

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

Marked as reviewed by coleenp (Committer).

PR: https://git.openjdk.java.net/loom/pull/174


More information about the loom-dev mailing list