mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8249192: MonitorInfo stores raw oops across safepoints
Change raw oops in MonitorInfo to Handles and update Resource/HandleMarks. Reviewed-by: sspitsyn, dholmes, coleenp, dcubed
This commit is contained in:
parent
bb6647c845
commit
6d665ed31f
8 changed files with 62 additions and 45 deletions
|
@ -70,28 +70,32 @@ void vframeArrayElement::fill_in(compiledVFrame* vf, bool realloc_failures) {
|
|||
|
||||
int index;
|
||||
|
||||
// Get the monitors off-stack
|
||||
{
|
||||
ResourceMark rm;
|
||||
HandleMark hm;
|
||||
// Get the monitors off-stack
|
||||
|
||||
GrowableArray<MonitorInfo*>* list = vf->monitors();
|
||||
if (list->is_empty()) {
|
||||
_monitors = NULL;
|
||||
} else {
|
||||
GrowableArray<MonitorInfo*>* list = vf->monitors();
|
||||
if (list->is_empty()) {
|
||||
_monitors = NULL;
|
||||
} else {
|
||||
|
||||
// Allocate monitor chunk
|
||||
_monitors = new MonitorChunk(list->length());
|
||||
vf->thread()->add_monitor_chunk(_monitors);
|
||||
// Allocate monitor chunk
|
||||
_monitors = new MonitorChunk(list->length());
|
||||
vf->thread()->add_monitor_chunk(_monitors);
|
||||
|
||||
// Migrate the BasicLocks from the stack to the monitor chunk
|
||||
for (index = 0; index < list->length(); index++) {
|
||||
MonitorInfo* monitor = list->at(index);
|
||||
assert(!monitor->owner_is_scalar_replaced() || realloc_failures, "object should be reallocated already");
|
||||
BasicObjectLock* dest = _monitors->at(index);
|
||||
if (monitor->owner_is_scalar_replaced()) {
|
||||
dest->set_obj(NULL);
|
||||
} else {
|
||||
assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
|
||||
dest->set_obj(monitor->owner());
|
||||
monitor->lock()->move_to(monitor->owner(), dest->lock());
|
||||
// Migrate the BasicLocks from the stack to the monitor chunk
|
||||
for (index = 0; index < list->length(); index++) {
|
||||
MonitorInfo* monitor = list->at(index);
|
||||
assert(!monitor->owner_is_scalar_replaced() || realloc_failures, "object should be reallocated already");
|
||||
BasicObjectLock* dest = _monitors->at(index);
|
||||
if (monitor->owner_is_scalar_replaced()) {
|
||||
dest->set_obj(NULL);
|
||||
} else {
|
||||
assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased");
|
||||
dest->set_obj(monitor->owner());
|
||||
monitor->lock()->move_to(monitor->owner(), dest->lock());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue