< prev index next >

src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp

Print this page




1418     return node->in(LoadBarrierNode::Oop);
1419   }
1420 
1421   // 3. This step checks for the phi corresponding to an optimized load barrier expansion
1422   if (node->is_Phi()) {
1423     PhiNode* phi = node->as_Phi();
1424     Node* n = phi->in(1);
1425     if (n != NULL && (n->is_LoadBarrierSlowReg() ||  n->is_LoadBarrierWeakSlowReg())) {
1426       assert(c == node, "projections from step 1 should only be seen before macro expansion");
1427       return phi->in(2);
1428     }
1429   }
1430 
1431   return c;
1432 }
1433 
1434 bool ZBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
1435   return type == T_OBJECT || type == T_ARRAY;
1436 }
1437 
1438 bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n) const {
1439   bool handled;
1440   switch (n->Opcode()) {
1441     case Op_LoadBarrierSlowReg:
1442     case Op_LoadBarrierWeakSlowReg:
1443 #ifdef ASSERT
1444       if (VerifyOptoOopOffsets) {
1445         assert(n->is_Mem(), "");
1446         MemNode* mem  = (MemNode*)n;
1447         // Check to see if address types have grounded out somehow.
1448         const TypeInstPtr* tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr();
1449         ciInstanceKlass* k = tp->klass()->as_instance_klass();
1450         bool oop_offset_is_sane = k->contains_field_offset(tp->offset());
1451         assert(!tp || oop_offset_is_sane, "");
1452       }
1453 #endif
1454       handled = true;
1455       break;
1456     default:
1457       handled = false;
1458   }
1459   return handled;
1460 }
1461 
1462 // == Verification ==
1463 
1464 #ifdef ASSERT
1465 
1466 static bool look_for_barrier(Node* n, bool post_parse, VectorSet& visited) {




1418     return node->in(LoadBarrierNode::Oop);
1419   }
1420 
1421   // 3. This step checks for the phi corresponding to an optimized load barrier expansion
1422   if (node->is_Phi()) {
1423     PhiNode* phi = node->as_Phi();
1424     Node* n = phi->in(1);
1425     if (n != NULL && (n->is_LoadBarrierSlowReg() ||  n->is_LoadBarrierWeakSlowReg())) {
1426       assert(c == node, "projections from step 1 should only be seen before macro expansion");
1427       return phi->in(2);
1428     }
1429   }
1430 
1431   return c;
1432 }
1433 
1434 bool ZBarrierSetC2::array_copy_requires_gc_barriers(bool tightly_coupled_alloc, BasicType type, bool is_clone, ArrayCopyPhase phase) const {
1435   return type == T_OBJECT || type == T_ARRAY;
1436 }
1437 
1438 bool ZBarrierSetC2::final_graph_reshaping(Compile* compile, Node* n, uint opcode) const {
1439   bool handled;
1440   switch (n->Opcode()) {
1441     case Op_LoadBarrierSlowReg:
1442     case Op_LoadBarrierWeakSlowReg:
1443 #ifdef ASSERT
1444       if (VerifyOptoOopOffsets) {
1445         MemNode* mem  = n->as_Mem();

1446         // Check to see if address types have grounded out somehow.
1447         const TypeInstPtr* tp = mem->in(MemNode::Address)->bottom_type()->isa_instptr();
1448         ciInstanceKlass* k = tp->klass()->as_instance_klass();
1449         bool oop_offset_is_sane = k->contains_field_offset(tp->offset());
1450         assert(!tp || oop_offset_is_sane, "");
1451       }
1452 #endif
1453       handled = true;
1454       break;
1455     default:
1456       handled = false;
1457   }
1458   return handled;
1459 }
1460 
1461 // == Verification ==
1462 
1463 #ifdef ASSERT
1464 
1465 static bool look_for_barrier(Node* n, bool post_parse, VectorSet& visited) {


< prev index next >