--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Fri Jan 29 14:51:38 2010 -0800
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Mon Feb 01 17:29:01 2010 -0800
@@ -1121,10 +1121,23 @@
}
void flush() {
+ // The following appears to have been an optimization to save from
+ // doing a barrier for each individual store into the _methods array,
+ // but rather to do it for the entire array after the series of writes.
+ // That optimization seems to have been lost when compressed oops was
+ // implemented. However, the extra card-marks below was left in place,
+ // but is now redundant because the individual stores into the
+ // _methods array already execute the barrier code. CR 6918185 has
+ // been filed so the original code may be restored by deferring the
+ // barriers until after the entire sequence of stores, thus re-enabling
+ // the intent of the original optimization. In the meantime the redundant
+ // card mark below is now disabled.
if (_dirty && _methods != NULL) {
+#if 0
BarrierSet* bs = Universe::heap()->barrier_set();
assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
bs->write_ref_array((HeapWord*)_methods->base(), _methods->length());
+#endif
_dirty = false;
}
}
@@ -1168,9 +1181,7 @@
method = mhandle();
}
- _methods->obj_at_put(_index, method);
- // bad for UseCompressedOops
- // *_methods->obj_at_addr(_index) = method;
+ _methods->obj_at_put(_index, method);
_bcis->ushort_at_put(_index, bci);
_index++;
_dirty = true;