multnode.hpp revision 0
0N/A/*
0N/A * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
0N/A * CA 95054 USA or visit www.sun.com if you need additional information or
0N/A * have any questions.
0N/A *
0N/A */
0N/A
0N/Aclass Matcher;
0N/Aclass ProjNode;
0N/A
0N/A//------------------------------MultiNode--------------------------------------
0N/A// This class defines a MultiNode, a Node which produces many values. The
0N/A// values are wrapped up in a tuple Type, i.e. a TypeTuple.
0N/Aclass MultiNode : public Node {
0N/Apublic:
0N/A MultiNode( uint required ) : Node(required) {
0N/A init_class_id(Class_Multi);
0N/A }
0N/A virtual int Opcode() const;
0N/A virtual const Type *bottom_type() const = 0;
0N/A virtual bool is_CFG() const { return true; }
0N/A virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash
0N/A virtual bool depends_only_on_test() const { return false; }
0N/A virtual const RegMask &out_RegMask() const;
0N/A virtual Node *match( const ProjNode *proj, const Matcher *m );
0N/A virtual uint ideal_reg() const { return NotAMachineReg; }
0N/A ProjNode* proj_out(uint which_proj) const; // Get a named projection
0N/A
0N/A};
0N/A
0N/A//------------------------------ProjNode---------------------------------------
0N/A// This class defines a Projection node. Projections project a single element
0N/A// out of a tuple (or Signature) type. Only MultiNodes produce TypeTuple
0N/A// results.
0N/Aclass ProjNode : public Node {
0N/Aprotected:
0N/A virtual uint hash() const;
0N/A virtual uint cmp( const Node &n ) const;
0N/A virtual uint size_of() const;
0N/A void check_con() const; // Called from constructor.
0N/A
0N/Apublic:
0N/A ProjNode( Node *src, uint con, bool io_use = false )
0N/A : Node( src ), _con(con), _is_io_use(io_use)
0N/A {
0N/A init_class_id(Class_Proj);
0N/A debug_only(check_con());
0N/A }
0N/A const uint _con; // The field in the tuple we are projecting
0N/A const bool _is_io_use; // Used to distinguish between the projections
0N/A // used on the control and io paths from a macro node
0N/A virtual int Opcode() const;
0N/A virtual bool is_CFG() const;
0N/A virtual bool depends_only_on_test() const { return false; }
0N/A virtual const Type *bottom_type() const;
0N/A virtual const TypePtr *adr_type() const;
0N/A virtual bool pinned() const;
0N/A virtual const Type *Value( PhaseTransform *phase ) const;
0N/A virtual uint ideal_reg() const;
0N/A virtual const RegMask &out_RegMask() const;
0N/A#ifndef PRODUCT
0N/A virtual void dump_spec(outputStream *st) const;
0N/A#endif
0N/A};