< prev index next >

src/hotspot/share/opto/callnode.cpp

Print this page




1398              first_index() + n_fields() - 1);
1399 }
1400 
1401 #endif
1402 
1403 //=============================================================================
1404 uint AllocateNode::size_of() const { return sizeof(*this); }
1405 
1406 AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
1407                            Node *ctrl, Node *mem, Node *abio,
1408                            Node *size, Node *klass_node,
1409                            Node* initial_test,
1410                            ValueTypeBaseNode* value_node)
1411   : CallNode(atype, NULL, TypeRawPtr::BOTTOM)
1412 {
1413   init_class_id(Class_Allocate);
1414   init_flags(Flag_is_macro);
1415   _is_scalar_replaceable = false;
1416   _is_non_escaping = false;
1417   _is_allocation_MemBar_redundant = false;

1418   Node *topnode = C->top();
1419 
1420   init_req( TypeFunc::Control  , ctrl );
1421   init_req( TypeFunc::I_O      , abio );
1422   init_req( TypeFunc::Memory   , mem );
1423   init_req( TypeFunc::ReturnAdr, topnode );
1424   init_req( TypeFunc::FramePtr , topnode );
1425   init_req( AllocSize          , size);
1426   init_req( KlassNode          , klass_node);
1427   init_req( InitialTest        , initial_test);
1428   init_req( ALength            , topnode);
1429   init_req( ValueNode          , value_node);
1430   // DefaultValue defaults to NULL
1431   // RawDefaultValue defaults to NULL
1432   C->add_macro_node(this);
1433 }
1434 
1435 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1436 {
1437   assert(initializer != NULL &&


1467       igvn->replace_node(projs->catchall_memproj, phase->C->top());
1468     }
1469     if (projs->fallthrough_ioproj != NULL) {
1470       igvn->replace_node(projs->fallthrough_ioproj, in(TypeFunc::I_O));
1471     }
1472     if (projs->catchall_ioproj != NULL) {
1473       igvn->replace_node(projs->catchall_ioproj, phase->C->top());
1474     }
1475     if (projs->catchall_catchproj != NULL) {
1476       igvn->replace_node(projs->catchall_catchproj, phase->C->top());
1477     }
1478     if (projs->resproj[0] != NULL) {
1479       igvn->replace_node(projs->resproj[0], phase->C->top());
1480     }
1481     igvn->replace_node(this, phase->C->top());
1482     return NULL;
1483   }
1484 
1485   return CallNode::Ideal(phase, can_reshape);
1486 }





















