< prev index next >

src/share/vm/opto/callnode.cpp

Print this page




1364   }
1365   SafePointScalarObjectNode* res = (SafePointScalarObjectNode*)Node::clone();
1366   sosn_map->Insert((void*)this, (void*)res);
1367   return res;
1368 }
1369 
1370 
1371 #ifndef PRODUCT
1372 void SafePointScalarObjectNode::dump_spec(outputStream *st) const {
1373   st->print(" # fields@[%d..%d]", first_index(),
1374              first_index() + n_fields() - 1);
1375 }
1376 
1377 #endif
1378 
1379 //=============================================================================
1380 uint AllocateNode::size_of() const { return sizeof(*this); }
1381 
1382 AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
1383                            Node *ctrl, Node *mem, Node *abio,
1384                            Node *size, Node *klass_node, Node *initial_test)

1385   : CallNode(atype, NULL, TypeRawPtr::BOTTOM)
1386 {
1387   init_class_id(Class_Allocate);
1388   init_flags(Flag_is_macro);
1389   _is_scalar_replaceable = false;
1390   _is_non_escaping = false;
1391   _is_allocation_MemBar_redundant = false;
1392   Node *topnode = C->top();
1393 
1394   init_req( TypeFunc::Control  , ctrl );
1395   init_req( TypeFunc::I_O      , abio );
1396   init_req( TypeFunc::Memory   , mem );
1397   init_req( TypeFunc::ReturnAdr, topnode );
1398   init_req( TypeFunc::FramePtr , topnode );
1399   init_req( AllocSize          , size);
1400   init_req( KlassNode          , klass_node);
1401   init_req( InitialTest        , initial_test);
1402   init_req( ALength            , topnode);

1403   C->add_macro_node(this);
1404 }
1405 
1406 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1407 {
1408   assert(initializer != NULL &&
1409          initializer->is_initializer() &&
1410          !initializer->is_static(),
1411              "unexpected initializer method");
1412   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1413   if (analyzer == NULL) {
1414     return;
1415   }
1416 
1417   // Allocation node is first parameter in its initializer
1418   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1419     _is_allocation_MemBar_redundant = true;
1420   }
1421 }
1422 




1364   }
1365   SafePointScalarObjectNode* res = (SafePointScalarObjectNode*)Node::clone();
1366   sosn_map->Insert((void*)this, (void*)res);
1367   return res;
1368 }
1369 
1370 
1371 #ifndef PRODUCT
1372 void SafePointScalarObjectNode::dump_spec(outputStream *st) const {
1373   st->print(" # fields@[%d..%d]", first_index(),
1374              first_index() + n_fields() - 1);
1375 }
1376 
1377 #endif
1378 
1379 //=============================================================================
1380 uint AllocateNode::size_of() const { return sizeof(*this); }
1381 
1382 AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype,
1383                            Node *ctrl, Node *mem, Node *abio,
1384                            Node *size, Node *klass_node,
1385                            Node* initial_test, ValueTypeNode* value_node)
1386   : CallNode(atype, NULL, TypeRawPtr::BOTTOM)
1387 {
1388   init_class_id(Class_Allocate);
1389   init_flags(Flag_is_macro);
1390   _is_scalar_replaceable = false;
1391   _is_non_escaping = false;
1392   _is_allocation_MemBar_redundant = false;
1393   Node *topnode = C->top();
1394 
1395   init_req( TypeFunc::Control  , ctrl );
1396   init_req( TypeFunc::I_O      , abio );
1397   init_req( TypeFunc::Memory   , mem );
1398   init_req( TypeFunc::ReturnAdr, topnode );
1399   init_req( TypeFunc::FramePtr , topnode );
1400   init_req( AllocSize          , size);
1401   init_req( KlassNode          , klass_node);
1402   init_req( InitialTest        , initial_test);
1403   init_req( ALength            , topnode);
1404   init_req( ValueNode          , value_node);
1405   C->add_macro_node(this);
1406 }
1407 
1408 void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer)
1409 {
1410   assert(initializer != NULL &&
1411          initializer->is_initializer() &&
1412          !initializer->is_static(),
1413              "unexpected initializer method");
1414   BCEscapeAnalyzer* analyzer = initializer->get_bcea();
1415   if (analyzer == NULL) {
1416     return;
1417   }
1418 
1419   // Allocation node is first parameter in its initializer
1420   if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) {
1421     _is_allocation_MemBar_redundant = true;
1422   }
1423 }
1424 


< prev index next >