src/share/vm/opto/live.hpp

Wed, 16 Nov 2011 09:13:57 -0800

author
kvn
date
Wed, 16 Nov 2011 09:13:57 -0800
changeset 3311
1bd45abaa507
parent 2314
f95d63e2154a
child 4728
056ab43544a4
permissions
-rw-r--r--

6890673: Eliminate allocations immediately after EA
Summary: Try to eliminate allocations and related locks immediately after escape analysis.
Reviewed-by: never

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_LIVE_HPP
stefank@2314 26 #define SHARE_VM_OPTO_LIVE_HPP
stefank@2314 27
stefank@2314 28 #include "libadt/port.hpp"
stefank@2314 29 #include "libadt/vectset.hpp"
stefank@2314 30 #include "opto/block.hpp"
stefank@2314 31 #include "opto/indexSet.hpp"
stefank@2314 32 #include "opto/phase.hpp"
stefank@2314 33 #include "opto/regmask.hpp"
stefank@2314 34
duke@435 35 class Block;
duke@435 36 class LRG_List;
duke@435 37 class PhaseCFG;
duke@435 38 class VectorSet;
duke@435 39 class IndexSet;
duke@435 40
duke@435 41 //------------------------------PhaseLive--------------------------------------
duke@435 42 // Compute live-in/live-out
duke@435 43 class PhaseLive : public Phase {
duke@435 44 // Array of Sets of values live at the start of a block.
duke@435 45 // Indexed by block pre-order number.
duke@435 46 IndexSet *_live;
duke@435 47
duke@435 48 // Array of Sets of values defined locally in the block
duke@435 49 // Indexed by block pre-order number.
duke@435 50 IndexSet *_defs;
duke@435 51
duke@435 52 // Array of delta-set pointers, indexed by block pre-order number
duke@435 53 IndexSet **_deltas;
duke@435 54 IndexSet *_free_IndexSet; // Free list of same
duke@435 55
duke@435 56 Block_List *_worklist; // Worklist for iterative solution
duke@435 57
duke@435 58 const PhaseCFG &_cfg; // Basic blocks
duke@435 59 LRG_List &_names; // Mapping from Nodes to live ranges
duke@435 60 uint _maxlrg; // Largest live-range number
duke@435 61 Arena *_arena;
duke@435 62
duke@435 63 IndexSet *getset( Block *p );
duke@435 64 IndexSet *getfreeset( );
duke@435 65 void freeset( const Block *p );
duke@435 66 void add_liveout( Block *p, uint r, VectorSet &first_pass );
duke@435 67 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );
duke@435 68
duke@435 69 public:
duke@435 70 PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena );
duke@435 71 ~PhaseLive() {}
duke@435 72 // Compute liveness info
duke@435 73 void compute(uint maxlrg);
duke@435 74 // Reset arena storage
duke@435 75 void reset() { _live = NULL; }
duke@435 76
duke@435 77 // Return the live-out set for this block
duke@435 78 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; }
duke@435 79
duke@435 80 #ifndef PRODUCT
duke@435 81 void dump( const Block *b ) const;
duke@435 82 void stats(uint iters) const;
duke@435 83 #endif
duke@435 84 };
stefank@2314 85
stefank@2314 86 #endif // SHARE_VM_OPTO_LIVE_HPP

mercurial