author | trims |
Thu, 27 May 2010 19:08:38 -0700 | |
changeset 5547 | f4b087cbb361 |
parent 2154 | 72a9b7284ccf |
child 7397 | 5b173b4ca846 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2154
diff
changeset
|
2 |
* Copyright (c) 1997, 2009, 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:
2154
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
2154
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:
2154
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
25 |
#include "incls/_precompiled.incl" |
|
26 |
#include "incls/_live.cpp.incl" |
|
27 |
||
28 |
||
29 |
||
30 |
//============================================================================= |
|
31 |
//------------------------------PhaseLive-------------------------------------- |
|
32 |
// Compute live-in/live-out. We use a totally incremental algorithm. The LIVE |
|
33 |
// problem is monotonic. The steady-state solution looks like this: pull a |
|
34 |
// block from the worklist. It has a set of delta's - values which are newly |
|
35 |
// live-in from the block. Push these to the live-out sets of all predecessor |
|
36 |
// blocks. At each predecessor, the new live-out values are ANDed with what is |
|
37 |
// already live-out (extra stuff is added to the live-out sets). Then the |
|
38 |
// remaining new live-out values are ANDed with what is locally defined. |
|
39 |
// Leftover bits become the new live-in for the predecessor block, and the pred |
|
40 |
// block is put on the worklist. |
|
41 |
// The locally live-in stuff is computed once and added to predecessor |
|
2131 | 42 |
// live-out sets. This separate compilation is done in the outer loop below. |
1 | 43 |
PhaseLive::PhaseLive( const PhaseCFG &cfg, LRG_List &names, Arena *arena ) : Phase(LIVE), _cfg(cfg), _names(names), _arena(arena), _live(0) { |
44 |
} |
|
45 |
||
46 |
void PhaseLive::compute(uint maxlrg) { |
|
47 |
_maxlrg = maxlrg; |
|
48 |
_worklist = new (_arena) Block_List(); |
|
49 |
||
50 |
// Init the sparse live arrays. This data is live on exit from here! |
|
51 |
// The _live info is the live-out info. |
|
52 |
_live = (IndexSet*)_arena->Amalloc(sizeof(IndexSet)*_cfg._num_blocks); |
|
53 |
uint i; |
|
54 |
for( i=0; i<_cfg._num_blocks; i++ ) { |
|
55 |
_live[i].initialize(_maxlrg); |
|
56 |
} |
|
57 |
||
58 |
// Init the sparse arrays for delta-sets. |
|
59 |
ResourceMark rm; // Nuke temp storage on exit |
|
60 |
||
61 |
// Does the memory used by _defs and _deltas get reclaimed? Does it matter? TT |
|
62 |
||
63 |
// Array of values defined locally in blocks |
|
64 |
_defs = NEW_RESOURCE_ARRAY(IndexSet,_cfg._num_blocks); |
|
65 |
for( i=0; i<_cfg._num_blocks; i++ ) { |
|
66 |
_defs[i].initialize(_maxlrg); |
|
67 |
} |
|
68 |
||
69 |
// Array of delta-set pointers, indexed by block pre_order-1. |
|
70 |
_deltas = NEW_RESOURCE_ARRAY(IndexSet*,_cfg._num_blocks); |
|
71 |
memset( _deltas, 0, sizeof(IndexSet*)* _cfg._num_blocks); |
|
72 |
||
73 |
_free_IndexSet = NULL; |
|
74 |
||
75 |
// Blocks having done pass-1 |
|
76 |
VectorSet first_pass(Thread::current()->resource_area()); |
|
77 |
||
78 |
// Outer loop: must compute local live-in sets and push into predecessors. |
|
79 |
uint iters = _cfg._num_blocks; // stat counters |
|
80 |
for( uint j=_cfg._num_blocks; j>0; j-- ) { |
|
81 |
Block *b = _cfg._blocks[j-1]; |
|
82 |
||
83 |
// Compute the local live-in set. Start with any new live-out bits. |
|
84 |
IndexSet *use = getset( b ); |
|
85 |
IndexSet *def = &_defs[b->_pre_order-1]; |
|
86 |
DEBUG_ONLY(IndexSet *def_outside = getfreeset();) |
|
87 |
uint i; |
|
88 |
for( i=b->_nodes.size(); i>1; i-- ) { |
|
89 |
Node *n = b->_nodes[i-1]; |
|
90 |
if( n->is_Phi() ) break; |
|
91 |
||
92 |
uint r = _names[n->_idx]; |
|
93 |
assert(!def_outside->member(r), "Use of external LRG overlaps the same LRG defined in this block"); |
|
94 |
def->insert( r ); |
|
95 |
use->remove( r ); |
|
96 |
uint cnt = n->req(); |
|
97 |
for( uint k=1; k<cnt; k++ ) { |
|
98 |
Node *nk = n->in(k); |
|
99 |
uint nkidx = nk->_idx; |
|
100 |
if( _cfg._bbs[nkidx] != b ) { |
|
101 |
uint u = _names[nkidx]; |
|
102 |
use->insert( u ); |
|
103 |
DEBUG_ONLY(def_outside->insert( u );) |
|
104 |
} |
|
105 |
} |
|
106 |
} |
|
107 |
#ifdef ASSERT |
|
108 |
def_outside->set_next(_free_IndexSet); |
|
109 |
_free_IndexSet = def_outside; // Drop onto free list |
|
110 |
#endif |
|
111 |
// Remove anything defined by Phis and the block start instruction |
|
112 |
for( uint k=i; k>0; k-- ) { |
|
113 |
uint r = _names[b->_nodes[k-1]->_idx]; |
|
114 |
def->insert( r ); |
|
115 |
use->remove( r ); |
|
116 |
} |
|
117 |
||
118 |
// Push these live-in things to predecessors |
|
119 |
for( uint l=1; l<b->num_preds(); l++ ) { |
|
120 |
Block *p = _cfg._bbs[b->pred(l)->_idx]; |
|
121 |
add_liveout( p, use, first_pass ); |
|
122 |
||
123 |
// PhiNode uses go in the live-out set of prior blocks. |
|
124 |
for( uint k=i; k>0; k-- ) |
|
125 |
add_liveout( p, _names[b->_nodes[k-1]->in(l)->_idx], first_pass ); |
|
126 |
} |
|
127 |
freeset( b ); |
|
128 |
first_pass.set(b->_pre_order); |
|
129 |
||
130 |
// Inner loop: blocks that picked up new live-out values to be propagated |
|
131 |
while( _worklist->size() ) { |
|
132 |
// !!!!! |
|
133 |
// #ifdef ASSERT |
|
134 |
iters++; |
|
135 |
// #endif |
|
136 |
Block *b = _worklist->pop(); |
|
137 |
IndexSet *delta = getset(b); |
|
138 |
assert( delta->count(), "missing delta set" ); |
|
139 |
||
140 |
// Add new-live-in to predecessors live-out sets |
|
141 |
for( uint l=1; l<b->num_preds(); l++ ) |
|
142 |
add_liveout( _cfg._bbs[b->pred(l)->_idx], delta, first_pass ); |
|
143 |
||
144 |
freeset(b); |
|
145 |
} // End of while-worklist-not-empty |
|
146 |
||
147 |
} // End of for-all-blocks-outer-loop |
|
148 |
||
149 |
// We explicitly clear all of the IndexSets which we are about to release. |
|
150 |
// This allows us to recycle their internal memory into IndexSet's free list. |
|
151 |
||
152 |
for( i=0; i<_cfg._num_blocks; i++ ) { |
|
153 |
_defs[i].clear(); |
|
154 |
if (_deltas[i]) { |
|
155 |
// Is this always true? |
|
156 |
_deltas[i]->clear(); |
|
157 |
} |
|
158 |
} |
|
159 |
IndexSet *free = _free_IndexSet; |
|
160 |
while (free != NULL) { |
|
161 |
IndexSet *temp = free; |
|
162 |
free = free->next(); |
|
163 |
temp->clear(); |
|
164 |
} |
|
165 |
||
166 |
} |
|
167 |
||
168 |
//------------------------------stats------------------------------------------ |
|
169 |
#ifndef PRODUCT |
|
170 |
void PhaseLive::stats(uint iters) const { |
|
171 |
} |
|
172 |
#endif |
|
173 |
||
174 |
//------------------------------getset----------------------------------------- |
|
175 |
// Get an IndexSet for a block. Return existing one, if any. Make a new |
|
176 |
// empty one if a prior one does not exist. |
|
177 |
IndexSet *PhaseLive::getset( Block *p ) { |
|
178 |
IndexSet *delta = _deltas[p->_pre_order-1]; |
|
179 |
if( !delta ) // Not on worklist? |
|
180 |
// Get a free set; flag as being on worklist |
|
181 |
delta = _deltas[p->_pre_order-1] = getfreeset(); |
|
182 |
return delta; // Return set of new live-out items |
|
183 |
} |
|
184 |
||
185 |
//------------------------------getfreeset------------------------------------- |
|
186 |
// Pull from free list, or allocate. Internal allocation on the returned set |
|
187 |
// is always from thread local storage. |
|
188 |
IndexSet *PhaseLive::getfreeset( ) { |
|
189 |
IndexSet *f = _free_IndexSet; |
|
190 |
if( !f ) { |
|
191 |
f = new IndexSet; |
|
192 |
// f->set_arena(Thread::current()->resource_area()); |
|
193 |
f->initialize(_maxlrg, Thread::current()->resource_area()); |
|
194 |
} else { |
|
195 |
// Pull from free list |
|
196 |
_free_IndexSet = f->next(); |
|
197 |
//f->_cnt = 0; // Reset to empty |
|
198 |
// f->set_arena(Thread::current()->resource_area()); |
|
199 |
f->initialize(_maxlrg, Thread::current()->resource_area()); |
|
200 |
} |
|
201 |
return f; |
|
202 |
} |
|
203 |
||
204 |
//------------------------------freeset---------------------------------------- |
|
205 |
// Free an IndexSet from a block. |
|
206 |
void PhaseLive::freeset( const Block *p ) { |
|
207 |
IndexSet *f = _deltas[p->_pre_order-1]; |
|
208 |
f->set_next(_free_IndexSet); |
|
209 |
_free_IndexSet = f; // Drop onto free list |
|
210 |
_deltas[p->_pre_order-1] = NULL; |
|
211 |
} |
|
212 |
||
213 |
//------------------------------add_liveout------------------------------------ |
|
214 |
// Add a live-out value to a given blocks live-out set. If it is new, then |
|
215 |
// also add it to the delta set and stick the block on the worklist. |
|
216 |
void PhaseLive::add_liveout( Block *p, uint r, VectorSet &first_pass ) { |
|
217 |
IndexSet *live = &_live[p->_pre_order-1]; |
|
218 |
if( live->insert(r) ) { // If actually inserted... |
|
219 |
// We extended the live-out set. See if the value is generated locally. |
|
220 |
// If it is not, then we must extend the live-in set. |
|
221 |
if( !_defs[p->_pre_order-1].member( r ) ) { |
|
222 |
if( !_deltas[p->_pre_order-1] && // Not on worklist? |
|
223 |
first_pass.test(p->_pre_order) ) |
|
224 |
_worklist->push(p); // Actually go on worklist if already 1st pass |
|
225 |
getset(p)->insert(r); |
|
226 |
} |
|
227 |
} |
|
228 |
} |
|
229 |
||
230 |
||
231 |
//------------------------------add_liveout------------------------------------ |
|
232 |
// Add a vector of live-out values to a given blocks live-out set. |
|
233 |
void PhaseLive::add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass ) { |
|
234 |
IndexSet *live = &_live[p->_pre_order-1]; |
|
235 |
IndexSet *defs = &_defs[p->_pre_order-1]; |
|
236 |
IndexSet *on_worklist = _deltas[p->_pre_order-1]; |
|
237 |
IndexSet *delta = on_worklist ? on_worklist : getfreeset(); |
|
238 |
||
239 |
IndexSetIterator elements(lo); |
|
240 |
uint r; |
|
241 |
while ((r = elements.next()) != 0) { |
|
242 |
if( live->insert(r) && // If actually inserted... |
|
243 |
!defs->member( r ) ) // and not defined locally |
|
244 |
delta->insert(r); // Then add to live-in set |
|
245 |
} |
|
246 |
||
247 |
if( delta->count() ) { // If actually added things |
|
248 |
_deltas[p->_pre_order-1] = delta; // Flag as on worklist now |
|
249 |
if( !on_worklist && // Not on worklist? |
|
250 |
first_pass.test(p->_pre_order) ) |
|
251 |
_worklist->push(p); // Actually go on worklist if already 1st pass |
|
252 |
} else { // Nothing there; just free it |
|
253 |
delta->set_next(_free_IndexSet); |
|
254 |
_free_IndexSet = delta; // Drop onto free list |
|
255 |
} |
|
256 |
} |
|
257 |
||
258 |
#ifndef PRODUCT |
|
259 |
//------------------------------dump------------------------------------------- |
|
260 |
// Dump the live-out set for a block |
|
261 |
void PhaseLive::dump( const Block *b ) const { |
|
262 |
tty->print("Block %d: ",b->_pre_order); |
|
263 |
tty->print("LiveOut: "); _live[b->_pre_order-1].dump(); |
|
264 |
uint cnt = b->_nodes.size(); |
|
265 |
for( uint i=0; i<cnt; i++ ) { |
|
266 |
tty->print("L%d/", _names[b->_nodes[i]->_idx] ); |
|
267 |
b->_nodes[i]->dump(); |
|
268 |
} |
|
269 |
tty->print("\n"); |
|
270 |
} |
|
271 |
||
272 |
//------------------------------verify_base_ptrs------------------------------- |
|
273 |
// Verify that base pointers and derived pointers are still sane. |
|
274 |
void PhaseChaitin::verify_base_ptrs( ResourceArea *a ) const { |
|
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
275 |
#ifdef ASSERT |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
276 |
Unique_Node_List worklist(a); |
1 | 277 |
for( uint i = 0; i < _cfg._num_blocks; i++ ) { |
278 |
Block *b = _cfg._blocks[i]; |
|
279 |
for( uint j = b->end_idx() + 1; j > 1; j-- ) { |
|
280 |
Node *n = b->_nodes[j-1]; |
|
281 |
if( n->is_Phi() ) break; |
|
282 |
// Found a safepoint? |
|
283 |
if( n->is_MachSafePoint() ) { |
|
284 |
MachSafePointNode *sfpt = n->as_MachSafePoint(); |
|
285 |
JVMState* jvms = sfpt->jvms(); |
|
286 |
if (jvms != NULL) { |
|
287 |
// Now scan for a live derived pointer |
|
288 |
if (jvms->oopoff() < sfpt->req()) { |
|
289 |
// Check each derived/base pair |
|
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
290 |
for (uint idx = jvms->oopoff(); idx < sfpt->req(); idx++) { |
1 | 291 |
Node *check = sfpt->in(idx); |
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
292 |
bool is_derived = ((idx - jvms->oopoff()) & 1) == 0; |
1 | 293 |
// search upwards through spills and spill phis for AddP |
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
294 |
worklist.clear(); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
295 |
worklist.push(check); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
296 |
uint k = 0; |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
297 |
while( k < worklist.size() ) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
298 |
check = worklist.at(k); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
299 |
assert(check,"Bad base or derived pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
300 |
// See PhaseChaitin::find_base_for_derived() for all cases. |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
301 |
int isc = check->is_Copy(); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
302 |
if( isc ) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
303 |
worklist.push(check->in(isc)); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
304 |
} else if( check->is_Phi() ) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
305 |
for (uint m = 1; m < check->req(); m++) |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
306 |
worklist.push(check->in(m)); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
307 |
} else if( check->is_Con() ) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
308 |
if (is_derived) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
309 |
// Derived is NULL+offset |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
310 |
assert(!is_derived || check->bottom_type()->is_ptr()->ptr() == TypePtr::Null,"Bad derived pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
311 |
} else { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
312 |
assert(check->bottom_type()->is_ptr()->_offset == 0,"Bad base pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
313 |
// Base either ConP(NULL) or loadConP |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
314 |
if (check->is_Mach()) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
315 |
assert(check->as_Mach()->ideal_Opcode() == Op_ConP,"Bad base pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
316 |
} else { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
317 |
assert(check->Opcode() == Op_ConP && |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
318 |
check->bottom_type()->is_ptr()->ptr() == TypePtr::Null,"Bad base pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
319 |
} |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
320 |
} |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
321 |
} else if( check->bottom_type()->is_ptr()->_offset == 0 ) { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
322 |
if(check->is_Proj() || check->is_Mach() && |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
323 |
(check->as_Mach()->ideal_Opcode() == Op_CreateEx || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
324 |
check->as_Mach()->ideal_Opcode() == Op_ThreadLocal || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
325 |
check->as_Mach()->ideal_Opcode() == Op_CMoveP || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
326 |
check->as_Mach()->ideal_Opcode() == Op_CheckCastPP || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
327 |
#ifdef _LP64 |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
328 |
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_CastPP || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
329 |
UseCompressedOops && check->as_Mach()->ideal_Opcode() == Op_DecodeN || |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
330 |
#endif |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
331 |
check->as_Mach()->ideal_Opcode() == Op_LoadP || |
2030
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
332 |
check->as_Mach()->ideal_Opcode() == Op_LoadKlass)) { |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
333 |
// Valid nodes |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
334 |
} else { |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
335 |
check->dump(); |
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
336 |
assert(false,"Bad base or derived pointer"); |
2030
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
337 |
} |
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
338 |
} else { |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
339 |
assert(is_derived,"Bad base pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
340 |
assert(check->is_Mach() && check->as_Mach()->ideal_Opcode() == Op_AddP,"Bad derived pointer"); |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
341 |
} |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
342 |
k++; |
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
343 |
assert(k < 100000,"Derived pointer checking in infinite loop"); |
1 | 344 |
} // End while |
345 |
} |
|
346 |
} // End of check for derived pointers |
|
347 |
} // End of Kcheck for debug info |
|
348 |
} // End of if found a safepoint |
|
349 |
} // End of forall instructions in block |
|
350 |
} // End of forall blocks |
|
2014
5510e7394f2d
6782232: assert("CreateEx must be first instruction in block" )
kvn
parents:
1
diff
changeset
|
351 |
#endif |
1 | 352 |
} |
2030
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
353 |
|
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
354 |
//------------------------------verify------------------------------------- |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
355 |
// Verify that graphs and base pointers are still sane. |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
356 |
void PhaseChaitin::verify( ResourceArea *a, bool verify_ifg ) const { |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
357 |
#ifdef ASSERT |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
358 |
if( VerifyOpto || VerifyRegisterAllocator ) { |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
359 |
_cfg.verify(); |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
360 |
verify_base_ptrs(a); |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
361 |
if(verify_ifg) |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
362 |
_ifg->verify(this); |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
363 |
} |
1 | 364 |
#endif |
2030
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
365 |
} |
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
366 |
|
39d55e4534b4
6791852: assert(b->_nodes[insidx] == n,"got insidx set incorrectly")
kvn
parents:
2014
diff
changeset
|
367 |
#endif |