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