comparison src/share/vm/classfile/javaClasses.cpp @ 3770:74cd10898bea

6918185: Remove unused code for lost card-marking optimization in BacktraceBuilder Summary: Removed dead code Reviewed-by: ysr, coleenp, dholmes
author brutisso
date Mon, 13 Jun 2011 13:48:18 +0200
parents 167b70ff3abc
children b16582d6c7db
comparison
equal deleted inserted replaced
3769:ef2d1b8f2dd4 3770:74cd10898bea
1256 Handle _backtrace; 1256 Handle _backtrace;
1257 objArrayOop _head; 1257 objArrayOop _head;
1258 objArrayOop _methods; 1258 objArrayOop _methods;
1259 typeArrayOop _bcis; 1259 typeArrayOop _bcis;
1260 int _index; 1260 int _index;
1261 bool _dirty;
1262 No_Safepoint_Verifier _nsv; 1261 No_Safepoint_Verifier _nsv;
1263 1262
1264 public: 1263 public:
1265 1264
1266 enum { 1265 enum {
1270 trace_size = java_lang_Throwable::trace_size, 1269 trace_size = java_lang_Throwable::trace_size,
1271 trace_chunk_size = java_lang_Throwable::trace_chunk_size 1270 trace_chunk_size = java_lang_Throwable::trace_chunk_size
1272 }; 1271 };
1273 1272
1274 // constructor for new backtrace 1273 // constructor for new backtrace
1275 BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL), _dirty(false) { 1274 BacktraceBuilder(TRAPS): _methods(NULL), _bcis(NULL), _head(NULL) {
1276 expand(CHECK); 1275 expand(CHECK);
1277 _backtrace = _head; 1276 _backtrace = _head;
1278 _index = 0; 1277 _index = 0;
1279 } 1278 }
1280 1279
1281 void flush() {
1282 // The following appears to have been an optimization to save from
1283 // doing a barrier for each individual store into the _methods array,
1284 // but rather to do it for the entire array after the series of writes.
1285 // That optimization seems to have been lost when compressed oops was
1286 // implemented. However, the extra card-marks below was left in place,
1287 // but is now redundant because the individual stores into the
1288 // _methods array already execute the barrier code. CR 6918185 has
1289 // been filed so the original code may be restored by deferring the
1290 // barriers until after the entire sequence of stores, thus re-enabling
1291 // the intent of the original optimization. In the meantime the redundant
1292 // card mark below is now disabled.
1293 if (_dirty && _methods != NULL) {
1294 #if 0
1295 BarrierSet* bs = Universe::heap()->barrier_set();
1296 assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
1297 bs->write_ref_array((HeapWord*)_methods->base(), _methods->length());
1298 #endif
1299 _dirty = false;
1300 }
1301 }
1302
1303 void expand(TRAPS) { 1280 void expand(TRAPS) {
1304 flush();
1305
1306 objArrayHandle old_head(THREAD, _head); 1281 objArrayHandle old_head(THREAD, _head);
1307 Pause_No_Safepoint_Verifier pnsv(&_nsv); 1282 Pause_No_Safepoint_Verifier pnsv(&_nsv);
1308 1283
1309 objArrayOop head = oopFactory::new_objectArray(trace_size, CHECK); 1284 objArrayOop head = oopFactory::new_objectArray(trace_size, CHECK);
1310 objArrayHandle new_head(THREAD, head); 1285 objArrayHandle new_head(THREAD, head);
1326 _bcis = new_bcis(); 1301 _bcis = new_bcis();
1327 _index = 0; 1302 _index = 0;
1328 } 1303 }
1329 1304
1330 oop backtrace() { 1305 oop backtrace() {
1331 flush();
1332 return _backtrace(); 1306 return _backtrace();
1333 } 1307 }
1334 1308
1335 inline void push(methodOop method, short bci, TRAPS) { 1309 inline void push(methodOop method, short bci, TRAPS) {
1336 if (_index >= trace_chunk_size) { 1310 if (_index >= trace_chunk_size) {
1340 } 1314 }
1341 1315
1342 _methods->obj_at_put(_index, method); 1316 _methods->obj_at_put(_index, method);
1343 _bcis->ushort_at_put(_index, bci); 1317 _bcis->ushort_at_put(_index, bci);
1344 _index++; 1318 _index++;
1345 _dirty = true;
1346 } 1319 }
1347 1320
1348 methodOop current_method() { 1321 methodOop current_method() {
1349 assert(_index >= 0 && _index < trace_chunk_size, "out of range"); 1322 assert(_index >= 0 && _index < trace_chunk_size, "out of range");
1350 return methodOop(_methods->obj_at(_index)); 1323 return methodOop(_methods->obj_at(_index));