1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/opto/multnode.hpp Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,101 @@ 1.4 +/* 1.5 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef SHARE_VM_OPTO_MULTNODE_HPP 1.29 +#define SHARE_VM_OPTO_MULTNODE_HPP 1.30 + 1.31 +#include "opto/node.hpp" 1.32 + 1.33 +class Matcher; 1.34 +class ProjNode; 1.35 + 1.36 +//------------------------------MultiNode-------------------------------------- 1.37 +// This class defines a MultiNode, a Node which produces many values. The 1.38 +// values are wrapped up in a tuple Type, i.e. a TypeTuple. 1.39 +class MultiNode : public Node { 1.40 +public: 1.41 + MultiNode( uint required ) : Node(required) { 1.42 + init_class_id(Class_Multi); 1.43 + } 1.44 + virtual int Opcode() const; 1.45 + virtual const Type *bottom_type() const = 0; 1.46 + virtual bool is_CFG() const { return true; } 1.47 + virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash 1.48 + virtual bool depends_only_on_test() const { return false; } 1.49 + virtual const RegMask &out_RegMask() const; 1.50 + virtual Node *match( const ProjNode *proj, const Matcher *m ); 1.51 + virtual uint ideal_reg() const { return NotAMachineReg; } 1.52 + ProjNode* proj_out(uint which_proj) const; // Get a named projection 1.53 + 1.54 +}; 1.55 + 1.56 +//------------------------------ProjNode--------------------------------------- 1.57 +// This class defines a Projection node. Projections project a single element 1.58 +// out of a tuple (or Signature) type. Only MultiNodes produce TypeTuple 1.59 +// results. 1.60 +class ProjNode : public Node { 1.61 +protected: 1.62 + virtual uint hash() const; 1.63 + virtual uint cmp( const Node &n ) const; 1.64 + virtual uint size_of() const; 1.65 + void check_con() const; // Called from constructor. 1.66 + const Type* proj_type(const Type* t) const; 1.67 + 1.68 +public: 1.69 + ProjNode( Node *src, uint con, bool io_use = false ) 1.70 + : Node( src ), _con(con), _is_io_use(io_use) 1.71 + { 1.72 + init_class_id(Class_Proj); 1.73 + // Optimistic setting. Need additional checks in Node::is_dead_loop_safe(). 1.74 + if (con != TypeFunc::Memory || src->is_Start()) 1.75 + init_flags(Flag_is_dead_loop_safe); 1.76 + debug_only(check_con()); 1.77 + } 1.78 + const uint _con; // The field in the tuple we are projecting 1.79 + const bool _is_io_use; // Used to distinguish between the projections 1.80 + // used on the control and io paths from a macro node 1.81 + virtual int Opcode() const; 1.82 + virtual bool is_CFG() const; 1.83 + virtual bool depends_only_on_test() const { return false; } 1.84 + virtual const Type *bottom_type() const; 1.85 + virtual const TypePtr *adr_type() const; 1.86 + virtual bool pinned() const; 1.87 + virtual const Type *Value( PhaseTransform *phase ) const; 1.88 + virtual uint ideal_reg() const; 1.89 + virtual const RegMask &out_RegMask() const; 1.90 + 1.91 +#ifndef PRODUCT 1.92 + virtual void dump_spec(outputStream *st) const; 1.93 +#endif 1.94 + 1.95 + // Return true if proj is for "proj->[region->..]call_uct" 1.96 + bool is_uncommon_trap_proj(Deoptimization::DeoptReason reason); 1.97 + // Return true for "if(test)-> proj -> ... 1.98 + // | 1.99 + // V 1.100 + // other_proj->[region->..]call_uct" 1.101 + bool is_uncommon_trap_if_pattern(Deoptimization::DeoptReason reason); 1.102 +}; 1.103 + 1.104 +#endif // SHARE_VM_OPTO_MULTNODE_HPP