Mon, 26 Sep 2011 10:24:05 -0700
7081933: Use zeroing elimination optimization for large array
Summary: Don't zero new typeArray during runtime call if the allocation is followed by arraycopy into it.
Reviewed-by: twisti
duke@435 | 1 | /* |
stefank@2314 | 2 | * Copyright (c) 1997, 2010, Oracle and/or its affiliates. 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 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_OPTO_MULTNODE_HPP |
stefank@2314 | 26 | #define SHARE_VM_OPTO_MULTNODE_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "opto/node.hpp" |
stefank@2314 | 29 | |
duke@435 | 30 | class Matcher; |
duke@435 | 31 | class ProjNode; |
duke@435 | 32 | |
duke@435 | 33 | //------------------------------MultiNode-------------------------------------- |
duke@435 | 34 | // This class defines a MultiNode, a Node which produces many values. The |
duke@435 | 35 | // values are wrapped up in a tuple Type, i.e. a TypeTuple. |
duke@435 | 36 | class MultiNode : public Node { |
duke@435 | 37 | public: |
duke@435 | 38 | MultiNode( uint required ) : Node(required) { |
duke@435 | 39 | init_class_id(Class_Multi); |
duke@435 | 40 | } |
duke@435 | 41 | virtual int Opcode() const; |
duke@435 | 42 | virtual const Type *bottom_type() const = 0; |
duke@435 | 43 | virtual bool is_CFG() const { return true; } |
duke@435 | 44 | virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash |
duke@435 | 45 | virtual bool depends_only_on_test() const { return false; } |
duke@435 | 46 | virtual const RegMask &out_RegMask() const; |
duke@435 | 47 | virtual Node *match( const ProjNode *proj, const Matcher *m ); |
duke@435 | 48 | virtual uint ideal_reg() const { return NotAMachineReg; } |
duke@435 | 49 | ProjNode* proj_out(uint which_proj) const; // Get a named projection |
duke@435 | 50 | |
duke@435 | 51 | }; |
duke@435 | 52 | |
duke@435 | 53 | //------------------------------ProjNode--------------------------------------- |
duke@435 | 54 | // This class defines a Projection node. Projections project a single element |
duke@435 | 55 | // out of a tuple (or Signature) type. Only MultiNodes produce TypeTuple |
duke@435 | 56 | // results. |
duke@435 | 57 | class ProjNode : public Node { |
duke@435 | 58 | protected: |
duke@435 | 59 | virtual uint hash() const; |
duke@435 | 60 | virtual uint cmp( const Node &n ) const; |
duke@435 | 61 | virtual uint size_of() const; |
duke@435 | 62 | void check_con() const; // Called from constructor. |
duke@435 | 63 | |
duke@435 | 64 | public: |
duke@435 | 65 | ProjNode( Node *src, uint con, bool io_use = false ) |
duke@435 | 66 | : Node( src ), _con(con), _is_io_use(io_use) |
duke@435 | 67 | { |
duke@435 | 68 | init_class_id(Class_Proj); |
kvn@561 | 69 | // Optimistic setting. Need additional checks in Node::is_dead_loop_safe(). |
kvn@561 | 70 | if (con != TypeFunc::Memory || src->is_Start()) |
kvn@561 | 71 | init_flags(Flag_is_dead_loop_safe); |
duke@435 | 72 | debug_only(check_con()); |
duke@435 | 73 | } |
duke@435 | 74 | const uint _con; // The field in the tuple we are projecting |
duke@435 | 75 | const bool _is_io_use; // Used to distinguish between the projections |
duke@435 | 76 | // used on the control and io paths from a macro node |
duke@435 | 77 | virtual int Opcode() const; |
duke@435 | 78 | virtual bool is_CFG() const; |
duke@435 | 79 | virtual bool depends_only_on_test() const { return false; } |
duke@435 | 80 | virtual const Type *bottom_type() const; |
duke@435 | 81 | virtual const TypePtr *adr_type() const; |
duke@435 | 82 | virtual bool pinned() const; |
duke@435 | 83 | virtual const Type *Value( PhaseTransform *phase ) const; |
duke@435 | 84 | virtual uint ideal_reg() const; |
duke@435 | 85 | virtual const RegMask &out_RegMask() const; |
duke@435 | 86 | #ifndef PRODUCT |
duke@435 | 87 | virtual void dump_spec(outputStream *st) const; |
duke@435 | 88 | #endif |
duke@435 | 89 | }; |
stefank@2314 | 90 | |
stefank@2314 | 91 | #endif // SHARE_VM_OPTO_MULTNODE_HPP |