@@ -3257,7 +3257,10 @@ bool LibraryCallKit::inline_native_getEventWriter() {
3257
3257
set_all_memory (input_memory_state);
3258
3258
Node* input_io_state = i_o ();
3259
3259
3260
- Node* excluded_mask = _gvn.intcon (32768 );
3260
+ // The most significant bit of the u2 is used to denote thread exclusion
3261
+ Node* excluded_shift = _gvn.intcon (15 );
3262
+ Node* excluded_mask = _gvn.intcon (1 << 15 );
3263
+ // The epoch generation is the range [1-32767]
3261
3264
Node* epoch_mask = _gvn.intcon (32767 );
3262
3265
3263
3266
// TLS
@@ -3411,7 +3414,7 @@ bool LibraryCallKit::inline_native_getEventWriter() {
3411
3414
record_for_igvn (vthread_compare_io);
3412
3415
PhiNode* tid = new PhiNode (vthread_compare_rgn, TypeLong::LONG);
3413
3416
record_for_igvn (tid);
3414
- PhiNode* exclusion = new PhiNode (vthread_compare_rgn, TypeInt::BOOL );
3417
+ PhiNode* exclusion = new PhiNode (vthread_compare_rgn, TypeInt::CHAR );
3415
3418
record_for_igvn (exclusion);
3416
3419
PhiNode* pinVirtualThread = new PhiNode (vthread_compare_rgn, TypeInt::BOOL);
3417
3420
record_for_igvn (pinVirtualThread);
@@ -3476,7 +3479,8 @@ bool LibraryCallKit::inline_native_getEventWriter() {
3476
3479
store_to_memory (tid_is_not_equal, event_writer_pin_field, _gvn.transform (pinVirtualThread), T_BOOLEAN, MemNode::unordered);
3477
3480
3478
3481
// Store the exclusion state to the event writer.
3479
- store_to_memory (tid_is_not_equal, event_writer_excluded_field, _gvn.transform (exclusion), T_BOOLEAN, MemNode::unordered);
3482
+ Node* excluded_bool = _gvn.transform (new URShiftINode (_gvn.transform (exclusion), excluded_shift));
3483
+ store_to_memory (tid_is_not_equal, event_writer_excluded_field, excluded_bool, T_BOOLEAN, MemNode::unordered);
3480
3484
3481
3485
// Store the tid to the event writer.
3482
3486
store_to_memory (tid_is_not_equal, event_writer_tid_field, tid, T_LONG, MemNode::unordered);
@@ -3543,7 +3547,9 @@ void LibraryCallKit::extend_setCurrentThread(Node* jt, Node* thread) {
3543
3547
Node* input_memory_state = reset_memory ();
3544
3548
set_all_memory (input_memory_state);
3545
3549
3546
- Node* excluded_mask = _gvn.intcon (32768 );
3550
+ // The most significant bit of the u2 is used to denote thread exclusion
3551
+ Node* excluded_mask = _gvn.intcon (1 << 15 );
3552
+ // The epoch generation is the range [1-32767]
3547
3553
Node* epoch_mask = _gvn.intcon (32767 );
3548
3554
3549
3555
Node* const carrierThread = generate_current_thread (jt);
0 commit comments