RFR: thaw_kind cleanup

Frederic Parain fparain at openjdk.java.net
Wed Apr 27 18:46:34 UTC 2022


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

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

Commit messages:
 - Merge remote-tracking branch 'upstream/fibers' into thaw_kind_move
 - thaw_kind cleanup

Changes: https://git.openjdk.java.net/loom/pull/174/files
 Webrev: https://webrevs.openjdk.java.net/?repo=loom&pr=174&range=00
  Stats: 28 lines in 4 files changed: 9 ins; 6 del; 13 mod
  Patch: https://git.openjdk.java.net/loom/pull/174.diff
  Fetch: git fetch https://git.openjdk.java.net/loom pull/174/head:pull/174

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


More information about the loom-dev mailing list