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