comparison src/share/vm/c1/c1_ValueMap.cpp @ 6618:0bfcb7a3e12d

7171824: assert(_offset >= 1) failed: illegal call to offset() Summary: C1 value numbering hits unloaded klass. Reviewed-by: kvn, twisti
author roland
date Wed, 22 Aug 2012 14:29:57 +0200
parents f067b4e0e04b
children b9a9ed0f8eeb
comparison
equal deleted inserted replaced
6617:4b0d6fd74911 6618:0bfcb7a3e12d
188 #define MUST_KILL_FIELD(must_kill, entry, value) \ 188 #define MUST_KILL_FIELD(must_kill, entry, value) \
189 /* ciField's are not unique; must compare their contents */ \ 189 /* ciField's are not unique; must compare their contents */ \
190 LoadField* lf = value->as_LoadField(); \ 190 LoadField* lf = value->as_LoadField(); \
191 bool must_kill = lf != NULL \ 191 bool must_kill = lf != NULL \
192 && lf->field()->holder() == field->holder() \ 192 && lf->field()->holder() == field->holder() \
193 && lf->field()->offset() == field->offset(); 193 && (all_offsets || lf->field()->offset() == field->offset());
194 194
195 #define MUST_KILL_EXCEPTION(must_kill, entry, value) \ 195 #define MUST_KILL_EXCEPTION(must_kill, entry, value) \
196 assert(entry->nesting() < nesting(), "must not find bigger nesting than current"); \ 196 assert(entry->nesting() < nesting(), "must not find bigger nesting than current"); \
197 bool must_kill = (entry->nesting() == nesting() - 1); 197 bool must_kill = (entry->nesting() == nesting() - 1);
198 198
203 203
204 void ValueMap::kill_array(ValueType* type) { 204 void ValueMap::kill_array(ValueType* type) {
205 GENERIC_KILL_VALUE(MUST_KILL_ARRAY); 205 GENERIC_KILL_VALUE(MUST_KILL_ARRAY);
206 } 206 }
207 207
208 void ValueMap::kill_field(ciField* field) { 208 void ValueMap::kill_field(ciField* field, bool all_offsets) {
209 GENERIC_KILL_VALUE(MUST_KILL_FIELD); 209 GENERIC_KILL_VALUE(MUST_KILL_FIELD);
210 } 210 }
211 211
212 void ValueMap::kill_exception() { 212 void ValueMap::kill_exception() {
213 GENERIC_KILL_VALUE(MUST_KILL_EXCEPTION); 213 GENERIC_KILL_VALUE(MUST_KILL_EXCEPTION);
278 // simplified access to methods of GlobalValueNumbering 278 // simplified access to methods of GlobalValueNumbering
279 ValueMap* current_map() { return _gvn->current_map(); } 279 ValueMap* current_map() { return _gvn->current_map(); }
280 ValueMap* value_map_of(BlockBegin* block) { return _gvn->value_map_of(block); } 280 ValueMap* value_map_of(BlockBegin* block) { return _gvn->value_map_of(block); }
281 281
282 // implementation for abstract methods of ValueNumberingVisitor 282 // implementation for abstract methods of ValueNumberingVisitor
283 void kill_memory() { _too_complicated_loop = true; } 283 void kill_memory() { _too_complicated_loop = true; }
284 void kill_field(ciField* field) { current_map()->kill_field(field); }; 284 void kill_field(ciField* field, bool all_offsets) { current_map()->kill_field(field, all_offsets); };
285 void kill_array(ValueType* type) { current_map()->kill_array(type); }; 285 void kill_array(ValueType* type) { current_map()->kill_array(type); };
286 286
287 public: 287 public:
288 ShortLoopOptimizer(GlobalValueNumbering* gvn) 288 ShortLoopOptimizer(GlobalValueNumbering* gvn)
289 : _gvn(gvn) 289 : _gvn(gvn)
290 , _loop_blocks(ValueMapMaxLoopSize) 290 , _loop_blocks(ValueMapMaxLoopSize)