< prev index next >

src/share/vm/opto/movenode.cpp

Print this page
rev 8739 : 8004073: Implement C2 Ideal node specific dump() method
Summary: add Node::dump_rel() to dump a node and its related nodes (the notion of "related" depends on the node at hand); add Node::dump_comp() to dump a node in compact representation; add Node::dump_rel_comp() to dump a node and its related nodes in compact representation; add the required machinery; extend some C2 IR nodes with compact and related dumping
Reviewed-by:
   1 /*
   2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 379   const Type *t = phase->type( in(1) );
 380   if( t == Type::TOP )       return Type::TOP;
 381   if( t == Type::FLOAT ) return TypeInt::INT;
 382   const TypeF *tf = t->is_float_constant();
 383   JavaValue v;
 384   v.set_jfloat(tf->getf());
 385   return TypeInt::make( v.get_jint() );
 386 }
 387 
 388 //------------------------------Value------------------------------------------
 389 const Type *MoveD2LNode::Value( PhaseTransform *phase ) const {
 390   const Type *t = phase->type( in(1) );
 391   if( t == Type::TOP ) return Type::TOP;
 392   if( t == Type::DOUBLE ) return TypeLong::LONG;
 393   const TypeD *td = t->is_double_constant();
 394   JavaValue v;
 395   v.set_jdouble(td->getd());
 396   return TypeLong::make( v.get_jlong() );
 397 }
 398 














   1 /*
   2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 379   const Type *t = phase->type( in(1) );
 380   if( t == Type::TOP )       return Type::TOP;
 381   if( t == Type::FLOAT ) return TypeInt::INT;
 382   const TypeF *tf = t->is_float_constant();
 383   JavaValue v;
 384   v.set_jfloat(tf->getf());
 385   return TypeInt::make( v.get_jint() );
 386 }
 387 
 388 //------------------------------Value------------------------------------------
 389 const Type *MoveD2LNode::Value( PhaseTransform *phase ) const {
 390   const Type *t = phase->type( in(1) );
 391   if( t == Type::TOP ) return Type::TOP;
 392   if( t == Type::DOUBLE ) return TypeLong::LONG;
 393   const TypeD *td = t->is_double_constant();
 394   JavaValue v;
 395   v.set_jdouble(td->getd());
 396   return TypeLong::make( v.get_jlong() );
 397 }
 398 
 399 #ifndef PRODUCT
 400 //----------------------------BinaryNode---------------------------------------
 401 // The set of related nodes for a BinaryNode is all data inputs and all outputs
 402 // till level 2 (i.e., one beyond the associated CMoveNode). In compact mode,
 403 // it's the inputs till level 1 and the outputs till level 2.
 404 void BinaryNode::rel(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
 405   if (compact) {
 406     this->collect_nodes(in_rel, 1, false, true);
 407   } else {
 408     this->collect_nodes_in_all_data(in_rel, false);
 409   }
 410   this->collect_nodes(out_rel, -2, false, false);
 411 }
 412 #endif
< prev index next >