author | zmajo |
Tue, 30 Aug 2016 09:30:16 +0200 | |
changeset 41052 | 3362c4368286 |
parent 37248 | 11a660dbbb8e |
child 46620 | 750c6edff33b |
permissions | -rw-r--r-- |
1 | 1 |
/* |
37248 | 2 |
* Copyright (c) 2002, 2016, 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:
3261
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3261
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:
3261
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
22234
diff
changeset
|
26 |
#include "code/vmreg.inline.hpp" |
7397 | 27 |
#include "compiler/oopMap.hpp" |
37248 | 28 |
#include "memory/resourceArea.hpp" |
7397 | 29 |
#include "opto/addnode.hpp" |
30 |
#include "opto/callnode.hpp" |
|
31 |
#include "opto/compile.hpp" |
|
32 |
#include "opto/machnode.hpp" |
|
33 |
#include "opto/matcher.hpp" |
|
34 |
#include "opto/phase.hpp" |
|
35 |
#include "opto/regalloc.hpp" |
|
36 |
#include "opto/rootnode.hpp" |
|
1 | 37 |
|
38 |
// The functions in this file builds OopMaps after all scheduling is done. |
|
39 |
// |
|
40 |
// OopMaps contain a list of all registers and stack-slots containing oops (so |
|
41 |
// they can be updated by GC). OopMaps also contain a list of derived-pointer |
|
42 |
// base-pointer pairs. When the base is moved, the derived pointer moves to |
|
43 |
// follow it. Finally, any registers holding callee-save values are also |
|
44 |
// recorded. These might contain oops, but only the caller knows. |
|
45 |
// |
|
46 |
// BuildOopMaps implements a simple forward reaching-defs solution. At each |
|
47 |
// GC point we'll have the reaching-def Nodes. If the reaching Nodes are |
|
48 |
// typed as pointers (no offset), then they are oops. Pointers+offsets are |
|
49 |
// derived pointers, and bases can be found from them. Finally, we'll also |
|
50 |
// track reaching callee-save values. Note that a copy of a callee-save value |
|
51 |
// "kills" it's source, so that only 1 copy of a callee-save value is alive at |
|
52 |
// a time. |
|
53 |
// |
|
54 |
// We run a simple bitvector liveness pass to help trim out dead oops. Due to |
|
55 |
// irreducible loops, we can have a reaching def of an oop that only reaches |
|
56 |
// along one path and no way to know if it's valid or not on the other path. |
|
57 |
// The bitvectors are quite dense and the liveness pass is fast. |
|
58 |
// |
|
59 |
// At GC points, we consult this information to build OopMaps. All reaching |
|
60 |
// defs typed as oops are added to the OopMap. Only 1 instance of a |
|
61 |
// callee-save register can be recorded. For derived pointers, we'll have to |
|
62 |
// find and record the register holding the base. |
|
63 |
// |
|
64 |
// The reaching def's is a simple 1-pass worklist approach. I tried a clever |
|
65 |
// breadth-first approach but it was worse (showed O(n^2) in the |
|
66 |
// pick-next-block code). |
|
67 |
// |
|
2131 | 68 |
// The relevant data is kept in a struct of arrays (it could just as well be |
1 | 69 |
// an array of structs, but the struct-of-arrays is generally a little more |
70 |
// efficient). The arrays are indexed by register number (including |
|
71 |
// stack-slots as registers) and so is bounded by 200 to 300 elements in |
|
72 |
// practice. One array will map to a reaching def Node (or NULL for |
|
73 |
// conflict/dead). The other array will map to a callee-saved register or |
|
74 |
// OptoReg::Bad for not-callee-saved. |
|
75 |
||
76 |
||
77 |
// Structure to pass around |
|
78 |
struct OopFlow : public ResourceObj { |
|
79 |
short *_callees; // Array mapping register to callee-saved |
|
80 |
Node **_defs; // array mapping register to reaching def |
|
81 |
// or NULL if dead/conflict |
|
82 |
// OopFlow structs, when not being actively modified, describe the _end_ of |
|
83 |
// this block. |
|
84 |
Block *_b; // Block for this struct |
|
85 |
OopFlow *_next; // Next free OopFlow |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
86 |
// or NULL if dead/conflict |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
87 |
Compile* C; |
1 | 88 |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
89 |
OopFlow( short *callees, Node **defs, Compile* c ) : _callees(callees), _defs(defs), |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
90 |
_b(NULL), _next(NULL), C(c) { } |
1 | 91 |
|
92 |
// Given reaching-defs for this block start, compute it for this block end |
|
93 |
void compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash ); |
|
94 |
||
95 |
// Merge these two OopFlows into the 'this' pointer. |
|
96 |
void merge( OopFlow *flow, int max_reg ); |
|
97 |
||
98 |
// Copy a 'flow' over an existing flow |
|
99 |
void clone( OopFlow *flow, int max_size); |
|
100 |
||
101 |
// Make a new OopFlow from scratch |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
102 |
static OopFlow *make( Arena *A, int max_size, Compile* C ); |
1 | 103 |
|
104 |
// Build an oopmap from the current flow info |
|
105 |
OopMap *build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live ); |
|
106 |
}; |
|
107 |
||
108 |
// Given reaching-defs for this block start, compute it for this block end |
|
109 |
void OopFlow::compute_reach( PhaseRegAlloc *regalloc, int max_reg, Dict *safehash ) { |
|
110 |
||
19717
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
111 |
for( uint i=0; i<_b->number_of_nodes(); i++ ) { |
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
112 |
Node *n = _b->get_node(i); |
1 | 113 |
|
114 |
if( n->jvms() ) { // Build an OopMap here? |
|
115 |
JVMState *jvms = n->jvms(); |
|
116 |
// no map needed for leaf calls |
|
117 |
if( n->is_MachSafePoint() && !n->is_MachCallLeaf() ) { |
|
118 |
int *live = (int*) (*safehash)[n]; |
|
119 |
assert( live, "must find live" ); |
|
120 |
n->as_MachSafePoint()->set_oop_map( build_oop_map(n,max_reg,regalloc, live) ); |
|
121 |
} |
|
122 |
} |
|
123 |
||
124 |
// Assign new reaching def's. |
|
125 |
// Note that I padded the _defs and _callees arrays so it's legal |
|
126 |
// to index at _defs[OptoReg::Bad]. |
|
127 |
OptoReg::Name first = regalloc->get_reg_first(n); |
|
128 |
OptoReg::Name second = regalloc->get_reg_second(n); |
|
129 |
_defs[first] = n; |
|
130 |
_defs[second] = n; |
|
131 |
||
132 |
// Pass callee-save info around copies |
|
133 |
int idx = n->is_Copy(); |
|
134 |
if( idx ) { // Copies move callee-save info |
|
135 |
OptoReg::Name old_first = regalloc->get_reg_first(n->in(idx)); |
|
136 |
OptoReg::Name old_second = regalloc->get_reg_second(n->in(idx)); |
|
137 |
int tmp_first = _callees[old_first]; |
|
138 |
int tmp_second = _callees[old_second]; |
|
139 |
_callees[old_first] = OptoReg::Bad; // callee-save is moved, dead in old location |
|
140 |
_callees[old_second] = OptoReg::Bad; |
|
141 |
_callees[first] = tmp_first; |
|
142 |
_callees[second] = tmp_second; |
|
143 |
} else if( n->is_Phi() ) { // Phis do not mod callee-saves |
|
144 |
assert( _callees[first] == _callees[regalloc->get_reg_first(n->in(1))], "" ); |
|
145 |
assert( _callees[second] == _callees[regalloc->get_reg_second(n->in(1))], "" ); |
|
146 |
assert( _callees[first] == _callees[regalloc->get_reg_first(n->in(n->req()-1))], "" ); |
|
147 |
assert( _callees[second] == _callees[regalloc->get_reg_second(n->in(n->req()-1))], "" ); |
|
148 |
} else { |
|
149 |
_callees[first] = OptoReg::Bad; // No longer holding a callee-save value |
|
150 |
_callees[second] = OptoReg::Bad; |
|
151 |
||
152 |
// Find base case for callee saves |
|
153 |
if( n->is_Proj() && n->in(0)->is_Start() ) { |
|
154 |
if( OptoReg::is_reg(first) && |
|
155 |
regalloc->_matcher.is_save_on_entry(first) ) |
|
156 |
_callees[first] = first; |
|
157 |
if( OptoReg::is_reg(second) && |
|
158 |
regalloc->_matcher.is_save_on_entry(second) ) |
|
159 |
_callees[second] = second; |
|
160 |
} |
|
161 |
} |
|
162 |
} |
|
163 |
} |
|
164 |
||
165 |
// Merge the given flow into the 'this' flow |
|
166 |
void OopFlow::merge( OopFlow *flow, int max_reg ) { |
|
167 |
assert( _b == NULL, "merging into a happy flow" ); |
|
168 |
assert( flow->_b, "this flow is still alive" ); |
|
169 |
assert( flow != this, "no self flow" ); |
|
170 |
||
171 |
// Do the merge. If there are any differences, drop to 'bottom' which |
|
172 |
// is OptoReg::Bad or NULL depending. |
|
173 |
for( int i=0; i<max_reg; i++ ) { |
|
174 |
// Merge the callee-save's |
|
175 |
if( _callees[i] != flow->_callees[i] ) |
|
176 |
_callees[i] = OptoReg::Bad; |
|
177 |
// Merge the reaching defs |
|
178 |
if( _defs[i] != flow->_defs[i] ) |
|
179 |
_defs[i] = NULL; |
|
180 |
} |
|
181 |
||
182 |
} |
|
183 |
||
184 |
void OopFlow::clone( OopFlow *flow, int max_size ) { |
|
185 |
_b = flow->_b; |
|
186 |
memcpy( _callees, flow->_callees, sizeof(short)*max_size); |
|
187 |
memcpy( _defs , flow->_defs , sizeof(Node*)*max_size); |
|
188 |
} |
|
189 |
||
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
190 |
OopFlow *OopFlow::make( Arena *A, int max_size, Compile* C ) { |
1 | 191 |
short *callees = NEW_ARENA_ARRAY(A,short,max_size+1); |
192 |
Node **defs = NEW_ARENA_ARRAY(A,Node*,max_size+1); |
|
193 |
debug_only( memset(defs,0,(max_size+1)*sizeof(Node*)) ); |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
194 |
OopFlow *flow = new (A) OopFlow(callees+1, defs+1, C); |
1 | 195 |
assert( &flow->_callees[OptoReg::Bad] == callees, "Ok to index at OptoReg::Bad" ); |
196 |
assert( &flow->_defs [OptoReg::Bad] == defs , "Ok to index at OptoReg::Bad" ); |
|
197 |
return flow; |
|
198 |
} |
|
199 |
||
200 |
static int get_live_bit( int *live, int reg ) { |
|
201 |
return live[reg>>LogBitsPerInt] & (1<<(reg&(BitsPerInt-1))); } |
|
202 |
static void set_live_bit( int *live, int reg ) { |
|
203 |
live[reg>>LogBitsPerInt] |= (1<<(reg&(BitsPerInt-1))); } |
|
204 |
static void clr_live_bit( int *live, int reg ) { |
|
205 |
live[reg>>LogBitsPerInt] &= ~(1<<(reg&(BitsPerInt-1))); } |
|
206 |
||
207 |
// Build an oopmap from the current flow info |
|
208 |
OopMap *OopFlow::build_oop_map( Node *n, int max_reg, PhaseRegAlloc *regalloc, int* live ) { |
|
209 |
int framesize = regalloc->_framesize; |
|
210 |
int max_inarg_slot = OptoReg::reg2stack(regalloc->_matcher._new_SP); |
|
211 |
debug_only( char *dup_check = NEW_RESOURCE_ARRAY(char,OptoReg::stack0()); |
|
212 |
memset(dup_check,0,OptoReg::stack0()) ); |
|
213 |
||
214 |
OopMap *omap = new OopMap( framesize, max_inarg_slot ); |
|
215 |
MachCallNode *mcall = n->is_MachCall() ? n->as_MachCall() : NULL; |
|
216 |
JVMState* jvms = n->jvms(); |
|
217 |
||
218 |
// For all registers do... |
|
219 |
for( int reg=0; reg<max_reg; reg++ ) { |
|
220 |
if( get_live_bit(live,reg) == 0 ) |
|
221 |
continue; // Ignore if not live |
|
222 |
||
223 |
// %%% C2 can use 2 OptoRegs when the physical register is only one 64bit |
|
224 |
// register in that case we'll get an non-concrete register for the second |
|
225 |
// half. We only need to tell the map the register once! |
|
226 |
// |
|
227 |
// However for the moment we disable this change and leave things as they |
|
228 |
// were. |
|
229 |
||
230 |
VMReg r = OptoReg::as_VMReg(OptoReg::Name(reg), framesize, max_inarg_slot); |
|
231 |
||
232 |
if (false && r->is_reg() && !r->is_concrete()) { |
|
233 |
continue; |
|
234 |
} |
|
235 |
||
236 |
// See if dead (no reaching def). |
|
237 |
Node *def = _defs[reg]; // Get reaching def |
|
238 |
assert( def, "since live better have reaching def" ); |
|
239 |
||
240 |
// Classify the reaching def as oop, derived, callee-save, dead, or other |
|
241 |
const Type *t = def->bottom_type(); |
|
242 |
if( t->isa_oop_ptr() ) { // Oop or derived? |
|
243 |
assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" ); |
|
244 |
#ifdef _LP64 |
|
245 |
// 64-bit pointers record oop-ishness on 2 aligned adjacent registers. |
|
246 |
// Make sure both are record from the same reaching def, but do not |
|
247 |
// put both into the oopmap. |
|
248 |
if( (reg&1) == 1 ) { // High half of oop-pair? |
|
249 |
assert( _defs[reg-1] == _defs[reg], "both halves from same reaching def" ); |
|
250 |
continue; // Do not record high parts in oopmap |
|
251 |
} |
|
252 |
#endif |
|
253 |
||
254 |
// Check for a legal reg name in the oopMap and bailout if it is not. |
|
255 |
if (!omap->legal_vm_reg_name(r)) { |
|
256 |
regalloc->C->record_method_not_compilable("illegal oopMap register name"); |
|
257 |
continue; |
|
258 |
} |
|
259 |
if( t->is_ptr()->_offset == 0 ) { // Not derived? |
|
260 |
if( mcall ) { |
|
261 |
// Outgoing argument GC mask responsibility belongs to the callee, |
|
262 |
// not the caller. Inspect the inputs to the call, to see if |
|
263 |
// this live-range is one of them. |
|
264 |
uint cnt = mcall->tf()->domain()->cnt(); |
|
265 |
uint j; |
|
266 |
for( j = TypeFunc::Parms; j < cnt; j++) |
|
267 |
if( mcall->in(j) == def ) |
|
268 |
break; // reaching def is an argument oop |
|
269 |
if( j < cnt ) // arg oops dont go in GC map |
|
270 |
continue; // Continue on to the next register |
|
271 |
} |
|
272 |
omap->set_oop(r); |
|
273 |
} else { // Else it's derived. |
|
274 |
// Find the base of the derived value. |
|
275 |
uint i; |
|
276 |
// Fast, common case, scan |
|
277 |
for( i = jvms->oopoff(); i < n->req(); i+=2 ) |
|
278 |
if( n->in(i) == def ) break; // Common case |
|
279 |
if( i == n->req() ) { // Missed, try a more generous scan |
|
280 |
// Scan again, but this time peek through copies |
|
281 |
for( i = jvms->oopoff(); i < n->req(); i+=2 ) { |
|
282 |
Node *m = n->in(i); // Get initial derived value |
|
283 |
while( 1 ) { |
|
284 |
Node *d = def; // Get initial reaching def |
|
285 |
while( 1 ) { // Follow copies of reaching def to end |
|
286 |
if( m == d ) goto found; // breaks 3 loops |
|
287 |
int idx = d->is_Copy(); |
|
288 |
if( !idx ) break; |
|
289 |
d = d->in(idx); // Link through copy |
|
290 |
} |
|
291 |
int idx = m->is_Copy(); |
|
292 |
if( !idx ) break; |
|
293 |
m = m->in(idx); |
|
294 |
} |
|
295 |
} |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
296 |
guarantee( 0, "must find derived/base pair" ); |
1 | 297 |
} |
298 |
found: ; |
|
299 |
Node *base = n->in(i+1); // Base is other half of pair |
|
300 |
int breg = regalloc->get_reg_first(base); |
|
301 |
VMReg b = OptoReg::as_VMReg(OptoReg::Name(breg), framesize, max_inarg_slot); |
|
302 |
||
303 |
// I record liveness at safepoints BEFORE I make the inputs |
|
304 |
// live. This is because argument oops are NOT live at a |
|
305 |
// safepoint (or at least they cannot appear in the oopmap). |
|
306 |
// Thus bases of base/derived pairs might not be in the |
|
307 |
// liveness data but they need to appear in the oopmap. |
|
308 |
if( get_live_bit(live,breg) == 0 ) {// Not live? |
|
309 |
// Flag it, so next derived pointer won't re-insert into oopmap |
|
310 |
set_live_bit(live,breg); |
|
311 |
// Already missed our turn? |
|
312 |
if( breg < reg ) { |
|
313 |
if (b->is_stack() || b->is_concrete() || true ) { |
|
314 |
omap->set_oop( b); |
|
315 |
} |
|
316 |
} |
|
317 |
} |
|
318 |
if (b->is_stack() || b->is_concrete() || true ) { |
|
319 |
omap->set_derived_oop( r, b); |
|
320 |
} |
|
321 |
} |
|
322 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
323 |
} else if( t->isa_narrowoop() ) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
324 |
assert( !OptoReg::is_valid(_callees[reg]), "oop can't be callee save" ); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
325 |
// Check for a legal reg name in the oopMap and bailout if it is not. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
326 |
if (!omap->legal_vm_reg_name(r)) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
327 |
regalloc->C->record_method_not_compilable("illegal oopMap register name"); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
328 |
continue; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
329 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
330 |
if( mcall ) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
331 |
// Outgoing argument GC mask responsibility belongs to the callee, |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
332 |
// not the caller. Inspect the inputs to the call, to see if |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
333 |
// this live-range is one of them. |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
334 |
uint cnt = mcall->tf()->domain()->cnt(); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
335 |
uint j; |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
336 |
for( j = TypeFunc::Parms; j < cnt; j++) |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
337 |
if( mcall->in(j) == def ) |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
338 |
break; // reaching def is an argument oop |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
339 |
if( j < cnt ) // arg oops dont go in GC map |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
340 |
continue; // Continue on to the next register |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
341 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
342 |
omap->set_narrowoop(r); |
1 | 343 |
} else if( OptoReg::is_valid(_callees[reg])) { // callee-save? |
344 |
// It's a callee-save value |
|
345 |
assert( dup_check[_callees[reg]]==0, "trying to callee save same reg twice" ); |
|
346 |
debug_only( dup_check[_callees[reg]]=1; ) |
|
347 |
VMReg callee = OptoReg::as_VMReg(OptoReg::Name(_callees[reg])); |
|
348 |
if ( callee->is_concrete() || true ) { |
|
349 |
omap->set_callee_saved( r, callee); |
|
350 |
} |
|
351 |
||
352 |
} else { |
|
353 |
// Other - some reaching non-oop value |
|
354 |
omap->set_value( r); |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
355 |
#ifdef ASSERT |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
356 |
if( t->isa_rawptr() && C->cfg()->_raw_oops.member(def) ) { |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
357 |
def->dump(); |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
358 |
n->dump(); |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
359 |
assert(false, "there should be a oop in OopMap instead of a live raw oop at safepoint"); |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
360 |
} |
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
361 |
#endif |
1 | 362 |
} |
363 |
||
364 |
} |
|
365 |
||
366 |
#ifdef ASSERT |
|
367 |
/* Nice, Intel-only assert |
|
368 |
int cnt_callee_saves=0; |
|
369 |
int reg2 = 0; |
|
370 |
while (OptoReg::is_reg(reg2)) { |
|
371 |
if( dup_check[reg2] != 0) cnt_callee_saves++; |
|
372 |
assert( cnt_callee_saves==3 || cnt_callee_saves==5, "missed some callee-save" ); |
|
373 |
reg2++; |
|
374 |
} |
|
375 |
*/ |
|
376 |
#endif |
|
377 |
||
2573
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
378 |
#ifdef ASSERT |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
379 |
for( OopMapStream oms1(omap, OopMapValue::derived_oop_value); !oms1.is_done(); oms1.next()) { |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
380 |
OopMapValue omv1 = oms1.current(); |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
381 |
bool found = false; |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
382 |
for( OopMapStream oms2(omap,OopMapValue::oop_value); !oms2.is_done(); oms2.next()) { |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
383 |
if( omv1.content_reg() == oms2.current().reg() ) { |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
384 |
found = true; |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
385 |
break; |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
386 |
} |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
387 |
} |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
388 |
assert( found, "derived with no base in oopmap" ); |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
389 |
} |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
390 |
#endif |
b5002ef26155
6709742: find_base_for_derived's use of Ideal NULL is unsafe causing crashes during register allocation
kvn
parents:
2131
diff
changeset
|
391 |
|
1 | 392 |
return omap; |
393 |
} |
|
394 |
||
395 |
// Compute backwards liveness on registers |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
396 |
static void do_liveness(PhaseRegAlloc* regalloc, PhaseCFG* cfg, Block_List* worklist, int max_reg_ints, Arena* A, Dict* safehash) { |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
397 |
int* live = NEW_ARENA_ARRAY(A, int, (cfg->number_of_blocks() + 1) * max_reg_ints); |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
398 |
int* tmp_live = &live[cfg->number_of_blocks() * max_reg_ints]; |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
399 |
Node* root = cfg->get_root_node(); |
1 | 400 |
// On CISC platforms, get the node representing the stack pointer that regalloc |
401 |
// used for spills |
|
402 |
Node *fp = NodeSentinel; |
|
403 |
if (UseCISCSpill && root->req() > 1) { |
|
404 |
fp = root->in(1)->in(TypeFunc::FramePtr); |
|
405 |
} |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
406 |
memset(live, 0, cfg->number_of_blocks() * (max_reg_ints << LogBytesPerInt)); |
1 | 407 |
// Push preds onto worklist |
19279 | 408 |
for (uint i = 1; i < root->req(); i++) { |
409 |
Block* block = cfg->get_block_for_node(root->in(i)); |
|
410 |
worklist->push(block); |
|
411 |
} |
|
1 | 412 |
|
413 |
// ZKM.jar includes tiny infinite loops which are unreached from below. |
|
414 |
// If we missed any blocks, we'll retry here after pushing all missed |
|
415 |
// blocks on the worklist. Normally this outer loop never trips more |
|
416 |
// than once. |
|
19279 | 417 |
while (1) { |
1 | 418 |
|
419 |
while( worklist->size() ) { // Standard worklist algorithm |
|
420 |
Block *b = worklist->rpop(); |
|
421 |
||
422 |
// Copy first successor into my tmp_live space |
|
423 |
int s0num = b->_succs[0]->_pre_order; |
|
424 |
int *t = &live[s0num*max_reg_ints]; |
|
425 |
for( int i=0; i<max_reg_ints; i++ ) |
|
426 |
tmp_live[i] = t[i]; |
|
427 |
||
428 |
// OR in the remaining live registers |
|
429 |
for( uint j=1; j<b->_num_succs; j++ ) { |
|
430 |
uint sjnum = b->_succs[j]->_pre_order; |
|
431 |
int *t = &live[sjnum*max_reg_ints]; |
|
432 |
for( int i=0; i<max_reg_ints; i++ ) |
|
433 |
tmp_live[i] |= t[i]; |
|
434 |
} |
|
435 |
||
436 |
// Now walk tmp_live up the block backwards, computing live |
|
19717
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
437 |
for( int k=b->number_of_nodes()-1; k>=0; k-- ) { |
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
438 |
Node *n = b->get_node(k); |
1 | 439 |
// KILL def'd bits |
440 |
int first = regalloc->get_reg_first(n); |
|
441 |
int second = regalloc->get_reg_second(n); |
|
442 |
if( OptoReg::is_valid(first) ) clr_live_bit(tmp_live,first); |
|
443 |
if( OptoReg::is_valid(second) ) clr_live_bit(tmp_live,second); |
|
444 |
||
445 |
MachNode *m = n->is_Mach() ? n->as_Mach() : NULL; |
|
446 |
||
447 |
// Check if m is potentially a CISC alternate instruction (i.e, possibly |
|
448 |
// synthesized by RegAlloc from a conventional instruction and a |
|
449 |
// spilled input) |
|
450 |
bool is_cisc_alternate = false; |
|
451 |
if (UseCISCSpill && m) { |
|
452 |
is_cisc_alternate = m->is_cisc_alternate(); |
|
453 |
} |
|
454 |
||
455 |
// GEN use'd bits |
|
456 |
for( uint l=1; l<n->req(); l++ ) { |
|
457 |
Node *def = n->in(l); |
|
458 |
assert(def != 0, "input edge required"); |
|
459 |
int first = regalloc->get_reg_first(def); |
|
460 |
int second = regalloc->get_reg_second(def); |
|
461 |
if( OptoReg::is_valid(first) ) set_live_bit(tmp_live,first); |
|
462 |
if( OptoReg::is_valid(second) ) set_live_bit(tmp_live,second); |
|
463 |
// If we use the stack pointer in a cisc-alternative instruction, |
|
464 |
// check for use as a memory operand. Then reconstruct the RegName |
|
465 |
// for this stack location, and set the appropriate bit in the |
|
466 |
// live vector 4987749. |
|
467 |
if (is_cisc_alternate && def == fp) { |
|
468 |
const TypePtr *adr_type = NULL; |
|
469 |
intptr_t offset; |
|
470 |
const Node* base = m->get_base_and_disp(offset, adr_type); |
|
471 |
if (base == NodeSentinel) { |
|
472 |
// Machnode has multiple memory inputs. We are unable to reason |
|
473 |
// with these, but are presuming (with trepidation) that not any of |
|
474 |
// them are oops. This can be fixed by making get_base_and_disp() |
|
475 |
// look at a specific input instead of all inputs. |
|
476 |
assert(!def->bottom_type()->isa_oop_ptr(), "expecting non-oop mem input"); |
|
477 |
} else if (base != fp || offset == Type::OffsetBot) { |
|
478 |
// Do nothing: the fp operand is either not from a memory use |
|
479 |
// (base == NULL) OR the fp is used in a non-memory context |
|
480 |
// (base is some other register) OR the offset is not constant, |
|
481 |
// so it is not a stack slot. |
|
482 |
} else { |
|
483 |
assert(offset >= 0, "unexpected negative offset"); |
|
484 |
offset -= (offset % jintSize); // count the whole word |
|
485 |
int stack_reg = regalloc->offset2reg(offset); |
|
486 |
if (OptoReg::is_stack(stack_reg)) { |
|
487 |
set_live_bit(tmp_live, stack_reg); |
|
488 |
} else { |
|
489 |
assert(false, "stack_reg not on stack?"); |
|
490 |
} |
|
491 |
} |
|
492 |
} |
|
493 |
} |
|
494 |
||
495 |
if( n->jvms() ) { // Record liveness at safepoint |
|
496 |
||
497 |
// This placement of this stanza means inputs to calls are |
|
498 |
// considered live at the callsite's OopMap. Argument oops are |
|
499 |
// hence live, but NOT included in the oopmap. See cutout in |
|
500 |
// build_oop_map. Debug oops are live (and in OopMap). |
|
501 |
int *n_live = NEW_ARENA_ARRAY(A, int, max_reg_ints); |
|
502 |
for( int l=0; l<max_reg_ints; l++ ) |
|
503 |
n_live[l] = tmp_live[l]; |
|
504 |
safehash->Insert(n,n_live); |
|
505 |
} |
|
506 |
||
507 |
} |
|
508 |
||
509 |
// Now at block top, see if we have any changes. If so, propagate |
|
510 |
// to prior blocks. |
|
511 |
int *old_live = &live[b->_pre_order*max_reg_ints]; |
|
512 |
int l; |
|
513 |
for( l=0; l<max_reg_ints; l++ ) |
|
514 |
if( tmp_live[l] != old_live[l] ) |
|
515 |
break; |
|
516 |
if( l<max_reg_ints ) { // Change! |
|
517 |
// Copy in new value |
|
518 |
for( l=0; l<max_reg_ints; l++ ) |
|
519 |
old_live[l] = tmp_live[l]; |
|
520 |
// Push preds onto worklist |
|
19279 | 521 |
for (l = 1; l < (int)b->num_preds(); l++) { |
522 |
Block* block = cfg->get_block_for_node(b->pred(l)); |
|
523 |
worklist->push(block); |
|
524 |
} |
|
1 | 525 |
} |
526 |
} |
|
527 |
||
528 |
// Scan for any missing safepoints. Happens to infinite loops |
|
529 |
// ala ZKM.jar |
|
530 |
uint i; |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
531 |
for (i = 1; i < cfg->number_of_blocks(); i++) { |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
532 |
Block* block = cfg->get_block(i); |
1 | 533 |
uint j; |
19717
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
534 |
for (j = 1; j < block->number_of_nodes(); j++) { |
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
535 |
if (block->get_node(j)->jvms() && (*safehash)[block->get_node(j)] == NULL) { |
1 | 536 |
break; |
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
537 |
} |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
538 |
} |
19717
7819ffdaf0ff
8023691: Create interface for nodes in class Block
adlertz
parents:
19330
diff
changeset
|
539 |
if (j < block->number_of_nodes()) { |
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
540 |
break; |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
541 |
} |
1 | 542 |
} |
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
543 |
if (i == cfg->number_of_blocks()) { |
1 | 544 |
break; // Got 'em all |
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
545 |
} |
34174
4db2fb26dc49
8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents:
26913
diff
changeset
|
546 |
|
4db2fb26dc49
8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents:
26913
diff
changeset
|
547 |
if (PrintOpto && Verbose) { |
1 | 548 |
tty->print_cr("retripping live calc"); |
34174
4db2fb26dc49
8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents:
26913
diff
changeset
|
549 |
} |
4db2fb26dc49
8140424: don't prefix developer and notproduct flag variables with CONST_ in product builds
twisti
parents:
26913
diff
changeset
|
550 |
|
1 | 551 |
// Force the issue (expensively): recheck everybody |
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
552 |
for (i = 1; i < cfg->number_of_blocks(); i++) { |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
553 |
worklist->push(cfg->get_block(i)); |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
554 |
} |
1 | 555 |
} |
556 |
} |
|
557 |
||
558 |
// Collect GC mask info - where are all the OOPs? |
|
559 |
void Compile::BuildOopMaps() { |
|
26913 | 560 |
TracePhase tp("bldOopMaps", &timers[_t_buildOopMaps]); |
1 | 561 |
// Can't resource-mark because I need to leave all those OopMaps around, |
562 |
// or else I need to resource-mark some arena other than the default. |
|
563 |
// ResourceMark rm; // Reclaim all OopFlows when done |
|
564 |
int max_reg = _regalloc->_max_reg; // Current array extent |
|
565 |
||
566 |
Arena *A = Thread::current()->resource_area(); |
|
567 |
Block_List worklist; // Worklist of pending blocks |
|
568 |
||
569 |
int max_reg_ints = round_to(max_reg, BitsPerInt)>>LogBitsPerInt; |
|
570 |
Dict *safehash = NULL; // Used for assert only |
|
571 |
// Compute a backwards liveness per register. Needs a bitarray of |
|
572 |
// #blocks x (#registers, rounded up to ints) |
|
573 |
safehash = new Dict(cmpkey,hashkey,A); |
|
574 |
do_liveness( _regalloc, _cfg, &worklist, max_reg_ints, A, safehash ); |
|
575 |
OopFlow *free_list = NULL; // Free, unused |
|
576 |
||
577 |
// Array mapping blocks to completed oopflows |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
578 |
OopFlow **flows = NEW_ARENA_ARRAY(A, OopFlow*, _cfg->number_of_blocks()); |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
579 |
memset( flows, 0, _cfg->number_of_blocks() * sizeof(OopFlow*) ); |
1 | 580 |
|
581 |
||
582 |
// Do the first block 'by hand' to prime the worklist |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
583 |
Block *entry = _cfg->get_block(1); |
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
584 |
OopFlow *rootflow = OopFlow::make(A,max_reg,this); |
1 | 585 |
// Initialize to 'bottom' (not 'top') |
586 |
memset( rootflow->_callees, OptoReg::Bad, max_reg*sizeof(short) ); |
|
587 |
memset( rootflow->_defs , 0, max_reg*sizeof(Node*) ); |
|
588 |
flows[entry->_pre_order] = rootflow; |
|
589 |
||
590 |
// Do the first block 'by hand' to prime the worklist |
|
591 |
rootflow->_b = entry; |
|
592 |
rootflow->compute_reach( _regalloc, max_reg, safehash ); |
|
593 |
for( uint i=0; i<entry->_num_succs; i++ ) |
|
594 |
worklist.push(entry->_succs[i]); |
|
595 |
||
596 |
// Now worklist contains blocks which have some, but perhaps not all, |
|
597 |
// predecessors visited. |
|
598 |
while( worklist.size() ) { |
|
599 |
// Scan for a block with all predecessors visited, or any randoms slob |
|
600 |
// otherwise. All-preds-visited order allows me to recycle OopFlow |
|
601 |
// structures rapidly and cut down on the memory footprint. |
|
602 |
// Note: not all predecessors might be visited yet (must happen for |
|
603 |
// irreducible loops). This is OK, since every live value must have the |
|
604 |
// SAME reaching def for the block, so any reaching def is OK. |
|
605 |
uint i; |
|
606 |
||
607 |
Block *b = worklist.pop(); |
|
608 |
// Ignore root block |
|
19330
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
609 |
if (b == _cfg->get_root_block()) { |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
610 |
continue; |
49d6711171e6
8023003: Cleanup the public interface to PhaseCFG
adlertz
parents:
19279
diff
changeset
|
611 |
} |
1 | 612 |
// Block is already done? Happens if block has several predecessors, |
613 |
// he can get on the worklist more than once. |
|
614 |
if( flows[b->_pre_order] ) continue; |
|
615 |
||
616 |
// If this block has a visited predecessor AND that predecessor has this |
|
617 |
// last block as his only undone child, we can move the OopFlow from the |
|
618 |
// pred to this block. Otherwise we have to grab a new OopFlow. |
|
619 |
OopFlow *flow = NULL; // Flag for finding optimized flow |
|
620 |
Block *pred = (Block*)0xdeadbeef; |
|
621 |
// Scan this block's preds to find a done predecessor |
|
19279 | 622 |
for (uint j = 1; j < b->num_preds(); j++) { |
623 |
Block* p = _cfg->get_block_for_node(b->pred(j)); |
|
1 | 624 |
OopFlow *p_flow = flows[p->_pre_order]; |
625 |
if( p_flow ) { // Predecessor is done |
|
626 |
assert( p_flow->_b == p, "cross check" ); |
|
627 |
pred = p; // Record some predecessor |
|
628 |
// If all successors of p are done except for 'b', then we can carry |
|
629 |
// p_flow forward to 'b' without copying, otherwise we have to draw |
|
630 |
// from the free_list and clone data. |
|
631 |
uint k; |
|
632 |
for( k=0; k<p->_num_succs; k++ ) |
|
633 |
if( !flows[p->_succs[k]->_pre_order] && |
|
634 |
p->_succs[k] != b ) |
|
635 |
break; |
|
636 |
||
637 |
// Either carry-forward the now-unused OopFlow for b's use |
|
638 |
// or draw a new one from the free list |
|
639 |
if( k==p->_num_succs ) { |
|
640 |
flow = p_flow; |
|
641 |
break; // Found an ideal pred, use him |
|
642 |
} |
|
643 |
} |
|
644 |
} |
|
645 |
||
646 |
if( flow ) { |
|
647 |
// We have an OopFlow that's the last-use of a predecessor. |
|
648 |
// Carry it forward. |
|
649 |
} else { // Draw a new OopFlow from the freelist |
|
650 |
if( !free_list ) |
|
3186
11ba3d09bd0e
6840775: Multiple JVM crashes seen with 1.6.0_10 through 1.6.0_14
kvn
parents:
2573
diff
changeset
|
651 |
free_list = OopFlow::make(A,max_reg,C); |
1 | 652 |
flow = free_list; |
653 |
assert( flow->_b == NULL, "oopFlow is not free" ); |
|
654 |
free_list = flow->_next; |
|
655 |
flow->_next = NULL; |
|
656 |
||
657 |
// Copy/clone over the data |
|
658 |
flow->clone(flows[pred->_pre_order], max_reg); |
|
659 |
} |
|
660 |
||
661 |
// Mark flow for block. Blocks can only be flowed over once, |
|
662 |
// because after the first time they are guarded from entering |
|
663 |
// this code again. |
|
664 |
assert( flow->_b == pred, "have some prior flow" ); |
|
665 |
flow->_b = NULL; |
|
666 |
||
667 |
// Now push flow forward |
|
668 |
flows[b->_pre_order] = flow;// Mark flow for this block |
|
669 |
flow->_b = b; |
|
670 |
flow->compute_reach( _regalloc, max_reg, safehash ); |
|
671 |
||
672 |
// Now push children onto worklist |
|
673 |
for( i=0; i<b->_num_succs; i++ ) |
|
674 |
worklist.push(b->_succs[i]); |
|
675 |
||
676 |
} |
|
677 |
} |