1443 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
1444 Node* u = n->fast_out(i);
1445 if (u->is_LoadBarrier()) {
1446 } else if ((u->is_Phi() || u->is_CMove()) && !post_parse) {
1447 if (!look_for_barrier(u, post_parse, visited)) {
1448 return false;
1449 }
1450 } else if (u->Opcode() == Op_EncodeP || u->Opcode() == Op_DecodeN) {
1451 if (!look_for_barrier(u, post_parse, visited)) {
1452 return false;
1453 }
1454 } else if (u->Opcode() != Op_SCMemProj) {
1455 tty->print("bad use"); u->dump();
1456 return false;
1457 }
1458 }
1459
1460 return true;
1461 }
1462
1463 void ZBarrierSetC2::verify_gc_barriers(bool post_parse) const {
1464 ZBarrierSetC2State* s = state();
1465 Compile* C = Compile::current();
1466 ResourceMark rm;
1467 VectorSet visited(Thread::current()->resource_area());
1468 for (int i = 0; i < s->load_barrier_count(); i++) {
1469 LoadBarrierNode* n = s->load_barrier_node(i);
1470
1471 // The dominating barrier on the same address if it exists and
1472 // this barrier must not be applied on the value from the same
1473 // load otherwise the value is not reloaded before it's used the
1474 // second time.
1475 assert(n->in(LoadBarrierNode::Similar)->is_top() ||
1476 (n->in(LoadBarrierNode::Similar)->in(0)->is_LoadBarrier() &&
1477 n->in(LoadBarrierNode::Similar)->in(0)->in(LoadBarrierNode::Address) == n->in(LoadBarrierNode::Address) &&
1478 n->in(LoadBarrierNode::Similar)->in(0)->in(LoadBarrierNode::Oop) != n->in(LoadBarrierNode::Oop)),
1479 "broken similar edge");
1480
1481 assert(post_parse || n->as_LoadBarrier()->has_true_uses(),
1482 "found unneeded load barrier");
|
1443 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
1444 Node* u = n->fast_out(i);
1445 if (u->is_LoadBarrier()) {
1446 } else if ((u->is_Phi() || u->is_CMove()) && !post_parse) {
1447 if (!look_for_barrier(u, post_parse, visited)) {
1448 return false;
1449 }
1450 } else if (u->Opcode() == Op_EncodeP || u->Opcode() == Op_DecodeN) {
1451 if (!look_for_barrier(u, post_parse, visited)) {
1452 return false;
1453 }
1454 } else if (u->Opcode() != Op_SCMemProj) {
1455 tty->print("bad use"); u->dump();
1456 return false;
1457 }
1458 }
1459
1460 return true;
1461 }
1462
1463 void ZBarrierSetC2::verify_gc_barriers(Compile* compile, CompilePhase phase) const {
1464 if (phase == BarrierSetC2::BeforeCodeGen) return;
1465 bool post_parse = phase == BarrierSetC2::BeforeOptimize;
1466 verify_gc_barriers(post_parse);
1467 }
1468
1469 void ZBarrierSetC2::verify_gc_barriers(bool post_parse) const {
1470 ZBarrierSetC2State* s = state();
1471 Compile* C = Compile::current();
1472 ResourceMark rm;
1473 VectorSet visited(Thread::current()->resource_area());
1474 for (int i = 0; i < s->load_barrier_count(); i++) {
1475 LoadBarrierNode* n = s->load_barrier_node(i);
1476
1477 // The dominating barrier on the same address if it exists and
1478 // this barrier must not be applied on the value from the same
1479 // load otherwise the value is not reloaded before it's used the
1480 // second time.
1481 assert(n->in(LoadBarrierNode::Similar)->is_top() ||
1482 (n->in(LoadBarrierNode::Similar)->in(0)->is_LoadBarrier() &&
1483 n->in(LoadBarrierNode::Similar)->in(0)->in(LoadBarrierNode::Address) == n->in(LoadBarrierNode::Address) &&
1484 n->in(LoadBarrierNode::Similar)->in(0)->in(LoadBarrierNode::Oop) != n->in(LoadBarrierNode::Oop)),
1485 "broken similar edge");
1486
1487 assert(post_parse || n->as_LoadBarrier()->has_true_uses(),
1488 "found unneeded load barrier");
|