author | redestad |
Thu, 20 Dec 2018 19:44:08 +0100 | |
changeset 53091 | 5bf5b773fc41 |
parent 47216 | 71c04702a3d5 |
child 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
22234
da823d78ad65
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
20007
diff
changeset
|
2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_OPTO_LIVE_HPP |
26 |
#define SHARE_VM_OPTO_LIVE_HPP |
|
27 |
||
28 |
#include "libadt/vectset.hpp" |
|
29 |
#include "opto/block.hpp" |
|
30 |
#include "opto/indexSet.hpp" |
|
31 |
#include "opto/phase.hpp" |
|
32 |
#include "opto/regmask.hpp" |
|
33 |
||
1 | 34 |
class Block; |
35 |
class PhaseCFG; |
|
36 |
class VectorSet; |
|
37 |
class IndexSet; |
|
38 |
||
15944
095248beb690
8009721: Make PhaseLive independent from regalloc
neliasso
parents:
7397
diff
changeset
|
39 |
//------------------------------LRG_List--------------------------------------- |
095248beb690
8009721: Make PhaseLive independent from regalloc
neliasso
parents:
7397
diff
changeset
|
40 |
// Map Node indices to Live RanGe indices. |
095248beb690
8009721: Make PhaseLive independent from regalloc
neliasso
parents:
7397
diff
changeset
|
41 |
// Array lookup in the optimized case. |
20007
b67e71448544
8024646: Remove LRG_List container, replace it with GrowableArray
adlertz
parents:
17013
diff
changeset
|
42 |
typedef GrowableArray<uint> LRG_List; |
15944
095248beb690
8009721: Make PhaseLive independent from regalloc
neliasso
parents:
7397
diff
changeset
|
43 |
|
1 | 44 |
//------------------------------PhaseLive-------------------------------------- |
45 |
// Compute live-in/live-out |
|
46 |
class PhaseLive : public Phase { |
|
47 |
// Array of Sets of values live at the start of a block. |
|
48 |
// Indexed by block pre-order number. |
|
33065 | 49 |
IndexSet *_live; // live out |
50 |
IndexSet *_livein; // live in |
|
1 | 51 |
|
52 |
// Array of Sets of values defined locally in the block |
|
53 |
// Indexed by block pre-order number. |
|
54 |
IndexSet *_defs; |
|
55 |
||
56 |
// Array of delta-set pointers, indexed by block pre-order number |
|
57 |
IndexSet **_deltas; |
|
58 |
IndexSet *_free_IndexSet; // Free list of same |
|
59 |
||
60 |
Block_List *_worklist; // Worklist for iterative solution |
|
61 |
||
62 |
const PhaseCFG &_cfg; // Basic blocks |
|
17013 | 63 |
const LRG_List &_names; // Mapping from Nodes to live ranges |
1 | 64 |
uint _maxlrg; // Largest live-range number |
65 |
Arena *_arena; |
|
33065 | 66 |
bool _keep_deltas; // Retain live in information |
1 | 67 |
|
68 |
IndexSet *getset( Block *p ); |
|
69 |
IndexSet *getfreeset( ); |
|
33065 | 70 |
void freeset( Block *p ); |
1 | 71 |
void add_liveout( Block *p, uint r, VectorSet &first_pass ); |
72 |
void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ); |
|
33065 | 73 |
void add_livein( Block *p, IndexSet *lo ); |
1 | 74 |
|
75 |
public: |
|
33065 | 76 |
PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena, bool keep_deltas); |
1 | 77 |
~PhaseLive() {} |
78 |
// Compute liveness info |
|
79 |
void compute(uint maxlrg); |
|
80 |
// Reset arena storage |
|
81 |
void reset() { _live = NULL; } |
|
82 |
||
83 |
// Return the live-out set for this block |
|
84 |
IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; } |
|
33065 | 85 |
IndexSet *livein( const Block * b ) { return &_livein[b->_pre_order - 1]; } |
1 | 86 |
|
87 |
#ifndef PRODUCT |
|
88 |
void dump( const Block *b ) const; |
|
89 |
void stats(uint iters) const; |
|
90 |
#endif |
|
91 |
}; |
|
7397 | 92 |
|
93 |
#endif // SHARE_VM_OPTO_LIVE_HPP |