1487 
1488 //=============================================================================
1489 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1490   Node* res = SafePointNode::Ideal(phase, can_reshape);
1491   if (res != NULL) {
1492     return res;
1493   }
1494   // Don't bother trying to transform a dead node
1495   if (in(0) && in(0)->is_top())  return NULL;
1496 
1497   const Type* type = phase->type(Ideal_length());
1498   if (type->isa_int() && type->is_int()->_hi < 0) {
1499     if (can_reshape) {
1500       PhaseIterGVN *igvn = phase->is_IterGVN();
1501       // Unreachable fall through path (negative array length),
1502       // the allocation can only throw so disconnect it.
1503       Node* proj = proj_out_or_null(TypeFunc::Control);
1504       Node* catchproj = NULL;
1505       if (proj != NULL) {
1506         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {




1398              first_index() + n_fields() - 1);
1399 }
1400 
1401 #endif
1402 
1403 //=============================================================================
1404 uint AllocateNode::size_of() const { return sizeof(*this); }
1405 
1406 AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
1407                            Node *ctrl, Node *mem, Node *abio,
1408                            Node *size, Node *klass_node,
1409                            Node* initial_test,
1410                            ValueTypeBaseNode* value_node)
1411   : CallNode(atype, NULL, TypeRawPtr::BOTTOM)
1412 {
1413   init_class_id(Class_Allocate);
1414   init_flags(Flag_is_macro);
1415   _is_scalar_replaceable = false;
1416   _is_non_escaping = false;
1417   _is_allocation_MemBar_redundant = false;
1418   _larval = false;
1419   Node *topnode = C->top();
1420 
1421   init_req( TypeFunc::Control  , ctrl );
1422   init_req( TypeFunc::I_O      , abio );
1423   init_req( TypeFunc::Memory   , mem );
1424   init_req( TypeFunc::ReturnAdr, topnode );
1425   init_req( TypeFunc::FramePtr , topnode );
1426   init_req( AllocSize          , size);
1427   init_req( KlassNode          , klass_node);
1428   init_req( InitialTest        , initial_test);
1429   init_req( ALength            , topnode);
1430   init_req( ValueNode          , value_node);
1431   // DefaultValue defaults to NULL
1432   // RawDefaultValue defaults to NULL
1433   C->add_macro_node(this);
1434 }
1435 
1436 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1437 {
1438   assert(initializer != NULL &&


1468       igvn->replace_node(projs->catchall_memproj, phase->C->top());
1469     }
1470     if (projs->fallthrough_ioproj != NULL) {
1471       igvn->replace_node(projs->fallthrough_ioproj, in(TypeFunc::I_O));
1472     }
1473     if (projs->catchall_ioproj != NULL) {
1474       igvn->replace_node(projs->catchall_ioproj, phase->C->top());
1475     }
1476     if (projs->catchall_catchproj != NULL) {
1477       igvn->replace_node(projs->catchall_catchproj, phase->C->top());
1478     }
1479     if (projs->resproj[0] != NULL) {
1480       igvn->replace_node(projs->resproj[0], phase->C->top());
1481     }
1482     igvn->replace_node(this, phase->C->top());
1483     return NULL;
1484   }
1485 
1486   return CallNode::Ideal(phase, can_reshape);
1487 }
1488 
1489 Node *AllocateNode::make_ideal_mark(PhaseGVN *phase, Node* obj, Node* control, Node* mem, Node* klass_node) {
1490   Node* mark_node = NULL;
1491   // For now only enable fast locking for non-array types
1492   if ((EnableValhalla || UseBiasedLocking) && Opcode() ==  Op_Allocate) {
1493     if (klass_node == NULL) {
1494       Node* k_adr = phase->transform(new AddPNode(obj, obj, phase->MakeConX(oopDesc::klass_offset_in_bytes())));
1495       klass_node = phase->transform(LoadKlassNode::make(*phase, NULL, phase->C->immutable_memory(), k_adr, phase->type(k_adr)->is_ptr()));
1496     }
1497     Node* proto_adr = phase->transform(new AddPNode(klass_node, klass_node, phase->MakeConX(in_bytes(Klass::prototype_header_offset()))));
1498     mark_node = LoadNode::make(*phase, control, mem, proto_adr, TypeRawPtr::BOTTOM, TypeX_X, TypeX_X->basic_type(), MemNode::unordered);
1499   } else {
1500     mark_node = phase->MakeConX((intptr_t)markOopDesc::prototype());
1501   }
1502   if (_larval) {
1503     mark_node = phase->transform(mark_node);
1504     mark_node = new OrXNode(mark_node, phase->MakeConX(markOopDesc::larval_state_pattern));
1505   }
1506   return mark_node;
1507 }
1508 
1509 
1510 //=============================================================================
1511 Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) {
1512   Node* res = SafePointNode::Ideal(phase, can_reshape);
1513   if (res != NULL) {
1514     return res;
1515   }
1516   // Don't bother trying to transform a dead node
1517   if (in(0) && in(0)->is_top())  return NULL;
1518 
1519   const Type* type = phase->type(Ideal_length());
1520   if (type->isa_int() && type->is_int()->_hi < 0) {
1521     if (can_reshape) {
1522       PhaseIterGVN *igvn = phase->is_IterGVN();
1523       // Unreachable fall through path (negative array length),
1524       // the allocation can only throw so disconnect it.
1525       Node* proj = proj_out_or_null(TypeFunc::Control);
1526       Node* catchproj = NULL;
1527       if (proj != NULL) {
1528         for (DUIterator_Fast imax, i = proj->fast_outs(imax); i < imax; i++) {


< prev index next >