< prev index next >

src/hotspot/share/opto/cfgnode.cpp

Print this page

  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/shared/barrierSet.hpp"
  27 #include "gc/shared/c2/barrierSetC2.hpp"
  28 #include "memory/allocation.inline.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "oops/objArrayKlass.hpp"
  31 #include "opto/addnode.hpp"
  32 #include "opto/castnode.hpp"
  33 #include "opto/cfgnode.hpp"
  34 #include "opto/connode.hpp"
  35 #include "opto/convertnode.hpp"
  36 #include "opto/loopnode.hpp"
  37 #include "opto/machnode.hpp"
  38 #include "opto/movenode.hpp"
  39 #include "opto/narrowptrnode.hpp"
  40 #include "opto/mulnode.hpp"
  41 #include "opto/phaseX.hpp"

  42 #include "opto/regmask.hpp"
  43 #include "opto/runtime.hpp"
  44 #include "opto/subnode.hpp"
  45 #include "opto/vectornode.hpp"
  46 #include "utilities/vmError.hpp"
  47 
  48 // Portions of code courtesy of Clifford Click
  49 
  50 // Optimization - Graph Style
  51 
  52 //=============================================================================
  53 //------------------------------Value------------------------------------------
  54 // Compute the type of the RegionNode.
  55 const Type* RegionNode::Value(PhaseGVN* phase) const {
  56   for( uint i=1; i<req(); ++i ) {       // For all paths in
  57     Node *n = in(i);            // Get Control source
  58     if( !n ) continue;          // Missing inputs are TOP
  59     if( phase->type(n) == Type::CONTROL )
  60       return Type::CONTROL;
  61   }

2798 //------------------------------Ideal------------------------------------------
2799 // Check for no longer being part of a loop
2800 Node *NeverBranchNode::Ideal(PhaseGVN *phase, bool can_reshape) {
2801   if (can_reshape && !in(0)->is_Region()) {
2802     // Dead code elimination can sometimes delete this projection so
2803     // if it's not there, there's nothing to do.
2804     Node* fallthru = proj_out_or_null(0);
2805     if (fallthru != NULL) {
2806       phase->is_IterGVN()->replace_node(fallthru, in(0));
2807     }
2808     return phase->C->top();
2809   }
2810   return NULL;
2811 }
2812 
2813 #ifndef PRODUCT
2814 void NeverBranchNode::format( PhaseRegAlloc *ra_, outputStream *st) const {
2815   st->print("%s", Name());
2816 }
2817 #endif























  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/shared/barrierSet.hpp"
  27 #include "gc/shared/c2/barrierSetC2.hpp"
  28 #include "memory/allocation.inline.hpp"
  29 #include "memory/resourceArea.hpp"
  30 #include "oops/objArrayKlass.hpp"
  31 #include "opto/addnode.hpp"
  32 #include "opto/castnode.hpp"
  33 #include "opto/cfgnode.hpp"
  34 #include "opto/connode.hpp"
  35 #include "opto/convertnode.hpp"
  36 #include "opto/loopnode.hpp"
  37 #include "opto/machnode.hpp"
  38 #include "opto/movenode.hpp"
  39 #include "opto/narrowptrnode.hpp"
  40 #include "opto/mulnode.hpp"
  41 #include "opto/phaseX.hpp"
  42 #include "opto/regalloc.hpp"
  43 #include "opto/regmask.hpp"
  44 #include "opto/runtime.hpp"
  45 #include "opto/subnode.hpp"
  46 #include "opto/vectornode.hpp"
  47 #include "utilities/vmError.hpp"
  48 
  49 // Portions of code courtesy of Clifford Click
  50 
  51 // Optimization - Graph Style
  52 
  53 //=============================================================================
  54 //------------------------------Value------------------------------------------
  55 // Compute the type of the RegionNode.
  56 const Type* RegionNode::Value(PhaseGVN* phase) const {
  57   for( uint i=1; i<req(); ++i ) {       // For all paths in
  58     Node *n = in(i);            // Get Control source
  59     if( !n ) continue;          // Missing inputs are TOP
  60     if( phase->type(n) == Type::CONTROL )
  61       return Type::CONTROL;
  62   }

2799 //------------------------------Ideal------------------------------------------
2800 // Check for no longer being part of a loop
2801 Node *NeverBranchNode::Ideal(PhaseGVN *phase, bool can_reshape) {
2802   if (can_reshape && !in(0)->is_Region()) {
2803     // Dead code elimination can sometimes delete this projection so
2804     // if it's not there, there's nothing to do.
2805     Node* fallthru = proj_out_or_null(0);
2806     if (fallthru != NULL) {
2807       phase->is_IterGVN()->replace_node(fallthru, in(0));
2808     }
2809     return phase->C->top();
2810   }
2811   return NULL;
2812 }
2813 
2814 #ifndef PRODUCT
2815 void NeverBranchNode::format( PhaseRegAlloc *ra_, outputStream *st) const {
2816   st->print("%s", Name());
2817 }
2818 #endif
2819 
2820 #ifndef PRODUCT
2821 void BlackholeNode::format(PhaseRegAlloc* ra, outputStream* st) const {
2822   st->print("blackhole ");
2823   bool first = true;
2824   for (uint i = 0; i < req(); i++) {
2825     Node* n = in(i);
2826     if (n != NULL && OptoReg::is_valid(ra->get_reg_first(n))) {
2827       if (first) {
2828         first = false;
2829       } else {
2830         st->print(", ");
2831       }
2832       char buf[128];
2833       ra->dump_register(n, buf);
2834       st->print("%s", buf);
2835     }
2836   }
2837   st->cr();
2838 }
2839 #endif
2840 
< prev index next >