hotspot/src/share/vm/opto/connode.cpp
changeset 360 21d113ecbf6a
parent 209 2a924148a40a
child 371 1aacedc9db7c
equal deleted inserted replaced
357:f4edb0d9f109 360:21d113ecbf6a
    33   return (uintptr_t)in(TypeFunc::Control) + _type->hash();
    33   return (uintptr_t)in(TypeFunc::Control) + _type->hash();
    34 }
    34 }
    35 
    35 
    36 //------------------------------make-------------------------------------------
    36 //------------------------------make-------------------------------------------
    37 ConNode *ConNode::make( Compile* C, const Type *t ) {
    37 ConNode *ConNode::make( Compile* C, const Type *t ) {
       
    38   if (t->isa_narrowoop()) return new (C, 1) ConNNode( t->is_narrowoop() );
    38   switch( t->basic_type() ) {
    39   switch( t->basic_type() ) {
    39   case T_INT:       return new (C, 1) ConINode( t->is_int() );
    40   case T_INT:       return new (C, 1) ConINode( t->is_int() );
    40   case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
    41   case T_ARRAY:     return new (C, 1) ConPNode( t->is_aryptr() );
    41   case T_LONG:      return new (C, 1) ConLNode( t->is_long() );
    42   case T_LONG:      return new (C, 1) ConLNode( t->is_long() );
    42   case T_FLOAT:     return new (C, 1) ConFNode( t->is_float_constant() );
    43   case T_FLOAT:     return new (C, 1) ConFNode( t->is_float_constant() );
   459   } else {
   460   } else {
   460     int opc = n->Opcode();
   461     int opc = n->Opcode();
   461     possible_alias = n->is_Phi() ||
   462     possible_alias = n->is_Phi() ||
   462         opc == Op_CheckCastPP ||
   463         opc == Op_CheckCastPP ||
   463         opc == Op_StorePConditional ||
   464         opc == Op_StorePConditional ||
   464         opc == Op_CompareAndSwapP;
   465         opc == Op_CompareAndSwapP ||
       
   466         opc == Op_CompareAndSwapN;
   465   }
   467   }
   466   return possible_alias;
   468   return possible_alias;
   467 }
   469 }
   468 
   470 
   469 //------------------------------Value------------------------------------------
   471 //------------------------------Value------------------------------------------
   547 // control copies
   549 // control copies
   548 Node *CheckCastPPNode::Ideal(PhaseGVN *phase, bool can_reshape){
   550 Node *CheckCastPPNode::Ideal(PhaseGVN *phase, bool can_reshape){
   549   return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
   551   return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
   550 }
   552 }
   551 
   553 
       
   554 
       
   555 Node* DecodeNNode::Identity(PhaseTransform* phase) {
       
   556   const Type *t = phase->type( in(1) );
       
   557   if( t == Type::TOP ) return in(1);
       
   558 
       
   559   if (in(1)->Opcode() == Op_EncodeP) {
       
   560     // (DecodeN (EncodeP p)) -> p
       
   561     return in(1)->in(1);
       
   562   }
       
   563   return this;
       
   564 }
       
   565 
       
   566 Node* EncodePNode::Identity(PhaseTransform* phase) {
       
   567   const Type *t = phase->type( in(1) );
       
   568   if( t == Type::TOP ) return in(1);
       
   569 
       
   570   if (in(1)->Opcode() == Op_DecodeN) {
       
   571     // (EncodeP (DecodeN p)) -> p
       
   572     return in(1)->in(1);
       
   573   }
       
   574   return this;
       
   575 }
       
   576 
       
   577 
       
   578 Node* EncodePNode::encode(PhaseGVN* phase, Node* value) {
       
   579   const Type* newtype = value->bottom_type();
       
   580   if (newtype == TypePtr::NULL_PTR) {
       
   581     return phase->transform(new (phase->C, 1) ConNNode(TypeNarrowOop::NULL_PTR));
       
   582   } else {
       
   583     return phase->transform(new (phase->C, 2) EncodePNode(value,
       
   584                                                           newtype->is_oopptr()->make_narrowoop()));
       
   585   }
       
   586 }
       
   587 
       
   588 
   552 //=============================================================================
   589 //=============================================================================
   553 //------------------------------Identity---------------------------------------
   590 //------------------------------Identity---------------------------------------
   554 Node *Conv2BNode::Identity( PhaseTransform *phase ) {
   591 Node *Conv2BNode::Identity( PhaseTransform *phase ) {
   555   const Type *t = phase->type( in(1) );
   592   const Type *t = phase->type( in(1) );
   556   if( t == Type::TOP ) return in(1);
   593   if( t == Type::TOP ) return in(1);