1 /*
2 * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 class Block;
26 class LRG_List;
27 class PhaseCFG;
28 class VectorSet;
29 class IndexSet;
30
31 //------------------------------PhaseLive--------------------------------------
32 // Compute live-in/live-out
33 class PhaseLive : public Phase {
34 // Array of Sets of values live at the start of a block.
35 // Indexed by block pre-order number.
36 IndexSet *_live;
37
38 // Array of Sets of values defined locally in the block
39 // Indexed by block pre-order number.
40 IndexSet *_defs;
41
42 // Array of delta-set pointers, indexed by block pre-order number
43 IndexSet **_deltas;
44 IndexSet *_free_IndexSet; // Free list of same
55 void freeset( const Block *p );
56 void add_liveout( Block *p, uint r, VectorSet &first_pass );
57 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );
58
59 public:
60 PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena );
61 ~PhaseLive() {}
62 // Compute liveness info
63 void compute(uint maxlrg);
64 // Reset arena storage
65 void reset() { _live = NULL; }
66
67 // Return the live-out set for this block
68 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; }
69
70 #ifndef PRODUCT
71 void dump( const Block *b ) const;
72 void stats(uint iters) const;
73 #endif
74 };
|
1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_OPTO_LIVE_HPP
26 #define SHARE_VM_OPTO_LIVE_HPP
27
28 #include "libadt/port.hpp"
29 #include "libadt/vectset.hpp"
30 #include "opto/block.hpp"
31 #include "opto/indexSet.hpp"
32 #include "opto/phase.hpp"
33 #include "opto/regmask.hpp"
34
35 class Block;
36 class LRG_List;
37 class PhaseCFG;
38 class VectorSet;
39 class IndexSet;
40
41 //------------------------------PhaseLive--------------------------------------
42 // Compute live-in/live-out
43 class PhaseLive : public Phase {
44 // Array of Sets of values live at the start of a block.
45 // Indexed by block pre-order number.
46 IndexSet *_live;
47
48 // Array of Sets of values defined locally in the block
49 // Indexed by block pre-order number.
50 IndexSet *_defs;
51
52 // Array of delta-set pointers, indexed by block pre-order number
53 IndexSet **_deltas;
54 IndexSet *_free_IndexSet; // Free list of same
65 void freeset( const Block *p );
66 void add_liveout( Block *p, uint r, VectorSet &first_pass );
67 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );
68
69 public:
70 PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena );
71 ~PhaseLive() {}
72 // Compute liveness info
73 void compute(uint maxlrg);
74 // Reset arena storage
75 void reset() { _live = NULL; }
76
77 // Return the live-out set for this block
78 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; }
79
80 #ifndef PRODUCT
81 void dump( const Block *b ) const;
82 void stats(uint iters) const;
83 #endif
84 };
85
86 #endif // SHARE_VM_OPTO_LIVE_HPP
|