1 /* 2 * Copyright (c) 1997, 2006, 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 * 23 */ 24 25 #include "incls/_precompiled.incl" 26 #include "incls/_multnode.cpp.incl" 27 28 //============================================================================= 29 //------------------------------MultiNode-------------------------------------- 30 const RegMask &MultiNode::out_RegMask() const { 31 return RegMask::Empty; 32 } 33 34 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } 35 36 //------------------------------proj_out--------------------------------------- 37 // Get a named projection 38 ProjNode* MultiNode::proj_out(uint which_proj) const { 39 assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); 40 assert(Opcode() != Op_If || outcnt() == 2, "bad if #1"); 41 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { 42 Node *p = fast_out(i); 43 if( !p->is_Proj() ) { 44 assert(p == this && this->is_Start(), "else must be proj"); 45 continue; 46 } | 1 /* 2 * Copyright (c) 1997, 2010, 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 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "opto/matcher.hpp" 27 #include "opto/multnode.hpp" 28 #include "opto/opcodes.hpp" 29 #include "opto/phaseX.hpp" 30 #include "opto/regmask.hpp" 31 #include "opto/type.hpp" 32 33 //============================================================================= 34 //------------------------------MultiNode-------------------------------------- 35 const RegMask &MultiNode::out_RegMask() const { 36 return RegMask::Empty; 37 } 38 39 Node *MultiNode::match( const ProjNode *proj, const Matcher *m ) { return proj->clone(); } 40 41 //------------------------------proj_out--------------------------------------- 42 // Get a named projection 43 ProjNode* MultiNode::proj_out(uint which_proj) const { 44 assert(Opcode() != Op_If || which_proj == (uint)true || which_proj == (uint)false, "must be 1 or 0"); 45 assert(Opcode() != Op_If || outcnt() == 2, "bad if #1"); 46 for( DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++ ) { 47 Node *p = fast_out(i); 48 if( !p->is_Proj() ) { 49 assert(p == this && this->is_Start(), "else must be proj"); 50 continue; 51 } |