< prev index next >

src/hotspot/share/opto/multnode.cpp

Print this page

 22  *
 23  */
 24 
 25 #include "opto/callnode.hpp"
 26 #include "opto/cfgnode.hpp"
 27 #include "opto/matcher.hpp"
 28 #include "opto/mathexactnode.hpp"
 29 #include "opto/multnode.hpp"
 30 #include "opto/opcodes.hpp"
 31 #include "opto/phaseX.hpp"
 32 #include "opto/regmask.hpp"
 33 #include "opto/type.hpp"
 34 #include "utilities/vmError.hpp"
 35 
 36 //=============================================================================
 37 //------------------------------MultiNode--------------------------------------
 38 const RegMask &MultiNode::out_RegMask() const {
 39   return RegMask::EMPTY;
 40 }
 41 
 42 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); }
 43 
 44 //------------------------------proj_out---------------------------------------
 45 // Get a named projection or null if not found
 46 ProjNode* MultiNode::proj_out_or_null(uint which_proj) const {
 47   assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
 48   assert(number_of_projs(which_proj) <= 1, "only when there's a single projection");
 49   ProjNode* proj = find_first(which_proj);
 50   assert(proj == nullptr || (Opcode() != Op_If && Opcode() != Op_RangeCheck) || proj->Opcode() == (which_proj ? Op_IfTrue : Op_IfFalse),
 51          "incorrect projection node at If/RangeCheck: IfTrue on false path or IfFalse on true path");
 52   return proj;
 53 }
 54 
 55 ProjNode* MultiNode::proj_out_or_null(uint which_proj, bool is_io_use) const {
 56   assert(number_of_projs(which_proj, is_io_use) <= 1, "only when there's a single projection");
 57   return find_first(which_proj, is_io_use);
 58 }
 59 
 60 template<class Callback> ProjNode* MultiNode::apply_to_projs(Callback callback, uint which_proj, bool is_io_use) const {
 61   auto filter = [&](ProjNode* proj) {
 62     if (proj->_is_io_use == is_io_use && callback(proj) == BREAK_AND_RETURN_CURRENT_PROJ) {

 22  *
 23  */
 24 
 25 #include "opto/callnode.hpp"
 26 #include "opto/cfgnode.hpp"
 27 #include "opto/matcher.hpp"
 28 #include "opto/mathexactnode.hpp"
 29 #include "opto/multnode.hpp"
 30 #include "opto/opcodes.hpp"
 31 #include "opto/phaseX.hpp"
 32 #include "opto/regmask.hpp"
 33 #include "opto/type.hpp"
 34 #include "utilities/vmError.hpp"
 35 
 36 //=============================================================================
 37 //------------------------------MultiNode--------------------------------------
 38 const RegMask &MultiNode::out_RegMask() const {
 39   return RegMask::EMPTY;
 40 }
 41 
 42 Node *MultiNode::match(const ProjNode *proj, const Matcher *m, const RegMask* mask) { return proj->clone(); }
 43 
 44 //------------------------------proj_out---------------------------------------
 45 // Get a named projection or null if not found
 46 ProjNode* MultiNode::proj_out_or_null(uint which_proj) const {
 47   assert((Opcode() != Op_If && Opcode() != Op_RangeCheck) || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0");
 48   assert(number_of_projs(which_proj) <= 1, "only when there's a single projection");
 49   ProjNode* proj = find_first(which_proj);
 50   assert(proj == nullptr || (Opcode() != Op_If && Opcode() != Op_RangeCheck) || proj->Opcode() == (which_proj ? Op_IfTrue : Op_IfFalse),
 51          "incorrect projection node at If/RangeCheck: IfTrue on false path or IfFalse on true path");
 52   return proj;
 53 }
 54 
 55 ProjNode* MultiNode::proj_out_or_null(uint which_proj, bool is_io_use) const {
 56   assert(number_of_projs(which_proj, is_io_use) <= 1, "only when there's a single projection");
 57   return find_first(which_proj, is_io_use);
 58 }
 59 
 60 template<class Callback> ProjNode* MultiNode::apply_to_projs(Callback callback, uint which_proj, bool is_io_use) const {
 61   auto filter = [&](ProjNode* proj) {
 62     if (proj->_is_io_use == is_io_use && callback(proj) == BREAK_AND_RETURN_CURRENT_PROJ) {
< prev index next >