1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/opto/live.hpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,74 @@ 1.4 +/* 1.5 + * Copyright 1997-2005 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +class Block; 1.29 +class LRG_List; 1.30 +class PhaseCFG; 1.31 +class VectorSet; 1.32 +class IndexSet; 1.33 + 1.34 +//------------------------------PhaseLive-------------------------------------- 1.35 +// Compute live-in/live-out 1.36 +class PhaseLive : public Phase { 1.37 + // Array of Sets of values live at the start of a block. 1.38 + // Indexed by block pre-order number. 1.39 + IndexSet *_live; 1.40 + 1.41 + // Array of Sets of values defined locally in the block 1.42 + // Indexed by block pre-order number. 1.43 + IndexSet *_defs; 1.44 + 1.45 + // Array of delta-set pointers, indexed by block pre-order number 1.46 + IndexSet **_deltas; 1.47 + IndexSet *_free_IndexSet; // Free list of same 1.48 + 1.49 + Block_List *_worklist; // Worklist for iterative solution 1.50 + 1.51 + const PhaseCFG &_cfg; // Basic blocks 1.52 + LRG_List &_names; // Mapping from Nodes to live ranges 1.53 + uint _maxlrg; // Largest live-range number 1.54 + Arena *_arena; 1.55 + 1.56 + IndexSet *getset( Block *p ); 1.57 + IndexSet *getfreeset( ); 1.58 + void freeset( const Block *p ); 1.59 + void add_liveout( Block *p, uint r, VectorSet &first_pass ); 1.60 + void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); 1.61 + 1.62 +public: 1.63 + PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena ); 1.64 + ~PhaseLive() {} 1.65 + // Compute liveness info 1.66 + void compute(uint maxlrg); 1.67 + // Reset arena storage 1.68 + void reset() { _live = NULL; } 1.69 + 1.70 + // Return the live-out set for this block 1.71 + IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; } 1.72 + 1.73 +#ifndef PRODUCT 1.74 + void dump( const Block *b ) const; 1.75 + void stats(uint iters) const; 1.76 +#endif 1.77 +};