@@ -1217,7 +1217,7 @@ static void call_catch_cleanup_one(PhaseIdealLoop* phase, LoadNode* load, Node*
1217
1217
}
1218
1218
1219
1219
// Sort out the loads that are between a call ant its catch blocks
1220
- static void process_catch_cleanup_candidate (PhaseIdealLoop* phase, LoadNode* load) {
1220
+ static void process_catch_cleanup_candidate (PhaseIdealLoop* phase, LoadNode* load, bool verify ) {
1221
1221
bool trace = phase->C ->directive ()->ZTraceLoadBarriersOption ;
1222
1222
1223
1223
Node* ctrl = get_ctrl_normalized (phase, load);
@@ -1228,6 +1228,7 @@ static void process_catch_cleanup_candidate(PhaseIdealLoop* phase, LoadNode* loa
1228
1228
Node* catch_node = ctrl->isa_Proj ()->raw_out (0 );
1229
1229
if (catch_node->is_Catch ()) {
1230
1230
if (catch_node->outcnt () > 1 ) {
1231
+ assert (!verify, " All loads should already have been moved" );
1231
1232
call_catch_cleanup_one (phase, load, ctrl);
1232
1233
} else {
1233
1234
if (trace) tty->print_cr (" Call catch cleanup with only one catch: load %i " , load->_idx );
@@ -1245,6 +1246,7 @@ bool ZBarrierSetC2::optimize_loops(PhaseIdealLoop* phase, LoopOptsMode mode, Vec
1245
1246
if (mode == LoopOptsZBarrierInsertion) {
1246
1247
// First make sure all loads between call and catch are moved to the catch block
1247
1248
clean_catch_blocks (phase);
1249
+ DEBUG_ONLY (clean_catch_blocks (phase, true /* verify */ );)
1248
1250
1249
1251
// Then expand barriers on all loads
1250
1252
insert_load_barriers (phase);
@@ -1398,7 +1400,7 @@ void ZBarrierSetC2::insert_barriers_on_unsafe(PhaseIdealLoop* phase) const {
1398
1400
// Sometimes the loads use will be at a place dominated by all catch blocks, then we need
1399
1401
// a load in each catch block, and a Phi at the dominated use.
1400
1402
1401
- void ZBarrierSetC2::clean_catch_blocks (PhaseIdealLoop* phase) const {
1403
+ void ZBarrierSetC2::clean_catch_blocks (PhaseIdealLoop* phase, bool verify ) const {
1402
1404
1403
1405
Compile *C = phase->C ;
1404
1406
uint new_ids = C->unique ();
@@ -1425,7 +1427,7 @@ void ZBarrierSetC2::clean_catch_blocks(PhaseIdealLoop* phase) const {
1425
1427
LoadNode* load = n->isa_Load ();
1426
1428
// only care about loads that will have a barrier
1427
1429
if (load_require_barrier (load)) {
1428
- process_catch_cleanup_candidate (phase, load);
1430
+ process_catch_cleanup_candidate (phase, load, verify );
1429
1431
}
1430
1432
}
1431
1433
}
0 commit comments