mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-25 07:09:55 +00:00
8242216: ObjectSampler::weak_oops_do() should not trigger barrier
Reviewed-by: rkennke, eosterlund
This commit is contained in:
parent
1a40b7931a
commit
e53ae5ae63
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -29,6 +29,10 @@ const oop ObjectSample::object() const {
|
||||
return NativeAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(&_object);
|
||||
}
|
||||
|
||||
const oop ObjectSample::object_raw() const {
|
||||
return RawAccess<>::oop_load(&_object);
|
||||
}
|
||||
|
||||
void ObjectSample::set_object(oop object) {
|
||||
NativeAccess<ON_PHANTOM_OOP_REF>::oop_store(&_object, object);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -108,6 +108,7 @@ class ObjectSample : public JfrCHeapObj {
|
||||
}
|
||||
|
||||
const oop object() const;
|
||||
const oop object_raw() const;
|
||||
void set_object(oop object);
|
||||
|
||||
const oop* object_addr() const {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -223,7 +223,7 @@ void ObjectSampler::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
|
||||
ObjectSample* current = sampler._list->last();
|
||||
while (current != NULL) {
|
||||
if (current->_object != NULL) {
|
||||
if (is_alive->do_object_b(current->object())) {
|
||||
if (is_alive->do_object_b(current->object_raw())) {
|
||||
// The weakly referenced object is alive, update pointer
|
||||
f->do_oop(const_cast<oop*>(current->object_addr()));
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user