src/share/vm/opto/multnode.hpp

Thu, 19 Mar 2009 09:13:24 -0700

author
kvn
date
Thu, 19 Mar 2009 09:13:24 -0700
changeset 1082
bd441136a5ce
parent 631
d1605aabd0a1
child 1907
c18cbe5936b8
permissions
-rw-r--r--

Merge

duke@435 1 /*
xdono@631 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
duke@435 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 * have any questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 class Matcher;
duke@435 26 class ProjNode;
duke@435 27
duke@435 28 //------------------------------MultiNode--------------------------------------
duke@435 29 // This class defines a MultiNode, a Node which produces many values. The
duke@435 30 // values are wrapped up in a tuple Type, i.e. a TypeTuple.
duke@435 31 class MultiNode : public Node {
duke@435 32 public:
duke@435 33 MultiNode( uint required ) : Node(required) {
duke@435 34 init_class_id(Class_Multi);
duke@435 35 }
duke@435 36 virtual int Opcode() const;
duke@435 37 virtual const Type *bottom_type() const = 0;
duke@435 38 virtual bool is_CFG() const { return true; }
duke@435 39 virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
duke@435 40 virtual bool depends_only_on_test() const { return false; }
duke@435 41 virtual const RegMask &out_RegMask() const;
duke@435 42 virtual Node *match( const ProjNode *proj, const Matcher *m );
duke@435 43 virtual uint ideal_reg() const { return NotAMachineReg; }
duke@435 44 ProjNode* proj_out(uint which_proj) const; // Get a named projection
duke@435 45
duke@435 46 };
duke@435 47
duke@435 48 //------------------------------ProjNode---------------------------------------
duke@435 49 // This class defines a Projection node. Projections project a single element
duke@435 50 // out of a tuple (or Signature) type. Only MultiNodes produce TypeTuple
duke@435 51 // results.
duke@435 52 class ProjNode : public Node {
duke@435 53 protected:
duke@435 54 virtual uint hash() const;
duke@435 55 virtual uint cmp( const Node &n ) const;
duke@435 56 virtual uint size_of() const;
duke@435 57 void check_con() const; // Called from constructor.
duke@435 58
duke@435 59 public:
duke@435 60 ProjNode( Node *src, uint con, bool io_use = false )
duke@435 61 : Node( src ), _con(con), _is_io_use(io_use)
duke@435 62 {
duke@435 63 init_class_id(Class_Proj);
kvn@561 64 // Optimistic setting. Need additional checks in Node::is_dead_loop_safe().
kvn@561 65 if (con != TypeFunc::Memory || src->is_Start())
kvn@561 66 init_flags(Flag_is_dead_loop_safe);
duke@435 67 debug_only(check_con());
duke@435 68 }
duke@435 69 const uint _con; // The field in the tuple we are projecting
duke@435 70 const bool _is_io_use; // Used to distinguish between the projections
duke@435 71 // used on the control and io paths from a macro node
duke@435 72 virtual int Opcode() const;
duke@435 73 virtual bool is_CFG() const;
duke@435 74 virtual bool depends_only_on_test() const { return false; }
duke@435 75 virtual const Type *bottom_type() const;
duke@435 76 virtual const TypePtr *adr_type() const;
duke@435 77 virtual bool pinned() const;
duke@435 78 virtual const Type *Value( PhaseTransform *phase ) const;
duke@435 79 virtual uint ideal_reg() const;
duke@435 80 virtual const RegMask &out_RegMask() const;
duke@435 81 #ifndef PRODUCT
duke@435 82 virtual void dump_spec(outputStream *st) const;
duke@435 83 #endif
duke@435 84 };

mercurial