< prev index next >

src/hotspot/share/opto/movenode.cpp

Print this page

        

@@ -361,10 +361,18 @@
   JavaValue v;
   v.set_jlong(tl->get_con());
   return TypeD::make( v.get_jdouble() );
 }
 
+//------------------------------Identity----------------------------------------
+Node* MoveL2DNode::Identity(PhaseGVN* phase) {
+  if (in(1)->Opcode() == Op_MoveD2L) {
+    return in(1)->in(1);
+  }
+  return this;
+}
+
 //------------------------------Value------------------------------------------
 const Type* MoveI2FNode::Value(PhaseGVN* phase) const {
   const Type *t = phase->type( in(1) );
   if( t == Type::TOP ) return Type::TOP;
   const TypeInt *ti = t->is_int();

@@ -372,10 +380,18 @@
   JavaValue v;
   v.set_jint(ti->get_con());
   return TypeF::make( v.get_jfloat() );
 }
 
+//------------------------------Identity----------------------------------------
+Node* MoveI2FNode::Identity(PhaseGVN* phase) {
+  if (in(1)->Opcode() == Op_MoveF2I) {
+    return in(1)->in(1);
+  }
+  return this;
+}
+
 //------------------------------Value------------------------------------------
 const Type* MoveF2INode::Value(PhaseGVN* phase) const {
   const Type *t = phase->type( in(1) );
   if( t == Type::TOP )       return Type::TOP;
   if( t == Type::FLOAT ) return TypeInt::INT;

@@ -383,10 +399,18 @@
   JavaValue v;
   v.set_jfloat(tf->getf());
   return TypeInt::make( v.get_jint() );
 }
 
+//------------------------------Identity----------------------------------------
+Node* MoveF2INode::Identity(PhaseGVN* phase) {
+  if (in(1)->Opcode() == Op_MoveI2F) {
+    return in(1)->in(1);
+  }
+  return this;
+}
+
 //------------------------------Value------------------------------------------
 const Type* MoveD2LNode::Value(PhaseGVN* phase) const {
   const Type *t = phase->type( in(1) );
   if( t == Type::TOP ) return Type::TOP;
   if( t == Type::DOUBLE ) return TypeLong::LONG;

@@ -394,10 +418,18 @@
   JavaValue v;
   v.set_jdouble(td->getd());
   return TypeLong::make( v.get_jlong() );
 }
 
+//------------------------------Identity----------------------------------------
+Node* MoveD2LNode::Identity(PhaseGVN* phase) {
+  if (in(1)->Opcode() == Op_MoveL2D) {
+    return in(1)->in(1);
+  }
+  return this;
+}
+
 #ifndef PRODUCT
 //----------------------------BinaryNode---------------------------------------
 // The set of related nodes for a BinaryNode is all data inputs and all outputs
 // till level 2 (i.e., one beyond the associated CMoveNode). In compact mode,
 // it's the inputs till level 1 and the outputs till level 2.
< prev index next >